Changeset 8571 for mauRepo


Ignore:
Timestamp:
26/09/12 15:30:31 (7 years ago)
Author:
mnagni
Message:

Complete - # 22551: List resources / display single file
 http://team.ceda.ac.uk/trac/ceda/ticket/22551

Starts to update #22554. Works correctly on a localhost base

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

Legend:

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

    r8492 r8571  
    1818) 
    1919 
    20 PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) 
    21  
    22 PROJECT_DIRNAME = PROJECT_ROOT.split(os.sep)[-1] 
     20SITE_ROOT = os.path.dirname(os.path.abspath(__file__)) 
     21MEDIA_ROOT = os.path.join(SITE_ROOT, 'static') 
     22 
     23PROJECT_DIRNAME = SITE_ROOT.split(os.sep)[-1] 
    2324 
    2425 
     
    2829    'default': { 
    2930        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 
    30         'NAME': PROJECT_ROOT+'/sqlite.db',                      # Or path to database file if using sqlite3. 
     31        'NAME': '/sqlite.db',                      # Or path to database file if using sqlite3. 
    3132        'USER': '',                      # Not used with sqlite3. 
    3233        'PASSWORD': '',                  # Not used with sqlite3. 
     
    8081#Deployment parameterized version 
    8182#STATIC_URL = 'http://localhost' 
    82 STATIC_URL = 'http://127.0.0.1:8000/static/' 
     83#STATIC_URL = 'http://127.0.0.1:8000/static/' 
    8384#STATIC_ROOT = os.path.join(PROJECT_ROOT, STATIC_URL) 
    84 #STATIC_URL = '/static/' 
     85STATIC_URL = '/static/' 
    8586#STATIC_ROOT = os.path.join(PROJECT_ROOT, STATIC_URL) 
    8687 
     
    236237MIGRATION_INTERVAL = 86400 
    237238 
    238 # Set this boolean to include static URL patterns for CSS, JS, etc. in urls.py 
    239 SERVE_STATIC_CONTENT = False 
    240  
    241239reportMigrationTo = ['maurizio.nagni@stfc.ac.uk', 'm.nagni@gmail.com'] 
    242240 
  • mauRepo/MolesManager/trunk/cedaMoles/MolesManager/static/templates/base.html

    r8507 r8571  
    11{% load i18n %} 
    22{% load static %} 
    3 {% get_static_prefix as STATIC_URL %} 
     3{% get_static_prefix as STATIC_PREFIX %} 
     4 
    45 
    56<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
     
    2223    <title>{% block meta_title %}{% endblock %}{% if settings.SITE_TITLE %} | {{ settings.SITE_TITLE }}{% endif %}</title> 
    2324 
    24   <link rel="stylesheet" type="text/css" href="/static/css/960/reset.css"  /> 
    25   <link rel="stylesheet" type="text/css" href="/static/css/960/960_12_col.css"  /> 
    26   <link rel="stylesheet" type="text/css" href="/static/css/960/text.css"  /> 
    27   <link rel="stylesheet" type="text/css" href="/static/css/ceda.css"  /> 
     25  <link rel="stylesheet" type="text/css" href="{{ STATIC_PREFIX }}css/960/reset.css"  /> 
     26  <link rel="stylesheet" type="text/css" href="{{ STATIC_PREFIX }}css/960/960_12_col.css"  /> 
     27  <link rel="stylesheet" type="text/css" href="{{ STATIC_PREFIX }}css/960/text.css"  /> 
     28  <link rel="stylesheet" type="text/css" href="{{ STATIC_PREFIX }}css/ceda.css"  /> 
    2829  <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dijit/themes/claro/claro.css" /> 
    2930  <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/layout/ContentPane.css" /> 
     
    4142                // Make sure the module path does *not* end in a slash. 
    4243                packages:[ 
    43                                 { "name": "ceda", "location": "/static/js"} 
     44                                { "name": "ceda", "location": "{{ STATIC_PREFIX }}js"} 
    4445                ] 
    4546        }; 
     
    145146                <div class="grid_12 whiteFill" id="footer"> 
    146147                        <div class="grid_12 alpha" id="footerLogos"> 
    147                                 <p><a href="http://www.ncas.ac.uk"><img src="/static/img/ncas_logo_fullcolour.jpg" alt="NCAS logo" title="NCAS" align="left"/></a> 
    148                                 <a href="http://www.nceo.ac.uk"><img src="/static/img/nceo_logo.jpg" alt="NCEO logo" title="NCEO" align="right"/></a></p> 
     148                                <p><a href="http://www.ncas.ac.uk"><img src="{{ STATIC_PREFIX }}/img/ncas_logo_fullcolour.jpg" alt="NCAS logo" title="NCAS" align="left"/></a> 
     149                                <a href="http://www.nceo.ac.uk"><img src="{{ STATIC_PREFIX }}/img/nceo_logo.jpg" alt="NCEO logo" title="NCEO" align="right"/></a></p> 
    149150                        </div> <!-- End div footerLogos--> 
    150151                        <div class="grid_6 push_3 whiteFill omega" id="footerStatements"> 
  • mauRepo/MolesManager/trunk/cedaMoles/MolesManager/urls.py

    r8503 r8571  
    11from django.conf.urls.defaults import patterns, url 
    2 from settings import SERVE_STATIC_CONTENT, STATIC_ROOT 
    32from django.views.generic.simple import redirect_to 
     3from django.contrib.staticfiles.urls import staticfiles_urlpatterns 
    44 
    55# Uncomment the next two lines to enable the admin: 
     
    5454) 
    5555 
    56 if SERVE_STATIC_CONTENT: 
    57     urlpatterns += patterns('', 
    58        url(r'css/(?P<path>.*)$', 'django.views.static.serve', {'document_root': STATIC_ROOT+'/css' , 'show_indexes': True}), 
    59     ) 
    60  
    61     urlpatterns += patterns('', 
    62        url(r'css/960/(?P<path>.*)$', 'django.views.static.serve', {'document_root': STATIC_ROOT+'/css/960' , 'show_indexes': True}), 
    63     ) 
    64  
    65     urlpatterns += patterns('', 
    66        url(r'img/(?P<path>.*)$', 'django.views.static.serve', {'document_root': STATIC_ROOT+'/img' , 'show_indexes': True}), 
    67     ) 
    68  
    69     urlpatterns += patterns('', 
    70        url(r'js/(?P<path>.*)$', 'django.views.static.serve', {'document_root': STATIC_ROOT+'/js' , 'show_indexes': True}), 
    71     ) 
    72  
    73 #urlpatterns += staticfiles_urlpatterns() 
    74  
     56urlpatterns += staticfiles_urlpatterns() 
Note: See TracChangeset for help on using the changeset viewer.