Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css static file in pythonanywhere not found

I understand that the topic was not raised once, I reread and tried all the options, but for some reason the error does not go away and the styles do not connectenter image description here

connect static

path directory

error in load site

path in templates

like image 735
Capricorn Avatar asked Jan 29 '26 09:01

Capricorn


1 Answers

On your own local system static files will be served by the django dev server. In a production setting like PythonAnywhere, you need to set the STATIC_ROOT in your settings.py, eg: /home/yourusername/myproject/static

and then run python manage.py collectstatic which will collect static files from your app folders and put them in there

like image 57
rahul.m Avatar answered Jan 30 '26 23:01

rahul.m



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!