coltrane icon indicating copy to clipboard operation
coltrane copied to clipboard

The SECRET_KEY setting must not be empty.

Open GabeSoler opened this issue 10 months ago • 3 comments

Sorry, I keep dropping bugs. This has come up two times. The first stop was for a while, so I thought I may have done something wrong. It gets fixed by adding the key to the initialize(), but I do not know why it is not picking up the key from the .env file.

This is a project I started today, so I guess it is all coming from the last version. Also, use 'uv run' to run the commands.

File "/Users/gsole/Documents/Web-Work/portfolio/.venv/lib/python3.12/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.

GabeSoler avatar Feb 19 '25 16:02 GabeSoler

It seems that using UV requires me to move the .env to the parent folder :)

GabeSoler avatar Feb 20 '25 18:02 GabeSoler

Oh, interesting! Can you show me what the folder structure looks like or how I can replicate with a new setup?

adamghill avatar Feb 22 '25 21:02 adamghill

Hi, I am sorry my message did not have enough info. I think the key stays in memory even after a few changes.

So it has worked with the .env in different places, but it also brought the error.

I must add that transitioning other projects to UV required me to have the site folder because if I have the project all in one folder, UV complains it should be a workspace instead.

I am sorry my info is not helping here :/ I just ended up putting the variables in the app.py when it asked for it (it also asked for the URL when trying to record). Then, I commented the variables, and it continued working.

. ├── README.md ├── justfile ├── light_shadow.egg-info ├── pyproject.toml ├── site │ ├── init.py │ ├── .env │ ├── app.py │ ├── content │ ├── data │ ├── gunicorn.conf.py │ ├── output │ ├── output.json │ ├── static │ ├── templates └── uv.lock

GabeSoler avatar Feb 26 '25 10:02 GabeSoler