Invito
September 15, 2021, 6:53am
1
I have set
DEBUG = False
and
STATIC_URL = '/static/'
STATICFILES_DIRS = [
BASE_DIR / "static",
]
STATIC_ROOT = "static_root"
The static files aren’t loading. I want to use the same server for serving static files and not an external one.
Thank you for your time!
What server are you using?
Invito
September 15, 2021, 12:13pm
3
Uh, I’m running it on localhost with debug false and I ran it on GoDaddy hosting also, sam e result- None of the static files are being explained.
Yes, I understand that. What server are you using to run your system? Apache, nginx, gunicorn, uwsgi, what?
Invito
September 15, 2021, 1:17pm
6
I’m watching how to deploy from this video: https://youtu.be/kBwhtEIXGII
He created a Procfile for Heroku and has web: gunicorn project.wsgi --log-file -
I don’t know what I need to do for running it on local host and then on GoDaddy hosting.
Invito
September 15, 2021, 1:36pm
7
Uh, I got it working… I installed gunicorn and whitenoise like I did for Heroku and then I added whitenoise middleware and it started working???
Whitenoise allows your python app to serve the static files. The documentation likely explains it better.
arizonv
December 6, 2022, 10:05am
9
could you solve it? I have the same problem, I’m using railway with unicorn