Created
November 27, 2012 21:31
-
-
Save mcdonc/4157188 to your computer and use it in GitHub Desktop.
disruptek
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########### | |
# wsgi.py | |
########### | |
from waitress import serve | |
import os | |
from pyramid.config import Configurator | |
configurator = Configurator() | |
configurator.include('obie', route_prefix=os.environ.get('ROUTE_PREFIX', '/')) | |
configurator.scan('obie') | |
App = configurator.make_wsgi_app() | |
serve(App) | |
###################### | |
# obie/__init__.py | |
##################### | |
from pyramid.view import view_config | |
@view_config(route_name='home', renderer='obie:home.pt') | |
def home(request): | |
static_path = request.static_path('obie:static/foo.js') | |
return {'static_path':static_path} | |
def includeme(config): | |
config.add_static_view('static', 'obie:static') | |
config.add_route('home', '/') | |
################# | |
# obie/home.pt | |
################## | |
<html> | |
<head> | |
</head> | |
<body> | |
Static path is ${static_path} | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment