Changeset 8573 for mauRepo


Ignore:
Timestamp:
27/09/12 12:41:13 (7 years ago)
Author:
mnagni
Message:

Incomplete - # 22554: "Remove the ""FollowSymLinks"""
 http://team.ceda.ac.uk/trac/ceda/ticket/22554

Fixes the localhost static files serving

Location:
mauRepo/MolesManager/trunk/cedaMoles/MolesManager
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/cedaMoles/MolesManager/settings.py

    r8571 r8573  
    1919 
    2020SITE_ROOT = os.path.dirname(os.path.abspath(__file__)) 
    21 MEDIA_ROOT = os.path.join(SITE_ROOT, 'static') 
    2221 
    2322PROJECT_DIRNAME = SITE_ROOT.split(os.sep)[-1] 
     
    7574# Example: "/home/media/media.lawrence.com/static/" 
    7675STATIC_ROOT = os.path.join(DJANGO_PROJECT, 'static') 
     76print STATIC_ROOT 
    7777 
    7878# URL prefix for static files. 
     
    8383#STATIC_URL = 'http://127.0.0.1:8000/static/' 
    8484#STATIC_ROOT = os.path.join(PROJECT_ROOT, STATIC_URL) 
    85 STATIC_URL = '/static/' 
     85STATIC_URL = 'CUSTOM_STATIC_URL' 
     86if STATIC_URL == 'CUSTOM_STATIC_URL': 
     87    STATIC_URL = 'http://127.0.0.1:8000/static/' 
     88print STATIC_URL 
    8689#STATIC_ROOT = os.path.join(PROJECT_ROOT, STATIC_URL) 
    8790 
  • mauRepo/MolesManager/trunk/cedaMoles/MolesManager/urls.py

    r8571 r8573  
    22from django.views.generic.simple import redirect_to 
    33from django.contrib.staticfiles.urls import staticfiles_urlpatterns 
     4from cedaMoles.MolesManager.settings import STATIC_ROOT, STATIC_URL 
    45 
    56# Uncomment the next two lines to enable the admin: 
     
    5455) 
    5556 
    56 urlpatterns += staticfiles_urlpatterns() 
     57if STATIC_URL == 'http://127.0.0.1:8000/static/': 
     58    urlpatterns += patterns('', 
     59       url(r'css/(?P<path>.*)$', 'django.views.static.serve', {'document_root': STATIC_ROOT+'/css' , 'show_indexes': True}), 
     60    ) 
     61 
     62    urlpatterns += patterns('', 
     63       url(r'css/960/(?P<path>.*)$', 'django.views.static.serve', {'document_root': STATIC_ROOT+'/css/960' , 'show_indexes': True}), 
     64    ) 
     65 
     66    urlpatterns += patterns('', 
     67       url(r'img/(?P<path>.*)$', 'django.views.static.serve', {'document_root': STATIC_ROOT+'/img' , 'show_indexes': True}), 
     68    ) 
     69 
     70    urlpatterns += patterns('', 
     71       url(r'js/(?P<path>.*)$', 'django.views.static.serve', {'document_root': STATIC_ROOT+'/js' , 'show_indexes': True}), 
     72    ) 
     73 
     74#urlpatterns += staticfiles_urlpatterns() 
     75 
Note: See TracChangeset for help on using the changeset viewer.