0π
β
I am guessing you arenβt using static css sheets. I always just do:
<html>
<head>
{%block stylesheet %}
<style type="text/css" title="currentStyle">
@import "{{MEDIA_URL}}css/style.css";
</style>
{% endblock stylesheet%}
....
I then set my Media root, and store the files as
MEDIA_ROOT=<fullyquallified patyh>/Media/css/<css files>
MEDIA_URL=http://localhost/mysite/
It should be noted that STATIC_URL
defaults to MEDIA_URL
if its not defined.
π€Nix
3π
Make sure you havenβt mixed up the STATIC_ROOT
and STATIC_URL
settings.
STATIC_ROOT
defines where the files are on the storage system (usually your local hard disc for local development), while STATIC_URL
defines the URL from where the server serves them. The second one is usually referred to in templates, and it is also the value that the {% get_static_prefix %}
template tag returns.
- [Django]-Django view based cache with authed users
- [Django]-Django REST: serializer field that isn't a model field
- [Django]-Issues with Celery configuration on AWS Elastic Beanstalk β "No config updates to processes"
- [Django]-Is it ok to use Django Template Tag inside JS script
- [Django]-Django and Suds : 'NoneType' object has no attribute 'str' in suds
Source:stackexchange.com