0

I'm using a template with block tags to include a css file.

Unsure on how to manage css files, I put this in my urls.py:

url(r'style.css$','portal.views.css')

with this in my views

def css(request):
    return render_to_response('style.css')

When I use chrome's "inspect element" on any page that uses the template I can see all the css in the file, however nothing at works on the page itself. To test it I added

body 
 { 
   display:none; 
 }

But still no changes.

Do I need to render the response in a different way?

1 Answer 1

1

You shouldn't serve static files (like css files) that way. Django provides a specific solution for that, make sure you read the complete and comprehensive documentation on that.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.