Ignore:
Timestamp:
May 12, 2011, 1:55:27 PM (14 years ago)
Author:
rick
Message:

Avoid hitting the OSM website all the time, use local caching. Makes development more easy as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/django_gheat/settings.py

    r9188 r9189  
    22
    33import os
    4 PROJECT_HOME = os.path.dirname(__file__)
     4PROJECT_HOME = os.path.abspath(os.path.dirname(__file__))
     5OSM_CACHE_DIR = '/tmp/osm-cache'
     6OSM_CACHE = 'osm_cache'
     7
     8
    59
    610DEBUG = True
    711TEMPLATE_DEBUG = DEBUG
     12
     13if DEBUG and not os.path.exists(OSM_CACHE_DIR):
     14  os.mkdir(OSM_CACHE_DIR)
    815
    916# Required for Etags Caching Implementation
     
    3138        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
    3239        'LOCATION': 'unique-snowflake'
     40    },
     41    OSM_CACHE: {
     42        'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
     43        'LOCATION': OSM_CACHE_DIR,
     44        'TIMEOUT': 3600 * 24 * 7,
     45        'OPTIONS': {
     46            'MAX_ENTRIES': 100000
     47        }
    3348    }
    3449}
Note: See TracChangeset for help on using the changeset viewer.