Changeset 11406


Ignore:
Timestamp:
Aug 16, 2012, 9:00:50 PM (12 years ago)
Author:
rick
Message:

Re-install of heatmap on other server with Django 1.4

Location:
src/django_gheat
Files:
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • src/django_gheat/gheat/admin.py

    r9819 r11406  
    44class AccesspointAdmin(admin.ModelAdmin):
    55  list_display = ['ssid','type', 'mac', 'organization']
    6   search_fields = ['ssid', 'mac', 'organization']
     6  search_fields = ['ssid', 'mac', 'organization__name']
    77  ordering = ['ssid']
    88admin.site.register(Accesspoint, AccesspointAdmin)
  • src/django_gheat/gheat/dataimport/__init__.py

    r9819 r11406  
    6464  global organizations
    6565  if not organizations:
    66    organizations = dict(Organization.objects.all().values_list('name','id'))
     66    organizations = dict(Organization.objects.all().values_list('name','id'))
    6767 
    6868  name = Organization.get_name_by_ssid(ssid)
    69   if not name:
    70     return 'NULL'
     69  if not organizations.has_key(name):
     70    return None
    7171  else:
    72     return int(organizations[name])
     72    return str(organizations[name])
    7373
    7474
  • src/django_gheat/httpd/maps.conf

    r10615 r11406  
    11<VirtualHost *:80>
    2   ServerAdmin techniek@lijst.wirelessleiden.nl
    32  DocumentRoot /var/empty
    4   ServerName maps.wirelessleiden.nl
    5   ServerAlias a.maps.wirelessleiden.nl b.maps.wirelessleiden.nl c.maps.wirelessleiden.nl d.maps.wirelessleiden.nl e.maps.wirelessleiden.nl f.maps.wirelessleiden.nl
     3  ServerName wleiden.maps.vanderzwet.net
     4  ServerAlias a.wleiden.maps.vanderzwet.net b.wleiden.maps.vanderzwet.net c.wleiden.maps.vanderzwet.net d.wleiden.maps.vanderzwet.net e.wleiden.maps.vanderzwet.net f.wleiden.maps.vanderzwet.net
    65 
    7   ErrorLog /var/log/httpd/nl.wirelessleiden.maps-error.log
    8   CustomLog /var/log/httpd/nl.wirelessleiden.maps-access.log common
     6  ErrorLog /var/log/httpd/net.vanderzwet.maps.wleiden-error.log
     7  CustomLog /var/log/httpd/net.vanderzwet.maps.wleiden-access.log common
    98 
    109  <Directory /var/empty>
  • src/django_gheat/httpd/tile.conf

    r11400 r11406  
    11<VirtualHost *:80>
    2   ServerAdmin techniek@lijst.wirelessleiden.nl
     2  ServerAdmin info@rickvanderzwet.nl
    33  DocumentRoot /var/empty
    4   ServerName osmproxy.wirelessleiden.nl
    5   ServerAlias a.osmproxy.wirelessleiden.nl b.osmproxy.wirelessleiden.nl c.osmproxy.wirelessleiden.nl d.osmproxy.wirelessleiden.nl e.osmproxy.wirelessleiden.nl f.osmproxy.wirelessleiden.nl
     4  ServerName tile.vanderzwet.net
     5  ServerAlias a.tile.vanderzwet.net b.tile.vanderzwet.net c.tile.vanderzwet.net d.tile.vanderzwet.net e.tile.vanderzwet.net f.tile.vanderzwet.net
    66 
    7   ErrorLog /var/log/httpd/nl.wirelessleiden.osmproxy-error.log
    8   CustomLog /var/log/httpd/nl.wirelessleiden.osmproxy-access.log common
     7  ErrorLog /var/log/httpd/net.vanderzwet.tile-error.log
     8  CustomLog /var/log/httpd/net.vanderzwet.tile-access.log common
    99 
    1010  <Directory /var/empty>
     
    2222    Allow from all
    2323  </Location>
    24   ProxyPassMatch ^/osm-tile-proxy/(\d{1,2}/\d{1,6}/\d{1,6}\.png)$ balancer://osmcluster/$1 lbmethod=byrequests
    25   CacheEnable disk /osm-tile-proxy/
     24  ProxyPassMatch ^/(\d{1,2}/\d{1,6}/\d{1,6}\.png)$ balancer://osmcluster/$1 lbmethod=byrequests
     25  CacheEnable disk /
    2626 
    2727  # 1 week
    2828  CacheDefaultExpire 604800
    29   CacheRoot "/usr/local/var/httpd/cache/osmproxy"
     29  CacheRoot "/usr/local/var/httpd/cache/tile"
    3030  CacheDirLevels 2
    3131  CacheDirLength 1
  • src/django_gheat/settings.py

    r10924 r11406  
    1212
    1313DJANGO_BALANCERS = OSM_PROXY_BALANCERS = ['a','b','c','d','e','f']
    14 OSM_PROXY_CDN_DOMAINS = [d + '.osmproxy.wirelessleiden.nl' for d in DJANGO_BALANCERS]
     14OSM_PROXY_CDN_DOMAINS = [d + '.tile.vanderzwet.net' for d in DJANGO_BALANCERS]
    1515OSM_PROXY_CDN_DOMAINS_PROTOCOL = 'http://'
    16 OSM_PREFIX = '/osm-tile-proxy'
    17 DJANGO_CDN_DOMAINS = [d + '.maps.wirelessleiden.nl' for d in DJANGO_BALANCERS]
     16OSM_PREFIX = '/'
     17DJANGO_CDN_DOMAINS = [d + '.wleiden.maps.vanderzwet.net' for d in DJANGO_BALANCERS]
    1818DJANGO_CDN_DOMAINS_PROTOCOL = 'http://'
    1919
     
    3737        'NAME': 'project_heatmap',
    3838        'USER': 'root',
    39         'PASSWORD': '',
     39        'PASSWORD': 'R00tj3!',
    4040        'HOST': 'localhost',
    4141        'PORT': '3306',
     
    4545CACHES = {
    4646    'default': {
    47         'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
    48         'LOCATION': '127.0.0.1:11211',
     47        'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
     48        'LOCATION': OSM_PROXY_DIR,
    4949        'TIMEOUT': 3600 * 24 * 7,
    5050        'OPTIONS': {
  • src/django_gheat/urls.py

    r9749 r11406  
    2121)
    2222
    23 urlpatterns += patterns('wlheatmap.osm_proxy',
    24     url(
    25         # Example : today/fire/12/3,2.png
    26         regex = r'^osm-proxy/(?P<zoom>\d+)/(?P<x>\d+)[,/](?P<y>\d+).png$',
    27         view = 'osm_proxy',
    28         name = 'osm_proxy',
    29        ),
    30     )
     23if settings.DEBUG:
     24  urlpatterns += patterns('wlheatmap.osm_proxy',
     25      url(
     26          # Example : today/fire/12/3,2.png
     27          regex = r'^osm-tile-proxy/(?P<zoom>\d+)/(?P<x>\d+)[,/](?P<y>\d+).png$',
     28          view = 'osm_proxy',
     29          name = 'osm_proxy',
     30         ),
     31      )
    3132
    32 
    33 if settings.DEBUG:
    3433  urlpatterns += staticfiles_urlpatterns()
    3534  urlpatterns += patterns('',
Note: See TracChangeset for help on using the changeset viewer.