Pārlūkot izejas kodu

Always load local.py in dev

Jake Howard 2 gadi atpakaļ
vecāks
revīzija
e831dcee27
2 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  1. 5 0
      bakerydemo/settings/dev.py
  2. 0 1
      readme.md

+ 5 - 0
bakerydemo/settings/dev.py

@@ -8,3 +8,8 @@ EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
 WAGTAILADMIN_BASE_URL = "http://localhost:8000"
 
 ALLOWED_HOSTS = ["*"]
+
+try:
+    from .local import *  # noqa
+except ImportError:
+    pass

+ 0 - 1
readme.md

@@ -156,7 +156,6 @@ Next, we'll set up our local environment variables. We use [django-dotenv](https
 to help with this. It reads environment variables located in a file name `.env` in the top level directory of the project. The only variable we need to start is `DJANGO_SETTINGS_MODULE`:
 
     cp bakerydemo/settings/local.py.example bakerydemo/settings/local.py
-    echo "DJANGO_SETTINGS_MODULE=bakerydemo.settings.local" > .env
 
 To set up your database and load initial data, run the following commands: