Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

django static files / templates

from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    # ... the rest of your URLconf goes here ...
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Comment

django static files / templates

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, "static"),
    '/var/www/static/',
]
Comment

How to Add static files in Django template

<!-- In your templates, use the static template tag to build
the URL for the given relative path using the configured
STATICFILES_STORAGE. -->

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

PREVIOUS NEXT
Code Example
Python :: Python function to calculate LCM of 2 numbers. 
Python :: python count characters 
Python :: select random value from list python 
Python :: smallest program to make diamond python 
Python :: How to Create a Pandas DataFrame of Random Integers 
Python :: keras callbacks learning rate scheduler 
Python :: how to check if text is in upper case in python 
Python :: python depth first search 
Python :: python do nothing 
Python :: pyspark left join 
Python :: keras.layers.simplernn 
Python :: print a formatted table using python 
Python :: count frequency of characters in string 
Python :: np argmin top n 
Python :: skip error python 
Python :: pandas count rows in column 
Python :: python tkinter fenstergröße 
Python :: else if in django template 
Python :: exit in python 
Python :: pandas delete column by name 
Python :: splitting a number into digits python 
Python :: how to press enter in selenium python 
Python :: how to take input in python 
Python :: test split 
Python :: np.polyfit plot 
Python :: append in a for loop python 
Python :: flask error 
Python :: random numbers python 
Python :: fill zero behind number python 
Python :: pandas cheat sheet pdf 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =