test manage.py does not work properly

28 views
Skip to first unread message

Gang Fu

unread,
Nov 2, 2015, 10:53:18 PM11/2/15
to Django REST Framework GIS
Hi,

I am new to django-rest-framework-gis library. I followed the instruction to run test, and runtest.py worked fine. However, I tried to run tests/manage.py syncdb and tests/manage.py runserver commands, and for both I got the following error message:

I did coped the local_settings.sample.py to local_settings.py and adjusted the database configurations. I looked at the settings.py, and it has SECRET_KEY defined. Can anyone help me out here?

Thank you very much!

Best,
Gang

----------------------
(env)root@workrus:~/django-rest-framework-gis# tests/manage.py syncdb
Traceback (most recent call last):
  File "tests/manage.py", line 16, in <module>
    execute_from_command_line(sys.argv)
  File "/root/django-rest-framework-gis/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 351, in execute_from_command_line
    utility.execute()
  File "/root/django-rest-framework-gis/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 343, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/root/django-rest-framework-gis/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 190, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/root/django-rest-framework-gis/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 40, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/root/django-rest-framework-gis/env/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 4, in <module>
    from django.contrib.auth import get_user_model
  File "/root/django-rest-framework-gis/env/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 7, in <module>
    from django.middleware.csrf import rotate_token
  File "/root/django-rest-framework-gis/env/local/lib/python2.7/site-packages/django/middleware/csrf.py", line 14, in <module>
    from django.utils.cache import patch_vary_headers
  File "/root/django-rest-framework-gis/env/local/lib/python2.7/site-packages/django/utils/cache.py", line 26, in <module>
    from django.core.cache import caches
  File "/root/django-rest-framework-gis/env/local/lib/python2.7/site-packages/django/core/cache/__init__.py", line 34, in <module>
    if DEFAULT_CACHE_ALIAS not in settings.CACHES:
  File "/root/django-rest-framework-gis/env/local/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
  File "/root/django-rest-framework-gis/env/local/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/root/django-rest-framework-gis/env/local/lib/python2.7/site-packages/django/conf/__init__.py", line 113, in __init__
    raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.

Nemesis

unread,
Nov 3, 2015, 4:21:12 AM11/3/15
to django-rest-...@googlegroups.com
What runtests really does is to call "./manage.py test django_restframework_gis_tests".

Try to cd into the tests directory and run:

./manage.py shell

Does it start?
--
You received this message because you are subscribed to the Google Groups "Django REST Framework GIS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framew...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gang Fu

unread,
Nov 3, 2015, 8:04:34 AM11/3/15
to django-rest-...@googlegroups.com
Hi,

under test folder, "./manage.py shell" gave me the same error message....

Best,
Gang

--
You received this message because you are subscribed to a topic in the Google Groups "Django REST Framework GIS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-rest-framework-gis/dWsLjbOQIgE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-rest-framew...@googlegroups.com.

Nemesis

unread,
Nov 3, 2015, 10:01:28 AM11/3/15
to django-rest-...@googlegroups.com
Are you sure the project is reading the right settings file?

This really sounds like a misconfiguration.

Federico
Reply all
Reply to author
Forward
0 new messages