3π
I think you miss this in urls.py:
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
# ... the rest of your URLconf goes here ...
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
This work in dev, in production you must collectstatic with manage.py and serve statics with nginx(or apache).
1π
for django==2.0.2 none of the urls.py changes are necessary, just get STATIC_URL in settings.py right
- [Django]-What are some of the core conceptual differences between C# and Python?
- [Django]-Django save form β overwrite old row
- [Django]-'ImageFieldFile' object has no attribute 'content_type' only after picture has already been uploaded then isn't either changed or removed
- [Django]-Error running WSGI application , ModuleNotFoundError: No module named 'mysite'
0π
Run into the same issue, after searching without any solution, I casually pressed Enter
in CMD window, and python runserver continued and I found /static/css/blog.css
was successfully found.
- [Django]-Calculate average exchange rate for time period
- [Django]-Django ORM equivalent for this SQL..calculated field derived from related table
- [Django]-Filter/order django rest api on a property=value but property is a value instead of a field
- [Django]-'Cannot alter upload handlers' while trying to upload file
- [Django]-Django South is not creating a table for user_profiles
0π
I had the some problem and the solution that works for me was stop the server using CRTL-BREAK and start again. I am using Django v.3.0.7.
- [Django]-Server lagging β Django + mongodb + cronjob
- [Django]-How do I set the from_email var
- [Django]-Django rest framework: How to change error response format globally
- [Django]-Django: "auto_now_add=True" giving incorrect time
0π
If you are not extending from other html file as in your case then the first entry in your html file should be !DOCTYPE html and then the load template tag i.e {%load staticfiles%}.
- [Django]-How to use Apache to serve Django server and React client?
- [Django]-Django on IIS, process exited unexpectedly
- [Django]-Calling a view from a management command
0π
For anyone who this after django removed the import of os in the settings file.
Use STATIC_ROOT = BASE_DIR / 'static'
instead of os.path.....
.
- [Django]-Filter JSON field django with greater than, less than and a range using _contains
- [Django]-Run the right scripts before deployment elastic beanstalk
- [Django]-Can Django Syncdb handle compressed initial_data.json.tgz fixtures?
- [Django]-Django-paypal change currency to euro