-
Notifications
You must be signed in to change notification settings - Fork 48
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
Removed bakerydemo-settings-local.py.example
#70
Conversation
This file never worked, it caused a circular import loop since it attempts to `from bakerydemo.settings.dev import *` but the dev settings does: ```python try: from .local import * # noqa except ImportError: pass ``` Fixed the `setup.sh` script to set the correct settings module environment variable Fixes wagtail#68
Thanks @jsma ! If you remove this file a fresh install will no longer connect to the database, since the code to load the env variablies lives in the I would suggest amending the |
@@ -1,6 +0,0 @@ | |||
from bakerydemo.settings.dev import * # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should probably go
import dj_database_url | ||
|
||
# Override settings here | ||
db_from_env = dj_database_url.config(conn_max_age=500) | ||
DATABASES['default'].update(db_from_env) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is needed for fresh installs so that we have a working local.py
.
The database connection setting is actually set here: docker-wagtail-develop/docker-compose.yml Line 21 in 0d4b9c6
bakerydemo's if "DATABASE_URL" in os.environ:
DATABASES = {"default": dj_database_url.config(conn_max_age=500)} |
Ok, I see that now that it is being picked up in he base settings. Your statement about this never working is wrong, though, since that code change is only 7 months old. But anyway, thanks for your work on this. Will test again later. |
I'm sorry if my word choice seemed insulting! bakerydemo's |
No worries. Just be mindful we're building on people's volunteer work and mistakes get sometimes made. It happens. I've tested this on an existing setup and a fresh setup and this works great, thank you! |
This file never worked, it caused a circular import loop since it attempts to
from bakerydemo.settings.dev import *
but the dev settings does:Fixed the
setup.sh
script to set the correct settings module environment variableFixes #68