I am trying to get a django web site into production. The dev version works fine, but in production the application does not seem to find my css files.
I know that there are a lot of queries similar to mine and I have perused many and tried the suggested solutions. The production version seems to work perfectly apart from the static files issue
In settings.py I have
DEBUG=False
and
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static_files')
I have run
python manage.py collectstatic
and the css and js directories are copied correctly into my_app/static_files
I have restarted the server but it still does not function correctly.
My tree on the production server is:
.
├── my_app
│ ├── __init__.py
│ ├── settings.py
│ ├── static
│ │ ├── css
│ │ │ ├── main.css
│ │ └── js
│ ├── templates
│ │ ├── base.html
│ ├── urls.py
│ └── wsgi.py
├── boards
│ ├── admin.py
│ ├── apps.py
│ ├── __init__.py
│ ├── migrations
│ │ └── __init__.py
│ ├── models.py
│ ├── templates
│ │ └── boards
│ │ ├── about.html
│ │ ├── contact.html
│ ├── tests.py
│ ├── urls.py
│ └── views.py
├── manage.py
├── passenger_wsgi.py
├── static_files
│ ├── css
│ │ ├── main.css
│ └── js
├── _templates