Skip to content
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

Test failing #84

Open
amo13 opened this issue May 22, 2021 · 0 comments
Open

Test failing #84

amo13 opened this issue May 22, 2021 · 0 comments

Comments

@amo13
Copy link

amo13 commented May 22, 2021

When doing a runtests.py I get a failure, because apparently the secret key for django is empty.

  warnings.warn(
/usr/lib/python3.9/site-packages/packaging/version.py:127: DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release
  warnings.warn(
Traceback (most recent call last):
  File "/home/amo/PKGBUILDS/python-django-polymorphic-tree/src/django-polymorphic-tree-2.0/runtests.py", line 97, in <module>
    runtests()
  File "/home/amo/PKGBUILDS/python-django-polymorphic-tree/src/django-polymorphic-tree-2.0/runtests.py", line 94, in runtests
    execute_from_command_line(argv)
  File "/usr/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3.9/site-packages/django/core/management/__init__.py", line 395, in execute
    django.setup()
  File "/usr/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/lib/python3.9/site-packages/django/apps/registry.py", line 122, in populate
    app_config.ready()
  File "/usr/lib/python3.9/site-packages/django/contrib/admin/apps.py", line 27, in ready
    self.module.autodiscover()
  File "/usr/lib/python3.9/site-packages/django/contrib/admin/__init__.py", line 24, in autodiscover
    autodiscover_modules('admin', register_to=site)
  File "/usr/lib/python3.9/site-packages/django/utils/module_loading.py", line 47, in autodiscover_modules
    import_module('%s.%s' % (app_config.name, module_to_search))
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 855, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/django/contrib/auth/admin.py", line 6, in <module>
    from django.contrib.auth.forms import (
  File "/usr/lib/python3.9/site-packages/django/contrib/auth/forms.py", line 11, in <module>
    from django.contrib.auth.tokens import default_token_generator
  File "/usr/lib/python3.9/site-packages/django/contrib/auth/tokens.py", line 117, in <module>
    default_token_generator = PasswordResetTokenGenerator()
  File "/usr/lib/python3.9/site-packages/django/contrib/auth/tokens.py", line 18, in __init__
    self.secret = self.secret or settings.SECRET_KEY
  File "/usr/lib/python3.9/site-packages/django/conf/__init__.py", line 90, in __getattr__
    raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.

It seems to be looking for a secret key in the config file from the django package itself, but the secret keys for my application are stored in application specific config files elsewhere...

I'd like to suggest a fix in the test rather than ignoring it or working around it, but I am not sure how, I don't know python well enough.

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

1 participant