Changeset 8913d43
- Timestamp:
- May 12, 2010, 11:05:42 PM (15 years ago)
- Branches:
- master, fysm-4-1, iframe, space-access, stable, stage, test-hooks
- Children:
- 80982de
- Parents:
- ca9348d
- git-author:
- Alex Dehnert <adehnert@…> (05/12/10 23:05:42)
- git-committer:
- Alex Dehnert <adehnert@…> (05/12/10 23:05:42)
- Location:
- asadb
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
asadb/settings.py
r158cc8d r8913d43 1 1 # Django settings for asadb project. 2 import os 3 import sys 4 5 SITE_ROOT = os.path.normpath(os.path.dirname(__file__)) 6 SITE_WEB_PATH = '' 7 2 8 3 9 DEBUG = True … … 38 44 # Absolute path to the directory that holds media. 39 45 # Example: "/home/media/media.lawrence.com/" 40 MEDIA_ROOT = ''46 MEDIA_ROOT = SITE_ROOT + '/media/' 41 47 42 48 # URL that handles the media served from MEDIA_ROOT. Make sure to use a 43 49 # trailing slash if there is a path component (optional in other cases). 44 50 # Examples: "http://media.lawrence.com", "http://example.com/media/" 45 MEDIA_URL = ''51 MEDIA_URL = SITE_WEB_PATH + '/media/' 46 52 47 53 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a 48 54 # trailing slash. 49 55 # Examples: "http://foo.com/media/", "/media/". 50 ADMIN_MEDIA_PREFIX = '/media/'56 ADMIN_MEDIA_PREFIX = SITE_WEB_PATH + '/media/admin/' 51 57 52 58 # Make this unique, and don't share it with anybody. -
asadb/urls.py
r0c5539a r8913d43 4 4 from django.contrib import admin 5 5 admin.autodiscover() 6 7 import settings 6 8 7 9 urlpatterns = patterns('', … … 16 18 (r'^admin/', include(admin.site.urls)), 17 19 ) 20 21 if settings.DEBUG: 22 from django.views.static import serve 23 _media_url = settings.MEDIA_URL 24 if _media_url.startswith('/'): 25 _media_url = _media_url[1:] 26 urlpatterns += patterns('', 27 (r'^%s(?P<path>.*)$' % _media_url, 28 serve, 29 {'document_root': settings.MEDIA_ROOT})) 30 del(_media_url, serve)
Note: See TracChangeset
for help on using the changeset viewer.