4👍
✅
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
0👍
In your template code remove the space from:
(% static ' css/style.css' %)
|
|
|
|
#this one
- [Django]-Inspite of setting (null=True, blank=True) for ModelForm field, I get validation error on leaving the field blank
- [Django]-POST on ModelViewSet with nested object Django Rest Framework
- [Django]-Add a static html page in Django
Source:stackexchange.com