Permalink
Browse files

Split views in function

  • Loading branch information...
1 parent 41c10e8 commit 18cd48f040b61b9b7400d3219fd7c85ae52d7d4a @rhaamo committed Jan 11, 2014
Showing with 7 additions and 2 deletions.
  1. +7 −2 codular/__init__.py
View
@@ -13,7 +13,12 @@ def main(global_config, **settings):
config.include('pyramid_chameleon')
config.include('pyramid_jinja2')
config.add_jinja2_search_path("templates")
- config.add_static_view('static', 'static', cache_max_age=3600)
- config.add_route('home', '/')
+ config.include(add_routes)
config.scan()
return config.make_wsgi_app()
+
+def add_routes(config):
+ # Splitted from main() to be used in unit test and better visibility
+ config.add_static_view('static', 'static', cache_max_Age=3600)
+
+ config.add_route('home', '/')

0 comments on commit 18cd48f

Please sign in to comment.