Skip to content

Seems to fail on fresh install of Django 2.0, DRF 3.7.7 #395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JonForest opened this issue Jan 3, 2018 · 3 comments
Closed

Seems to fail on fresh install of Django 2.0, DRF 3.7.7 #395

JonForest opened this issue Jan 3, 2018 · 3 comments

Comments

@JonForest
Copy link

I installed Django 2, DRF 3.7 and DJA with

pip install django
pip install djangorestframework
pip install djangorestframework-jsonapi

As per the DRF quickstart and the DJA quickstart I added rest_framework to the INSTALLED_APPS and

REST_FRAMEWORK = {
    'PAGE_SIZE': 10,
    'EXCEPTION_HANDLER': 'rest_framework_json_api.exceptions.exception_handler',
    'DEFAULT_PAGINATION_CLASS':
        'rest_framework_json_api.pagination.PageNumberPagination',
    'DEFAULT_PARSER_CLASSES': (
        'rest_framework_json_api.parsers.JSONParser',
        'rest_framework.parsers.FormParser',
        'rest_framework.parsers.MultiPartParser'
    ),
    'DEFAULT_RENDERER_CLASSES': (
        'rest_framework_json_api.renderers.JSONRenderer',
        # If you're performance testing, you will want to use the browseable API
        # without forms, as the forms can generate their own queries.
        # If performance testing, enable:
        # 'example.utils.BrowsableAPIRendererWithoutForms',
        # Otherwise, to play around with the browseable API, enable:
        'rest_framework.renderers.BrowsableAPIRenderer'
    ),
    'DEFAULT_METADATA_CLASS': 'rest_framework_json_api.metadata.JSONAPIMetadata',
}

Key bits of the call-stack are:

  File "/Users/jonathanh/.virtualenvs/test/lib/python3.6/site-packages/rest_framework_json_api/parsers.py", line 9, in <module>
    from . import exceptions, renderers, serializers, utils
  File "/Users/jonathanh/.virtualenvs/test/lib/python3.6/site-packages/rest_framework_json_api/serializers.py", line 8, in <module>
    from rest_framework_json_api.relations import ResourceRelatedField
  File "/Users/jonathanh/.virtualenvs/test/lib/python3.6/site-packages/rest_framework_json_api/relations.py", line 8, in <module>
    from django.core.urlresolvers import NoReverseMatch
ModuleNotFoundError: No module named 'django.core.urlresolvers'
``

From https://docs.djangoproject.com/en/2.0/releases/2.0/ , it looks like this is the issue:
> The django.core.urlresolvers module is removed in favor of its new location, django.urls

I realise Django 2.0 is not listed as supported yet, but thought this worth logging anyway.
@mblayman
Copy link
Collaborator

mblayman commented Jan 4, 2018

This will be fixed once #394 is merged. It's currently blocked. DJA does not officially support Django 2.0 yet.

@mblayman
Copy link
Collaborator

mblayman commented Jan 4, 2018

I'm going to go ahead and close this as it is a duplicate of #388 (i.e. adding support for DRF 3.7 and Django 2.0).

@mblayman mblayman closed this as completed Jan 4, 2018
@JonForest
Copy link
Author

Happy for this to be closed, but might be good to an explicit note to the README that excludes Django 2.0. At the moment it's not obvious if its not supported, or if the docs just need updating.
Thanks for jumping on this so fast btw. That's nice work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants