0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 01:46:24 +01:00

Don't import dev in project template settings

Developer settings were always imported whenever any portion of the
project template settings package itself was imported. Using production
settings would result in __init__.py importing the dev settings first,
*then* overriding those with the production settings.

This lead to somewhat counter-intuitive behaviour - dev settings that
weren't explicitly set again in production would tag along to prod.

To fix this, the project template settings package no longer imports
dev, and settings.dev is explicitly used in both manage.py and wsgi.py.
This commit is contained in:
Tomas Olander 2016-04-18 21:20:34 +02:00 committed by Matt Westcott
parent d2f087f092
commit 4bb2bf2bbd
3 changed files with 2 additions and 3 deletions

View File

@ -5,7 +5,7 @@ import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings.dev")
from django.core.management import execute_from_command_line

View File

@ -1 +0,0 @@
from .dev import *

View File

@ -13,6 +13,6 @@ import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings.dev")
application = get_wsgi_application()