Changeset 9358 for src/django_gheat


Ignore:
Timestamp:
Jul 7, 2011, 7:23:54 AM (13 years ago)
Author:
rick
Message:

Starting to make production ready:

  • Remove all static / references.
  • Added multihost osm-proxy capacities.
  • Got the osm-proxy code to a more usefull location.
  • Added caching.
Location:
src/django_gheat
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/django_gheat/settings.py

    r9236 r9358  
    2828        'NAME': 'project_heatmap',
    2929        'USER': 'root',
    30         'PASSWORD': 'password',
     30        'PASSWORD': '',
    3131        'HOST': 'localhost',
    3232        'PORT': '3306',
     
    8585# in apps' "static/" subdirectories and in STATICFILES_DIRS.
    8686# Example: "/home/media/media.lawrence.com/static/"
    87 STATIC_ROOT = ''
     87STATIC_ROOT = 'sitestatic'
    8888
    8989# URL prefix for static files.
     
    9898# Additional locations of static files
    9999STATICFILES_DIRS = (
    100     PROJECT_HOME + '/static',
     100    # PROJECT_HOME + '/static',
    101101    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    102102    # Always use forward slashes, even on Windows.
     
    124124MIDDLEWARE_CLASSES = (
    125125    'django.middleware.cache.UpdateCacheMiddleware',
    126 #    'django.middleware.common.CommonMiddleware',
    127 #    'django.middleware.cache.FetchFromCacheMiddleware',
    128 #    'django.middleware.http.ConditionalGetMiddleware',
     126    'django.middleware.common.CommonMiddleware',
     127    'django.middleware.cache.FetchFromCacheMiddleware',
     128    'django.middleware.http.ConditionalGetMiddleware',
    129129    'django.contrib.sessions.middleware.SessionMiddleware',
    130130    'django.contrib.auth.middleware.AuthenticationMiddleware',
     
    146146    'django.contrib.sessions',
    147147    'django.contrib.sites',
     148    'django.contrib.staticfiles',
    148149    'django_extensions',
    149150    'gheat',
  • src/django_gheat/urls.py

    r9139 r9358  
    1212    (r'^admin/', include(admin.site.urls)),
    1313)
     14
     15urlpatterns += patterns('website.osm_proxy',
     16    url(
     17        # Example : today/fire/12/3,2.png
     18        regex = r'^osm-proxy/(?P<zoom>\d+)/(?P<x>\d+),(?P<y>\d+).png$',
     19        view = 'osm_proxy',
     20        name = 'osm_proxy',
     21       ),
     22    )
     23
    1424urlpatterns += staticfiles_urlpatterns()
    1525
  • src/django_gheat/website/static/OpenStreetMap.js

    r9302 r9358  
    4545    initialize: function(name, options) {
    4646        var url = [
    47             "/website/osm-proxy/${z}/${x},${y}.png",
     47            "http://a.osmproxy.wirelessleiden.nl/heatmap/osm-proxy/${z}/${x},${y}.png",
     48            "http://b.osmproxy.wirelessleiden.nl/heatmap/osm-proxy/${z}/${x},${y}.png",
     49            "http://c.osmproxy.wirelessleiden.nl/heatmap/osm-proxy/${z}/${x},${y}.png",
    4850        ];
    4951        options = OpenLayers.Util.extend({ numZoomLevels: 19 }, options);
     
    161163    initialize: function(name, options) {
    162164        var url = [
    163             "/website/tile/${z}/${x},${y}.png?colour=90,90,90"
     165            "tile/${z}/${x},${y}.png?colour=90,90,90"
    164166        ];
    165167        options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
     
    177179    initialize: function(name, options) {
    178180        var url = [
    179             "/website/tile/${z}/${x},${y}.png?colour=255,0,0&accespoint__ssid__icontains=WirelessLeiden"
     181            "tile/${z}/${x},${y}.png?colour=255,0,0&accespoint__ssid__icontains=WirelessLeiden"
    180182        ];
    181183        options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
     
    193195  initialize: function(name, options) {
    194196    var url = [
    195       "/website/tile/${z}/${x},${y}.png?colour=250,250,0&signaal__gte=0&signaal__lte=100"
     197      "tile/${z}/${x},${y}.png?colour=250,250,0&signaal__gte=0&signaal__lte=100"
    196198    ];
    197199    options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
  • src/django_gheat/website/static/heatmap_extensions.js

    r9347 r9358  
    44 */
    55function getNodeList(zoomlevel, mousepos){
    6   $.getJSON("/website/nodelist/" + zoomlevel + "," + mousepos.lat + "," + mousepos.lon,
     6  $.getJSON("nodelist/" + zoomlevel + "," + mousepos.lat + "," + mousepos.lon,
    77    function(json){
    88      content = 'Wireless Leiden nodes on mouseposition:<br /><b>';
     
    6868    stop: function(event, sig){
    6969      signallayer = map.getLayersByName('signallayer');
    70       signallayer[0].setUrl("/website/tile/${z}/${x},${y}.png?colour=250,250,0&signaal__gte=" + sig.values[0] + "&signaal__lte=" + sig.values[1]);
     70      signallayer[0].setUrl("tile/${z}/${x},${y}.png?colour=250,250,0&signaal__gte=" + sig.values[0] + "&signaal__lte=" + sig.values[1]);
    7171      signallayer[0].redraw();
    7272    },
     
    169169   * http://stackoverflow.com/questions/170986/what-is-the-best-way-to-add-options-to-a-select-from-an-array-with-jquery
    170170   */
    171   $.getJSON("/website/filters/",
     171  $.getJSON("filters/",
    172172    function(json) {
    173173      $.each(json, function(i,json){
     
    203203          initialize: function(name, options) {
    204204            var url = [
    205               "/website/tile/${z}/${x},${y}.png?&colour=" + colour + "&meetrondje__gebruiker__naam=" + user
     205              "tile/${z}/${x},${y}.png?&colour=" + colour + "&meetrondje__gebruiker__naam=" + user
    206206            ];
    207207            options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
     
    240240          initialize: function(name, options) {
    241241            var url = [
    242               "/website/tile/${z}/${x},${y}.png?&colour=" + colour + "&accespoint__ssid=" + node
     242              "tile/${z}/${x},${y}.png?&colour=" + colour + "&accespoint__ssid=" + node
    243243            ];
    244244            options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
     
    326326      initialize: function(name, options) {
    327327        var url = [
    328           "/website/tile/${z}/${x},${y}.png?&colour=" + colour + user + dataset + wlnode + start_date + end_date
     328          "tile/${z}/${x},${y}.png?&colour=" + colour + user + dataset + wlnode + start_date + end_date
    329329        ];
    330330        options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
  • src/django_gheat/website/templates/home.html

    r9347 r9358  
    11<html>
    22<head>
    3   <link href="{{ STATIC_URL }}style.css" rel="stylesheet" type="text/css" media="screen" />
     3  <link type="text/css" href="{{ STATIC_URL }}style.css" rel="stylesheet" />
    44  <link type="text/css" href="{{ STATIC_URL }}jquery-ui-1.8.13.custom.css" rel="Stylesheet" /> 
    55  <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}jquery-1.6.1.min.js"></script>
  • src/django_gheat/website/urls.py

    r9244 r9358  
    2020    )
    2121
    22 urlpatterns += patterns('website.osm_proxy',
    23     url(
    24         # Example : today/fire/12/3,2.png
    25         regex = r'^osm-proxy/(?P<zoom>\d+)/(?P<x>\d+),(?P<y>\d+).png$',
    26         view = 'osm_proxy',
    27         name = 'osm_proxy',
    28        ),
    29     )
    30 
    3122urlpatterns += patterns('website.nodelist',
    3223    url(
Note: See TracChangeset for help on using the changeset viewer.