diff --git a/development.ini b/development.ini index edc4eab..6ea25ea 100644 --- a/development.ini +++ b/development.ini @@ -16,6 +16,9 @@ pyramid.includes = sqlalchemy.url = sqlite:///%(here)s/ordr2.sqlite +auth.secret = 'change me' +static_views.cache_max_age = 0 + # By default, the toolbar only appears for clients from IP addresses # '127.0.0.1' and '::1'. # debugtoolbar.hosts = 127.0.0.1 ::1 diff --git a/ordr2/__init__.py b/ordr2/__init__.py index 72d5dab..141cf69 100644 --- a/ordr2/__init__.py +++ b/ordr2/__init__.py @@ -16,6 +16,7 @@ def main(global_config, **settings): config.include('.models') config.include('.resources') config.include('.security') + config.include('ordr2.views') config.scan() diff --git a/ordr2/views/__init__.py b/ordr2/views/__init__.py index fe727e6..e056593 100644 --- a/ordr2/views/__init__.py +++ b/ordr2/views/__init__.py @@ -8,4 +8,7 @@ def includeme(config): Activate this setup using ``config.include('ordr2.views')``. ''' - config.add_static_view('static', 'ordr2:static', cache_max_age=3600) + settings = config.get_settings() + age = int(settings.get('static_views.cache_max_age', 3600)) + + config.add_static_view('static', 'ordr2:static', cache_max_age=age)