environ error
nerdoc opened this issue · comments
After going through the setup, I try to get it running by starting ./manage.py runserver
- but it crashes:
Traceback (most recent call last):
File "./manage.py", line 27, in <module>
execute_from_command_line(sys.argv)
File "/home/christian/.local/share/virtualenvs/cookiecutter-django-vue-L7tyPivc/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/home/christian/.local/share/virtualenvs/cookiecutter-django-vue-L7tyPivc/lib/python3.7/site-packages/django/core/management/__init__.py", line 325, in execute
settings.INSTALLED_APPS
File "/home/christian/.local/share/virtualenvs/cookiecutter-django-vue-L7tyPivc/lib/python3.7/site-packages/django/conf/__init__.py", line 79, in __getattr__
self._setup(name)
File "/home/christian/.local/share/virtualenvs/cookiecutter-django-vue-L7tyPivc/lib/python3.7/site-packages/django/conf/__init__.py", line 66, in _setup
self._wrapped = Settings(settings_module)
File "/home/christian/.local/share/virtualenvs/cookiecutter-django-vue-L7tyPivc/lib/python3.7/site-packages/django/conf/__init__.py", line 157, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/home/christian/.local/share/virtualenvs/cookiecutter-django-vue-L7tyPivc/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/christian/tmp/cookiecutter-django-vue/medux/backend/config/settings.py", line 10, in <module>
import environ
File "/home/christian/.local/share/virtualenvs/cookiecutter-django-vue-L7tyPivc/lib/python3.7/site-packages/environ.py", line 114
raise ValueError, "No frame marked with %s." % fname
^
SyntaxError: invalid syntax
This mainly isn't your fault mainly, because it seems that the environ module you are importing has a problem using the old Python2 syntax - which seems not working here...
Do you officially support Python3? The "environ" module was released in 2007 on pypi, which is - kind of - outdated ;-)
Could you please move to something else - e.g. os.environ
?
I am using django-environ version 0.4.5 exactly like @vchaptsev and bumped django to Django 2.2.3 and it works with no issues.
That package was updated 25 days ago, even if the version didn't change:
https://github.com/joke2k/django-environ
So I've no ideea why it works, but for me it works.
I bumped a few more things and it works, but also added some stuff that I need. Later on I can modify the requirements if you want and do a PR.
@io-ma thanks!
actually I've updated backend requirements yesterday, seems to be fine
I'll close this one, cz it is probably fixed
If someone gets it again – please feel free to reopen