Skip to content

Instantly share code, notes, and snippets.

@ianjosephwilson
Created October 1, 2013 03:20
Show Gist options
  • Save ianjosephwilson/6773461 to your computer and use it in GitHub Desktop.
Save ianjosephwilson/6773461 to your computer and use it in GitHub Desktop.
from pyramid.config import Configurator
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configurator(settings=settings)
config.add_static_view('static', 'static', cache_max_age=3600)
config.add_route('home', '{url:.*}')
config.scan()
return config.make_wsgi_app()
from pyramid.view import view_config
@view_config(route_name='home', renderer='string')
def my_view(request):
return request.matchdict['url']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment