ob-vaults/Super_Vault/200_programming/python/django/including files.md
2024-09-12 17:54:01 +03:30

582 B

status: #doc Tags: #python/django links: Date: 2024-07-07


static files

setup

for start of project and in simple case do below

  • make folder static inside my_app folder
  • make folder with name of your app (ex:my_app) inside static folder
  • move image ,js,css files there

images

we use static templates#tags for accessing our files for images we do this in our templates

{% load static %}
<img src="{% static 'my_app/example.jpg' %}" alt="My image">

References

https://docs.djangoproject.com/en/5.0/howto/static-files/