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

django-secure-mail installation fails #9

Closed
vbretsch opened this issue May 18, 2020 · 3 comments
Closed

django-secure-mail installation fails #9

vbretsch opened this issue May 18, 2020 · 3 comments
Labels

Comments

@vbretsch
Copy link

vbretsch commented May 18, 2020

Hi there,
i installed django following these instructions: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-debian-9
after which i tried to install django-secure-mail following your instructions.
The pip install part works fine but migrating database settings via python manage.py migrate secure_mail unfortunately throws this error message:

(djangoenv) volker@debian10-django:~/django$ python manage.py migrate secure_mail
Traceback (most recent call last):
  File "manage.py", line 21, in <module>
    main()
  File "manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "/home/volker/django/djangoenv/lib/python3.7/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/home/volker/django/djangoenv/lib/python3.7/site-packages/django/core/management/__init__.py", line 377, in execute
    django.setup()
  File "/home/volker/django/djangoenv/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/volker/django/djangoenv/lib/python3.7/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/home/volker/django/djangoenv/lib/python3.7/site-packages/django/apps/config.py", line 116, in create
    mod = import_module(mod_path)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/volker/django/djangoenv/lib/python3.7/site-packages/secure_mail/apps.py", line 4, in <module>
    from .checks import (check_signing_key, check_can_import_gpg, SecureMailTags)
  File "/home/volker/django/djangoenv/lib/python3.7/site-packages/secure_mail/checks.py", line 3, in <module>
    from secure_mail.settings import (
  File "/home/volker/django/djangoenv/lib/python3.7/site-packages/secure_mail/settings.py", line 41, in <module>
    'name_real': settings.SITE_NAME,
  File "/home/volker/django/djangoenv/lib/python3.7/site-packages/django/conf/__init__.py", line 77, in __getattr__
    val = getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'SITE_NAME'
@blag
Copy link
Owner

blag commented May 19, 2020

Thanks for reporting this, this is a bug. I'll see if I can fix this and push a new version to PyPI later tonight or this week.

In the meantime, the workaround is to set a SITE_NAME variable explicitly in your settings.py. Set the value to what you would like to pass to GnuPG as the name_real keyword argument. According to the GnuPG documentation that should be "The real name of the user identity which is represented by the key." I would recommend setting it to a human-readable version of you or your site/organization's name.

@blag blag added the bug label May 19, 2020
@blag
Copy link
Owner

blag commented Jul 7, 2020

Just an update: I have been working on this a bit, and I have resolved this issue in a local branch. I will be pushing it to GitHub soon and pushing a release to PyPI hopefully later this week.

@blag
Copy link
Owner

blag commented Jul 23, 2020

I have just pushed out version 1.2.0 to PyPI, which fixes this issue. Closing. If you find that the issue is not fixed, or if it gets reopened in the future (it shouldn't), comment here and I'll reopen it.

@blag blag closed this as completed Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants