Skip to content

docs/getting-started.md example doesn't work. #410

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
n2ygk opened this issue Feb 6, 2018 · 1 comment
Closed

docs/getting-started.md example doesn't work. #410

n2ygk opened this issue Feb 6, 2018 · 1 comment

Comments

@n2ygk
Copy link
Contributor

n2ygk commented Feb 6, 2018

Following the running the example app instructions results in several errors:

  • runtests.py is missing: not found anywhere in the repo. Did you mean django-admin.py test?
  • django-admin.py runserver errors out with:
django.core.exceptions.ImproperlyConfigured: Requested setting DEBUG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

Trying to set DJANGO_SETTINGS_MODULE complains about other missing stuff:

ModuleNotFoundError: No module named 'polymorphic'

Here's what pip freeze shows:

Django==2.0.2
djangorestframework==3.7.7
-e git+https://github.com/django-json-api/django-rest-framework-json-api.git@c5d34e2ea67bab8a4e9570f54779911570f24c83#egg=djangorestframework_jsonapi
inflection==0.3.1
packaging==16.8
pyparsing==2.2.0
pytz==2017.3
six==1.11.0

I attempted these fixes:

pip install django-polymorphic
pip install django-debug_toolbar
export DJANGO_SETTINGS_MODULE=example.settings.dev
django-admin.py runserver
...
django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues:

ERRORS:
?: debug_toolbar.middleware.DebugToolbarMiddleware is missing from MIDDLEWARE.
	HINT: Add debug_toolbar.middleware.DebugToolbarMiddleware to MIDDLEWARE.

which is weird since:

grep -nr debug_toolbar.middleware.DebugToolbarMiddleware .
...
./example/settings/dev.py:63:    'debug_toolbar.middleware.DebugToolbarMiddleware',

I've successfully used most of DJA based on usage.md but was looking for some examples, especially for resource-related fields and figured the example app would be a good place to start.

Happy to try and submit a PR with improved documentation if you can provide some guidance on what's supposed to be there. Thanks!

@mblayman
Copy link
Collaborator

mblayman commented Feb 6, 2018

I think the example app doesn't get a lot of love. Unfortunately, I don't have any immediate answers for you. The test suite runs with python setup.py test in Tox so that might be a good first thing to try and replicate.

Anything that makes the example app more runnable for others would appreciated. Thanks!

n2ygk added a commit to n2ygk/django-rest-framework-json-api that referenced this issue Feb 7, 2018
Resolves django-json-api#410: docs/getting-started.md example doesn't work.
n2ygk added a commit to n2ygk/django-rest-framework-json-api that referenced this issue Feb 9, 2018
…orted properly.

- travis caught it. This time I've done the isort locally to confirm the order.
- MIDDLEWARE_CLASSES was replaced by MIDDLEWARE as of Django 1.10 and, according to
  tox.ini, this is only testing >=1.11.
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