Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SETTINGS.PY
- # Static files (CSS, JavaScript, Images)
- # https://docs.djangoproject.com/en/1.7/howto/static-files/
- STATIC_URL = '/static/'
- # Static root
- STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static')
- #STATICFILES_STORAGE = STATIC_ROOT
- # Media roots and url
- abspath = os.path.abspath(__file__)
- MEDIA_ROOT = os.sep.join(abspath.split(os.sep)[:-2] + ['media'])
- MEDIA_URL = '/media/'
- .
- .
- .
- # Additional locations of static files
- STATICFILES_DIRS = (
- # Put strings here, like "/home/html/static" or "C:/www/django/static".
- # Always use forward slashes, even on Windows.
- # Don't forget to use absolute paths, not relative paths.
- )
- # List of finder classes that know how to find static files in
- # various locations.
- STATICFILES_FINDERS = (
- 'django.contrib.staticfiles.finders.FileSystemFinder',
- 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
- # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
- )
- TEMPLATE_DIRS = (
- os.path.join(os.path.dirname(__file__),'templates').replace('\\','/'),
- os.path.join(os.path.dirname(__file__),'..','registers','templates').replace('\\','/'),
- os.path.join(os.path.dirname(__file__),'..','citizens','templates').replace('\\','/'),
- )
- # List of callables that know how to import templates from various sources.
- TEMPLATE_LOADERS = (
- 'django.template.loaders.filesystem.Loader',
- 'django.template.loaders.app_directories.Loader',
- # 'django.template.loaders.eggs.Loader',
- )
- URLS.PY
- urlpatterns += staticfiles_urlpatterns()
- urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Advertisement