Changeset 8137 for mauRepo


Ignore:
Timestamp:
05/03/12 10:39:08 (8 years ago)
Author:
mnagni
Message:

Updated the urls.py in order to allow a static access to css/js/img. Anyway as specified in DJANGO manual

"Django itself doesn’t serve static (media) files, such as images, style sheets, or video. It leaves that job to whichever Web server you choose.
The reasoning here is that standard Web servers, such as Apache, lighttpd and Cherokee, are much more fine-tuned at serving static files than a Web application framework."

Location:
mauRepo/MolesManager/trunk/src
Files:
5 edited

Legend:

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

    r8120 r8137  
    2727    'default': { 
    2828        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 
    29         'NAME': 'c:/virtualenvs/www/MolesManager/src/sqlite.db',#'/misc/frigid3/humid1/mnagni/workspaces/moles3/MolesManager/src/sqlite.db',                      # Or path to database file if using sqlite3. 
     29        'NAME': '/misc/frigid3/humid1/mnagni/workspaces/moles3/MolesManager/src/sqlite.db',                      # Or path to database file if using sqlite3. 
    3030        'USER': '',                      # Not used with sqlite3. 
    3131        'PASSWORD': '',                  # Not used with sqlite3. 
     
    6767# Examples: "http://media.lawrence.com/media/", "http://example.com/media/" 
    6868MEDIA_URL = '' 
    69  
     69  
    7070# Absolute path to the directory static files should be collected to. 
    7171# Don't put anything in this directory yourself; store your static files 
    72 # in apps' "static/" sub-directories and in STATICFILES_DIRS. 
     72# in apps' "static/" subdirectories and in STATICFILES_DIRS. 
    7373# Example: "/home/media/media.lawrence.com/static/" 
    74 #STATIC_ROOT = os.path.join(DJANGO_PROJECT, 'static') 
     74STATIC_ROOT = os.path.join(DJANGO_PROJECT, 'static') 
     75 
     76#WSGIScriptAlias = "/cedaManager" 
    7577 
    7678# URL prefix for static files. 
    7779# Example: "http://media.lawrence.com/static/" 
    78 STATIC_URL = '/static/' 
    79 #STATIC_ROOT = os.path.join(PROJECT_ROOT, STATIC_URL) 
    80 STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static') 
    81  
     80STATIC_URL = 'http://localhost' 
    8281 
    8382# URL prefix for admin static files -- CSS, JavaScript and images. 
     
    8887# Additional locations of static files 
    8988STATICFILES_DIRS = ( 
    90                     "c:/virtualenvs/www/MolesManager/src/MolesManager/static", 
     89    () 
    9190    # Put strings here, like "/home/html/static" or "C:/www/django/static". 
    9291    # Always use forward slashes, even on Windows. 
     
    143142    # Don't forget to use absolute paths, not relative paths. 
    144143) 
    145  
    146144 
    147145INSTALLED_APPS = ( 
     
    188186MOLES3 = 'moles3' 
    189187#MOLES3_DB_CONNECTION = 'postgresql://user:pws@host:port/dbName' 
    190 #MOLES3_DB_CONNECTION = 'PG_MOLES3_DB_CONNECTION' 
    191 MOLES3_DB_CONNECTION = 'postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/ceda_moles3_test'#'PG_MOLES3_DB_CONNECTION' 
    192  
    193  
     188MOLES3_DB_CONNECTION = 'PG_MOLES3_DB_CONNECTION' 
    194189from sqlTables import doTables as doMoles 
    195190MOLES3_DB_SCRIPT = doMoles 
     
    200195#MIGRATION_DB_CONNECTION = 'postgresql://user:pws@host:port/dbName' 
    201196 
    202 #MIGRATION_DB_CONNECTION = 'PG_MIGRATION_DB_CONNECTION' 
    203 MIGRATION_DB_CONNECTION = 'postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/ceda_moles3_test'#'PG_MOLES3_DB_CONNECTION' 
    204  
     197MIGRATION_DB_CONNECTION = 'PG_MIGRATION_DB_CONNECTION' 
    205198from libs.migration.db.migrationTables import doTables as doMigration 
    206199MIGRATION_DB_SCRIPT = doMigration 
    207200 
    208 RUN_MIGRATION = False 
     201RUN_MIGRATION = True 
    209202#Default to one day 
    210203MIGRATION_INTERVAL = 86400 
  • mauRepo/MolesManager/trunk/src/MolesManager/static/js/cedaObservation.js

    r8120 r8137  
    7878                          
    7979                         var title_id = new dijit.form.TextBox({ 
    80                                  value: "" 
     80                                 value: "", 
    8181                         }, "title_id"); 
    8282                         title_id.startup(); 
     
    9292                         keywords_id.startup(); 
    9393                          
     94<<<<<<< .mine 
     95                         var description_id = new dijit.form.TextBox({ 
     96                                 value: "" 
     97                         }, "description_id"); 
     98                         description_id.startup();                        
     99 
     100                         //---------------------------------------------- 
     101                         //---------- Loads the widgets values ---------- 
     102                         //----------------------------------------------                         
     103                          
     104======= 
    94105                         //---------------------------------------------- 
    95106                         //------- Loads the widgets with values -------- 
    96107                         //---------------------------------------------- 
    97108                                                  
     109>>>>>>> .r8136 
    98110                         var json = dojo.byId('coObs_id').value; 
    99111                                 var coObs = dojo.fromJson(json); 
  • mauRepo/MolesManager/trunk/src/MolesManager/static/templates/base.html

    r8120 r8137  
    2222    <title>{% block meta_title %}{% endblock %}{% if settings.SITE_TITLE %} | {{ settings.SITE_TITLE }}{% endif %}</title> 
    2323 
    24   <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/960/reset.css"  /> 
    25   <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/960/960_12_col.css"  /> 
    26   <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/960/text.css"  /> 
    27   <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/ceda.css"  /> 
     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"  /> 
    2828  <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dijit/themes/claro/claro.css" /> 
    2929  <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/layout/ContentPane.css" /> 
     
    134134                <div class="grid_12 whiteFill" id="footer"> 
    135135                        <div class="grid_12 alpha" id="footerLogos"> 
    136                                 <p><a href="http://www.ncas.ac.uk"><img src="{{ STATIC_URL }}img/ncas_logo_fullcolour.jpg" alt="NCAS logo" title="NCAS" align="left"/></a> 
    137                                 <a href="http://www.nceo.ac.uk"><img src="{{ STATIC_URL }}img/nceo_logo.jpg" alt="NCEO logo" title="NCEO" align="right"/></a></p> 
     136                                <p><a href="http://www.ncas.ac.uk"><img src="/static/img/ncas_logo_fullcolour.jpg" alt="NCAS logo" title="NCAS" align="left"/></a> 
     137                                <a href="http://www.nceo.ac.uk"><img src="/static/img/nceo_logo.jpg" alt="NCEO logo" title="NCEO" align="right"/></a></p> 
    138138                        </div> <!-- End div footerLogos--> 
    139139                        <div class="grid_6 push_3 whiteFill omega" id="footerStatements"> 
  • mauRepo/MolesManager/trunk/src/MolesManager/urls.py

    r8120 r8137  
    1 from django.conf.urls.defaults import patterns, include, url 
     1from django.conf.urls.defaults import patterns, url 
    22from MolesManager.settings import STATIC_ROOT 
    33 
     
    3838) 
    3939 
     40urlpatterns += patterns('', 
     41    url(r'^static/css', 'django.views.static.serve', {'document_root': STATIC_ROOT+'/css' , 'show_indexes': True}), 
     42) 
    4043 
     44urlpatterns += patterns('', 
     45    url(r'^static/css/960/(?P<path>.*)$', 'django.views.static.serve', {'document_root': STATIC_ROOT+'/css/960' , 'show_indexes': True}), 
     46) 
    4147#urlpatterns += staticfiles_urlpatterns() 
  • mauRepo/MolesManager/trunk/src/libs/migration/client.py

    r8092 r8137  
    5050        mp.process() 
    5151 
     52#record = Moles3EPB.search(CEDA_Observation, 12) 
     53#print DJEncoder().encode(record) 
     54 
     55lr = LoadResources() 
     56mp = MigrationProcess() 
     57 
     58dataEntity = MigrationObject() 
     59dataEntity.doc_status = DS_pUBLISHED 
     60dataEntity.doc_owner = DO_BADC 
     61dataEntity.doc_name = 'dataent_csip.atom' 
     62 
     63lr.process() 
     64mp.process(dataEntity) 
     65 
     66 
     67 
     68 
     69 
Note: See TracChangeset for help on using the changeset viewer.