Split up static files into static and django_static

This commit is contained in:
Julian Müller (ChaoticByte) 2024-02-13 18:01:40 +01:00
parent 3a9b2c25e7
commit 0f4b1d9da2
22 changed files with 9 additions and 4 deletions

2
.gitignore vendored
View file

@ -1,7 +1,7 @@
/data/* /data/*
/data/logs/* /data/logs/*
/data/tls/* /data/tls/*
/data/static/* /data/django_static/*
/data/profilepictures/* /data/profilepictures/*
/data/archive/* /data/archive/*
!/data/logs/ !/data/logs/

View file

@ -17,7 +17,11 @@
} }
# static files # static files
file_server /static/* { file_server /static/* {
root {$DATADIR}/static/.. root {$ROOTDIR}
}
# django static files
file_server /django_static/* {
root {$DATADIR}/django_static/..
} }
# favicon # favicon
redir /favicon.ico /static/favicon.ico redir /favicon.ico /static/favicon.ico

View file

@ -149,8 +149,8 @@ LOCALE_PATHS = [
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/ # https://docs.djangoproject.com/en/4.1/howto/static-files/
STATIC_URL = "static/" STATIC_URL = "django_static/"
STATIC_ROOT = BASE_DIR / "data" / "static" STATIC_ROOT = BASE_DIR / "data" / "django_static"
# Default primary key field type # Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field

View file

@ -131,6 +131,7 @@ if __name__ == "__main__":
["./venv/bin/python3", "./manage.py", "migrate", "--noinput"], env=os.environ).wait() ["./venv/bin/python3", "./manage.py", "migrate", "--noinput"], env=os.environ).wait()
# Caddy configuration via env # Caddy configuration via env
environment_caddy = os.environ environment_caddy = os.environ
environment_caddy["ROOTDIR"] = str(base_directory.absolute())
environment_caddy["DATADIR"] = str(data_directory.absolute()) environment_caddy["DATADIR"] = str(data_directory.absolute())
environment_caddy["CADDY_HOSTS"] = ", ".join(config["caddy"]["hosts"]) environment_caddy["CADDY_HOSTS"] = ", ".join(config["caddy"]["hosts"])
environment_caddy["HTTP_PORT"] = str(config["caddy"]["http_port"]) environment_caddy["HTTP_PORT"] = str(config["caddy"]["http_port"])

View file

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 145 B

After

Width:  |  Height:  |  Size: 145 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 240 B

After

Width:  |  Height:  |  Size: 240 B

Before After
Before After