Facing Problem in overriding CSS

41 views
Skip to first unread message

chirag soni

unread,
Mar 24, 2019, 12:50:11 PM3/24/19
to django...@googlegroups.com
Hi Team,

Could you show me the complete process of overriding django-oscar css.
As per the documentataion I tried to use STATICFIES_DIRS = [ ] but
still not able to do that. The main problem I am facing, after putting
my effort, is in the chrome developer tool it shows that it is still
pointing .less instead of my own css for which I mentioned the path in
the STATICFIES_DIRS.

This is the styles sheet using in layout.html(which extends base.html)
<link rel="stylesheet" type="text/css" href="{% static
"oscar/css/styles.css" %}" />

Tea Xchange

unread,
Mar 24, 2019, 12:56:14 PM3/24/19
to django...@googlegroups.com
Did you use the collectstatic command ?

--
https://github.com/django-oscar/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
---
You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-oscar.
To view this discussion on the web, visit https://groups.google.com/d/msgid/django-oscar/CABANgHXQ3RasBuWG9gcUHWh3117hYotRmk_eJ67qQFT652SfsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

chirag soni

unread,
Mar 24, 2019, 1:19:43 PM3/24/19
to django...@googlegroups.com
Yes. 
Like this: 
python manage.py runserver collectstatic



Tea Xchange

unread,
Mar 24, 2019, 1:21:36 PM3/24/19
to django...@googlegroups.com
Then it means both the Django Oscar css and ur own css are being referenced by staticfiles_dirs=[]

chirag soni

unread,
Mar 24, 2019, 1:23:50 PM3/24/19
to django...@googlegroups.com
Now what to do? 
And in chrome developer tool it is showing that still it is using. less

Tea Xchange

unread,
Mar 25, 2019, 8:40:29 AM3/25/19
to django...@googlegroups.com
Hello try removing the Django Oscar static files from the static folder 

chirag soni

unread,
Mar 25, 2019, 1:41:22 PM3/25/19
to django...@googlegroups.com
Now I am running the app in incognito browser and no CSS is coming. Front end is looking very ugly (that is what I want as I want to apply my own CSS.) From Django debug tool I found that it's pointing to my own static directory I mentioned under STATICFILES_DIRS.  Now in that static directory I have one file: style. css whose path is appearing in django debug tool but I am not able to understand that when I modify some CSS properties in that file then it's not going to reflect in browser. 

Why..?? 

chirag soni

unread,
Mar 25, 2019, 2:11:29 PM3/25/19
to django...@googlegroups.com
I copied Django-Oscar's styles.css file and pasted it in my own static directory: 
yourappsfolder/static/oscar/css/styles.css. and gave the path in STATICFILES_DIRS and verified that Oscar is referring to above directory using Django debug tool but there is no effect of this file in browser so I created one more file any.css and pasted all the properties of styles.css in it and linked it in the layout.html template below the already linked styles.css. Now I refreshed browser and found that this time rendering was happening properly.  

Why the rendering was not happening when styles.css alone was there. 

chirag soni

unread,
Mar 25, 2019, 2:12:58 PM3/25/19
to django...@googlegroups.com
I copied Django-Oscar's styles.css file and pasted it in my own static directory: 
yourappsfolder/static/oscar/css/styles.css. and gave the path in STATICFILES_DIRS and verified that Oscar is referring to above directory using Django debug tool but there is no effect of this file in browser so I created one more file any.css and pasted all the properties of styles.css in it and linked it in the layout.html template below the already linked styles.css. Now I refreshed browser and found that this time rendering was happening properly.  

Why the rendering was not happening when styles.css alone was there. 

Reply all
Reply to author
Forward
0 new messages