Changeset cafab4c
- Timestamp:
- Jan 8, 2010, 4:49:02 AM (16 years ago)
- Branches:
- master, client
- Children:
- b0f541c
- Parents:
- 70ce03a
- git-author:
- Alex Dehnert <adehnert@…> (01/08/10 04:49:02)
- git-committer:
- Alex Dehnert <adehnert@…> (01/08/10 04:49:02)
- Location:
- treasury
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
treasury/settings.py
rf468e6d rcafab4c 2 2 import os 3 3 4 APP_ROOT = os.path.dirname(__file__)4 SITE_ROOT = os.path.normpath(os.path.dirname(__file__)) 5 5 DEFAULT_DOMAIN = 'mit.edu' 6 6 … … 40 40 # Absolute path to the directory that holds media. 41 41 # Example: "/home/media/media.lawrence.com/" 42 MEDIA_ROOT = '' 42 MEDIA_ROOT = SITE_ROOT + '/media/' 43 print "MEDIA_ROOT='%s'" % (MEDIA_ROOT, ) 43 44 44 45 # URL that handles the media served from MEDIA_ROOT. Make sure to use a 45 46 # trailing slash if there is a path component (optional in other cases). 46 47 # Examples: "http://media.lawrence.com", "http://example.com/media/" 47 MEDIA_URL = ' '48 MEDIA_URL = '/media/' 48 49 49 50 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a 50 51 # trailing slash. 51 52 # Examples: "http://foo.com/media/", "/media/". 52 ADMIN_MEDIA_PREFIX = '/media/ '53 ADMIN_MEDIA_PREFIX = '/media/admin/' 53 54 54 55 # Make this unique, and don't share it with anybody. … … 76 77 # Always use forward slashes, even on Windows. 77 78 # Don't forget to use absolute paths, not relative paths. 78 APP_ROOT + '/templates/',79 SITE_ROOT + '/templates/', 79 80 ) 80 81 -
treasury/urls.py
rdbc9bf9 rcafab4c 1 1 from django.conf.urls.defaults import * 2 2 from django.contrib.auth.views import login 3 4 import settings 3 5 4 6 # Necessary views … … 23 25 (r'^accounts/login/', login, ), 24 26 ) 27 28 if settings.DEBUG: 29 from django.views.static import serve 30 _media_url = settings.MEDIA_URL 31 if _media_url.startswith('/'): 32 _media_url = _media_url[1:] 33 urlpatterns += patterns('', 34 (r'^%s(?P<path>.*)$' % _media_url, 35 serve, 36 {'document_root': settings.MEDIA_ROOT})) 37 del(_media_url, serve)
Note: See TracChangeset
for help on using the changeset viewer.