Advertisement
Guest User

Untitled

a guest
Feb 5th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. MEDIA_ROOT = os.path.join(SITE_ROOT, 'media')
  2.  
  3. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  4. # trailing slash.
  5. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
  6. MEDIA_URL = '/media/'
  7.  
  8. # Absolute path to the directory static files should be collected to.
  9. # Don't put anything in this directory yourself; store your static files
  10. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  11. # Example: "/home/media/media.lawrence.com/static/"
  12. STATIC_ROOT = os.path.join(SITE_ROOT, 'static')
  13.  
  14. # URL prefix for static files.
  15. # Example: "http://media.lawrence.com/static/"
  16. STATIC_URL = '/static/'
  17.  
  18. # URL prefix for admin static files -- CSS, JavaScript and images.
  19. # Make sure to use a trailing slash.
  20. # Examples: "http://foo.com/static/admin/", "/static/admin/".
  21. ADMIN_MEDIA_PREFIX = '/static/admin/'
  22.  
  23. STATICFILES_FINDERS = (
  24. 'django.contrib.staticfiles.finders.FileSystemFinder',
  25. 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  26. # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
  27. )
  28.  
  29. INSTALLED_APPS = (
  30. # django apps
  31. 'django.contrib.admin',
  32. 'django.contrib.admindocs',
  33. 'django.contrib.auth',
  34. 'django.contrib.contenttypes',
  35. 'django.contrib.messages',
  36. 'django.contrib.sessions',
  37. 'django.contrib.sites',
  38. 'django.contrib.staticfiles',
  39.  
  40. option_list = BaseCommand.option_list + (
  41. make_option('--noreload', action='store_false', dest='use_reloader', default=True,
  42. help='Tells Django to NOT use the auto-reloader.'),
  43. make_option('--adminmedia', dest='admin_media_path', default='',
  44. help='Specifies the directory from which to serve admin media.'),
  45. )
  46.  
  47. try:
  48. path = admin_media_path or django.__path__[0] + '/contrib/admin/media'
  49.  
  50. if settings.DEBUG:
  51. urlpatterns += patterns('',
  52. url(r'^somepath/(?P<path>.*)$', 'django.contrib.staticfiles.views.serve'),
  53. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement