diff --git a/config.example.toml b/config.example.toml index 5309cfd..7893192 100644 --- a/config.example.toml +++ b/config.example.toml @@ -1,4 +1,9 @@ secret_key = "" +allowed_hosts = [ + "hawk.carrade.eu" +] + +contents_dir = "/home/hawk/data" [databases.default] host = "" diff --git a/hawk/settings/base.py b/hawk/settings/base.py index 5a4e289..86dcac7 100644 --- a/hawk/settings/base.py +++ b/hawk/settings/base.py @@ -95,10 +95,10 @@ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/2.2/howto/static-files/ -STATICFILES_DIRS = [os.path.join(BASE_DIR, "static", "dist")] +STATICFILES_DIRS = [BASE_DIR / "static" / "dist"] STATIC_URL = "/static/" -MEDIA_ROOT = os.path.join(BASE_DIR, "user-generated-content") +MEDIA_ROOT = BASE_DIR / "user-generated-content" MEDIA_URL = "user-generated-content/" MAINTENANCE_MODE_STATE_FILE_PATH = "maintenance" diff --git a/hawk/settings/prod.py b/hawk/settings/prod.py index ff2a6f5..7608379 100644 --- a/hawk/settings/prod.py +++ b/hawk/settings/prod.py @@ -12,12 +12,12 @@ config = {} DEBUG = False -ALLOWED_HOSTS = [ - 'hawk.carrade.eu' -] +ALLOWED_HOSTS = config.get("allowed_hosts", ['hawk.carrade.eu']) SECRET_KEY = config["secret_key"] +CONTENTS_DIR = config.get("contents_dir", BASE_DIR / ".." / "hawk-data") + DATABASES = { "default": { "ENGINE": "django.db.backends.mysql", @@ -38,3 +38,7 @@ # mysqlclient), but it's a pain to install on CentOS. pymysql.version_info = (2, 0, 3, "final", 0) pymysql.install_as_MySQLdb() + +STATIC_ROOT = CONTENTS_DIR / "static" +MEDIA_ROOT = CONTENTS_DIR / "user-generated-content" +MAINTENANCE_MODE_STATE_FILE_PATH = CONTENTS_DIR / "maintenance" diff --git a/static/scss/bulma b/static/scss/bulma index a226cac..6de773d 160000 --- a/static/scss/bulma +++ b/static/scss/bulma @@ -1 +1 @@ -Subproject commit a226cace2dc210db39919250dffbd1afcd410c74 +Subproject commit 6de773dfb560246c3eca8f0478c9224ecd8a1a02