# GUNICORN Static Files

## Which server looks where

### development server
`manage.py runserver` looks everywhere (e.g. for admin static files in .venv)

### gunicorn
`gunicorn` looks in *staticfiles* if defined in `configs.py` by defining `STATIC_ROOT = BASE_DIR / "staticfiles"`

### nginx
`nginx` needs definition in
```
    location /static/ {
        alias /home/<user>/<dir>/<dir>/staticfiles/;
    }
```
- important are the slashes!

:::info
If access rights are missing: `sudo chmod o+x /home/<user>` should be enough
:::

:::info
add `staticfiles/` to `.gitignore`
:::
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9