build fixes and static files fix, closes #28
This commit is contained in:
parent
bff2525c65
commit
6a44ef30a3
26 changed files with 91 additions and 39 deletions
|
|
@ -2,11 +2,48 @@ import socket
|
|||
from pathlib import Path
|
||||
import environ
|
||||
import os
|
||||
import logging
|
||||
import sys
|
||||
|
||||
env = environ.Env(
|
||||
DEBUG=(bool, False)
|
||||
)
|
||||
|
||||
LOGGING = {
|
||||
'version': 1,
|
||||
'disable_existing_loggers': False,
|
||||
'formatters': {
|
||||
'verbose': {
|
||||
'format': '%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
|
||||
},
|
||||
},
|
||||
'handlers': {
|
||||
'console': {
|
||||
'level': 'INFO',
|
||||
'class': 'logging.StreamHandler',
|
||||
'stream': sys.stdout,
|
||||
'formatter': 'verbose',
|
||||
'filters': [],
|
||||
},
|
||||
},
|
||||
'loggers': {
|
||||
'django': {
|
||||
'handlers': ['console'],
|
||||
'level': 'INFO',
|
||||
},
|
||||
'django.server': {
|
||||
'handlers': ['console'],
|
||||
'level': 'INFO',
|
||||
'propagate': False,
|
||||
},
|
||||
'': {
|
||||
'handlers': ['console'],
|
||||
'level': 'INFO',
|
||||
'propagate': True,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
|
||||
|
|
@ -80,10 +117,12 @@ MIDDLEWARE = [
|
|||
"django.contrib.messages.middleware.MessageMiddleware",
|
||||
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
||||
"allauth.account.middleware.AccountMiddleware", # django-allauth
|
||||
"django_project.middleware.LogRequestsMiddleware",
|
||||
]
|
||||
|
||||
if DEBUG:
|
||||
MIDDLEWARE.append("django_browser_reload.middleware.BrowserReloadMiddleware")
|
||||
MIDDLEWARE.append(
|
||||
"django_browser_reload.middleware.BrowserReloadMiddleware")
|
||||
MIDDLEWARE.append("debug_toolbar.middleware.DebugToolbarMiddleware")
|
||||
|
||||
DAISY_SETTINGS = {
|
||||
|
|
@ -164,7 +203,7 @@ STATIC_ROOT = BASE_DIR / "staticfiles"
|
|||
STATIC_URL = "/static/"
|
||||
|
||||
# https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS
|
||||
STATICFILES_DIRS = []
|
||||
STATICFILES_DIRS = [BASE_DIR / "static"]
|
||||
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#media-root
|
||||
MEDIA_ROOT = BASE_DIR / "media"
|
||||
|
|
@ -211,7 +250,9 @@ INTERNAL_IPS = [
|
|||
|
||||
# for docker development
|
||||
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
|
||||
INTERNAL_IPS.append([ip[:-1] + "1" for ip in ips])
|
||||
for ip in ips:
|
||||
INTERNAL_IPS.append(ip)
|
||||
ALLOWED_HOSTS.append(ip)
|
||||
|
||||
# https://docs.djangoproject.com/en/dev/topics/auth/customizing/#substituting-a-custom-user-model
|
||||
AUTH_USER_MODEL = "accounts.CustomUser"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue