Another go at sorting the settings mess
This commit is contained in:
+3
-2
@@ -1,12 +1,13 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Django's command-line utility for administrative tasks."""
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
"""Run administrative tasks."""
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'polyphonic.settings')
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "polyphonic.settings.base")
|
||||
try:
|
||||
from django.core.management import execute_from_command_line
|
||||
except ImportError as exc:
|
||||
@@ -18,5 +19,5 @@ def main():
|
||||
execute_from_command_line(sys.argv)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -15,7 +15,7 @@ import os
|
||||
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent.parent.parent
|
||||
|
||||
# A place to put things
|
||||
WORK_DIR = os.environ.get("WORK_DIR") or os.path.join(BASE_DIR, "data")
|
||||
@@ -139,3 +139,4 @@ STATIC_ROOT = "static"
|
||||
CACHED_STORAGE_REMOTE = "byostorage.user.BYOStorage"
|
||||
CACHED_STORAGE_DIR = os.path.join(WORK_DIR, "cache")
|
||||
WHOOSH_INDEX = os.path.join(WORK_DIR, "index")
|
||||
STORAGE_CLASSES = ["library.gdrive.storage.GDriveLinkStorage"]
|
||||
@@ -0,0 +1,10 @@
|
||||
from .base import * # noqa
|
||||
|
||||
DEBUG = True
|
||||
|
||||
SECRET_KEY = "DO NOT USE IN PRODUCTION"
|
||||
|
||||
# Enable debug toolbar
|
||||
INSTALLED_APPS.append("debug_toolbar") # noqa
|
||||
MIDDLEWARE.insert(1, "debug_toolbar.middleware.DebugToolbarMiddleware") # noqa
|
||||
INTERNAL_IPS = ["127.0.0.1"]
|
||||
@@ -0,0 +1,4 @@
|
||||
from .base import * # noqa
|
||||
|
||||
# Enable WhiteNoise for static files
|
||||
MIDDLEWARE.insert(1, "whitenoise.middleware.WhiteNoiseMiddleware") # noqa
|
||||
Reference in New Issue
Block a user