ppsirg

Untitled

Mar 10th, 2015
414
0
Never
10
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. SETTINGS.PY
  2.  
  3. # Static files (CSS, JavaScript, Images)
  4. # https://docs.djangoproject.com/en/1.7/howto/static-files/
  5.  
  6. STATIC_URL = '/static/'
  7.  
  8. # Static root
  9.  
  10. STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static')
  11.  
  12. #STATICFILES_STORAGE = STATIC_ROOT
  13.  
  14. # Media roots and url
  15. abspath = os.path.abspath(__file__)
  16. MEDIA_ROOT = os.sep.join(abspath.split(os.sep)[:-2] + ['media'])
  17.  
  18. MEDIA_URL = '/media/'
  19.  
  20. .
  21. .
  22. .
  23.  
  24. # Additional locations of static files
  25. STATICFILES_DIRS = (
  26. # Put strings here, like "/home/html/static" or "C:/www/django/static".
  27. # Always use forward slashes, even on Windows.
  28. # Don't forget to use absolute paths, not relative paths.
  29. )
  30.  
  31. # List of finder classes that know how to find static files in
  32. # various locations.
  33. STATICFILES_FINDERS = (
  34. 'django.contrib.staticfiles.finders.FileSystemFinder',
  35. 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  36. # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
  37. )
  38.  
  39.  
  40. TEMPLATE_DIRS = (
  41. os.path.join(os.path.dirname(__file__),'templates').replace('\\','/'),
  42. os.path.join(os.path.dirname(__file__),'..','registers','templates').replace('\\','/'),
  43. os.path.join(os.path.dirname(__file__),'..','citizens','templates').replace('\\','/'),
  44. )
  45.  
  46. # List of callables that know how to import templates from various sources.
  47. TEMPLATE_LOADERS = (
  48. 'django.template.loaders.filesystem.Loader',
  49. 'django.template.loaders.app_directories.Loader',
  50. # 'django.template.loaders.eggs.Loader',
  51. )
  52.  
  53. URLS.PY
  54.  
  55. urlpatterns += staticfiles_urlpatterns()
  56. urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
Add Comment
Please, Sign In to add comment