Wagtail and get_schemajs_view in Django 4
See original GitHub issueIssue Summary
We currently are trying to upgrade to Django 4 and Wagtail 3 but right now we are stuck with get_schemajs_view
from Django Rest Framework failing. The problem happens in wagtail/api/v2/views.py Line 532 in PagesAPIViewset
File "/Users/saschahofmann/Projects/gyana/.venv/lib/python3.9/site-packages/wagtail/api/v2/views.py", line 533, in get_queryset
request.GET.get("type", "wagtailcore.Page")
AttributeError: 'NoneType' object has no attribute 'GET'
It seems like the request
can be None when the schema is loaded/created. In fact, we catch this for our own ViewSets in some places.
I started to add some handling for when request
is None but before I go to deep, I wanted to ask whether you guys know what’s up. I thought maybe it’s related to #3549 but this was working before the upgrade so I am not convinced.
Technical details
- Python version: 3.9.4
- Django version: 4.0.4
- Wagtail version: 3.0
Issue Analytics
- State:
- Created a year ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Integrating Wagtail into a Django project
Wagtail provides the wagtail start command and project template to get you started with a new Wagtail project as quickly as possible, but...
Read more >Wagtail 4.0 release notes
This release adds support for Django 4.1. When upgrading, please note that the django-taggit library also needs to be updated to 3.0.0 or ......
Read more >How to add Wagtail into an existing Django project
Configuring Django to load Wagtail involves adding modules and variables to settings.py and URL configuration to urls.py . For a more complete view...
Read more >Wagtail CMS - Django Content Management System
Meet Wagtail, an open-source Django content management system powered by Python. It's free, beautiful, versatile and fast. Find out how to get started....
Read more >Configuring Django for Wagtail
Configuring Django to load Wagtail involves adding modules and variables to settings.py and URL configuration to urls.py . For a more complete view...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok I am able to get rid of the error by monkey patching PagesAPIViewset like this
PagesAPIViewSet.schema = None
That way it’s ignored during schema creation. not ideal though
Is there a way for me to somehow ignore these new views?