Commit a68b8a4b authored by Florent Chehab's avatar Florent Chehab

Merge branch 'clean_django_settings' into 'master'

More robust django settings and removed STATICFILES_DIRS

See merge request !53
parents bee7ef35 aace525b
Pipeline #35526 passed with stages
in 3 minutes and 50 seconds
......@@ -9,10 +9,10 @@ https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
from os.path import dirname
from os.path import dirname, normpath, join
import sys
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
# Build paths inside the project like this: join(BASE_DIR, ...)
# Is the root of the REPOSITORY
BASE_DIR = dirname(dirname(dirname(os.path.abspath(__file__))))
......@@ -58,24 +58,13 @@ if os.environ["ENV"] == "DEV":
else:
DEBUG = False
##########
# Webpack loader related
WEBPACK_LOADER = {
"DEFAULT": {
"BUNDLE_DIR_NAME": "base_app/bundles/",
"STATS_FILE": os.path.join(BASE_DIR, "frontend/webpack-stats.json"),
"STATS_FILE": join(BASE_DIR, "frontend/webpack-stats.json"),
}
}
STATICFILES_DIRS = (
os.path.join(
BASE_DIR, "backend/base_app/static/base_app"
), # We do this so that django's collectstatic copies or our bundles to the STATIC_ROOT or syncs them to whatever storage we use.
)
# End of webpack loader related
###########
ALLOWED_PHOTOS_EXTENSION = ["jpg", "jpeg", "png", "svg"]
INTERNAL_IPS = ["127.0.0.1"]
......@@ -149,7 +138,7 @@ DATABASES = {
# DATABASES = {
# "default": {
# "ENGINE": "django.db.backends.sqlite3",
# "NAME": os.path.join(PROJECT_DIR, "../database.db"),
# "NAME": join(PROJECT_DIR, "../database.db"),
# }
# }
......@@ -178,7 +167,7 @@ USE_L10N = True
USE_TZ = True
STATIC_URL = "/static/"
STATIC_ROOT = os.path.join(BASE_DIR, "static")
STATIC_ROOT = normpath(join(BASE_DIR, "static"))
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
MEDIA_ROOT = normpath(join(BASE_DIR, "media"))
MEDIA_URL = "/media/"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment