Space-Eye / serd

GNU General Public License v3.0
0 stars 0 forks source link

Config-file in repo aufnehmen #87

Open bengeisler opened 2 years ago

bengeisler commented 2 years ago

Der Server kann lokal nicht mehr gestartet werden, weil das config-file nicht im repo enthalten ist.

Traceback (most recent call last): File "../../repos/serd/manage.py", line 21, in <module> main() File "../../repos/serd/manage.py", line 17, in main execute_from_command_line(sys.argv) File "/Users/b/Documents/venv/serdenv/serdenv/lib/python3.8/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line utility.execute() File "/Users/b/Documents/venv/serdenv/serdenv/lib/python3.8/site-packages/django/core/management/__init__.py", line 386, in execute settings.INSTALLED_APPS File "/Users/b/Documents/venv/serdenv/serdenv/lib/python3.8/site-packages/django/conf/__init__.py", line 87, in __getattr__ self._setup(name) File "/Users/b/Documents/venv/serdenv/serdenv/lib/python3.8/site-packages/django/conf/__init__.py", line 74, in _setup self._wrapped = Settings(settings_module) File "/Users/b/Documents/venv/serdenv/serdenv/lib/python3.8/site-packages/django/conf/__init__.py", line 183, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/local/Cellar/python@3.8/3.8.13/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 843, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/Users/b/Documents/repos/serd/serd/settings.py", line 148, in <module> EMAIL_PORT = config['mail'].get('smtp-port') File "/usr/local/Cellar/python@3.8/3.8.13/Frameworks/Python.framework/Versions/3.8/lib/python3.8/configparser.py", line 960, in __getitem__ raise KeyError(key) KeyError: 'mail'

loreson commented 2 years ago

Das ist absichtlich nicht im repo, da es das E-Mail Passwort und den Django key enthält. eine Datei mit

[mail]
[key]
key=<RandomKey>

sollte als Minimalconfig reichen

bengeisler commented 2 years ago

Habe ich gemacht. Ich bekomme es trotzdem nicht mehr zum Laufen. Der Server gibt nur Statuscode 400 Bad Request zurück. Muss ich noch etwas anpassen?

loreson commented 2 years ago

Es wird aussagekräftiger wenn du in der settings "DEBUG=True" setzt. Aber vermutlich liegts an den ALLOWED_HOSTS