Skip to content

Commit

Permalink
Setup staticfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
ipmb committed Feb 9, 2024
1 parent 1c117f4 commit 5e8607f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
__pycache__
.venv
*.egg-info
{{ project_name }}.yml
docs/_build
/{{ project_name }}.yml
/staticfiles
.vscode
4 changes: 0 additions & 4 deletions project_name/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ class AppConfig(GoodConf):
description="A long random string you keep secret "
"https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#secret-key",
)
STATIC_ROOT: str = Field(
os.path.join(PROJECT_DIR, "static"),
description="Path to static files in the project",
)
ENVIRONMENT: str = Field(
"test",
description="Deploy environment",
Expand Down
7 changes: 6 additions & 1 deletion project_name/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@

STATIC_URL = "/static/"

STATIC_ROOT = config.STATIC_ROOT
STATIC_ROOT = BASE_DIR / "staticfiles"

STATICFILES_DIRS = [
BASE_DIR / "static",
BASE_DIR.parent() / "client" / "dist",
]

# Whitenoise
# http://whitenoise.evans.io/en/stable/
Expand Down

0 comments on commit 5e8607f

Please sign in to comment.