diff --git a/.gitignore b/.gitignore index d61490f..26319ce 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,6 @@ node_modules # conf /bugsink_conf.py + +# static files +/collectedstatic diff --git a/bugsink/settings/default.py b/bugsink/settings/default.py index 423f108..71766f3 100644 --- a/bugsink/settings/default.py +++ b/bugsink/settings/default.py @@ -66,6 +66,7 @@ TAILWIND_APP_NAME = 'theme' MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', + 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', @@ -174,6 +175,7 @@ STATIC_URL = 'static/' STATICFILES_DIRS = [ BASE_DIR / "static", ] +STATIC_ROOT = BASE_DIR / "collectedstatic" # Default primary key field type # https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field diff --git a/docs/tutorials/local-install.md b/docs/tutorials/local-install.md index 4326ab3..efd8cec 100644 --- a/docs/tutorials/local-install.md +++ b/docs/tutorials/local-install.md @@ -107,6 +107,23 @@ bugsink-manage createsuperuser This will create a new user account with administrative privileges. +## Collect static files + +Bugsink uses static files for its web interface. + +You can collect the static files by running: + +```bash +bugsink-manage collectstatic --noinput +``` + +You should see something like + +``` +123 static files copied to '/path/to/your/working/dir/collectedstatic'. +``` + + ## Run the Bugsink server The recommended way to run Bugsink is using Gunicorn, a WSGI server. @@ -118,7 +135,7 @@ PYTHONUNBUFFERED=1 gunicorn --bind="127.0.0.1:9000" --access-logfile - --capture ``` You should see output indicating that the server is running. You can now access Bugsink by visiting -http://localhost:9000/ in your web browser. +http://127.0.0.1:9000/ in your web browser. diff --git a/requirements.txt b/requirements.txt index 90bb765..762dae0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,6 +8,7 @@ pygments==2.16.* inotify_simple brotli python-dateutil +whitenoise # testing/development only: requests