Static FilesLesson 39Free preview
Add Static Files
This lesson is part of Django · All levels
Summary
Static files such as CSS, JavaScript, and images are stored in the static folder of the application. You set up the STATIC_URL and STATICFILES_DIRS so Django could find it. Then the file can be referenced in the template using a static tag.
Key points
- Create static folders in the app
- Set the STATIC_URL at settings.py
- Refer to the file with {% static 'name' %}
- It works for CSS, JS, images
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.