Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% load staticfiles %}
- <img src="{% static "articles/css/base.css" %}" alt="My image"/>
- mysite
- articles
- static
- articles
- css
- base.css
- static
- images
- css
- default.css
- js
- templates
- base.html
- settings.py
- # looks for static files in each app
- STATICFILES_FINDERS = (
- 'django.contrib.staticfiles.finders.FileSystemFinder',
- 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
- )
- STATICFILES_STORAGE = (
- 'django.contrib.staticfiles.storage.StaticFilesStorage'
- )
- # the absolute path to the directory where collectstatic will collect static files for deployment (OUTPUT)
- STATIC_ROOT = ''
- # This setting defines the additional locations the static files app will traverse if the FileSystemFinder finder is enabled.
- STATICFILES_DIRS = (
- # used for static assets that aren't tied to a particular app
- os.path.join(BASE_DIR, 'static'),
- )
- # URL to use when referring to static files located in STATIC_ROOT
- STATIC_URL = '/static/'
- STATICFILES_DIRS = (
- os.path.join(BASE_DIR, "static"), # That's it!!
- '/var/www/static/',
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement