I am creating my application using Django, and am wondering how I can make Django use my CSS file? What settings do I need to do to make Django see the css file?
NB: On a local machine
css . In other words, your stylesheet should be at polls/static/polls/style. css . Because of how the AppDirectoriesFinder staticfile finder works, you can refer to this static file in Django as polls/style.
Use either Materialize CSS or Bulma for your Django project to make it look nice without much hassle.
CSS learning checklist Create a simple HTML file with basic elements in it. Use the python -m SimpleHTTPServer command to serve it up. Create a <style></style> element within the <head> section in the HTML markup. Play with CSS within that style element to change the look and feel of the page.
If you're using the development server follow the django project's how-to guide for managing static files to setup your URL's, then reference you media files in the template -- say, an image inside an image folder from /site_media/images/foo.gif
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With