Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rex Dri
Rex Dri
Commits
aace525b
Commit
aace525b
authored
Feb 26, 2019
by
Florent Chehab
Browse files
More robust django settings and removed STATICFILES_DIRS
parent
bee7ef35
Pipeline
#35525
passed with stages
in 3 minutes and 21 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
backend/base_app/settings.py
View file @
aace525b
...
...
@@ -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
=
norm
path
(
join
(
BASE_DIR
,
"static"
)
)
MEDIA_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
"media"
)
MEDIA_ROOT
=
norm
path
(
join
(
BASE_DIR
,
"media"
)
)
MEDIA_URL
=
"/media/"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment