I hereby claim:
- I am reinbach on github.
- I am reinbach (https://keybase.io/reinbach) on keybase.
- I have a public key ASAyUwI8X0QadcfAzZa4ZgELeKrscohnjjBAjBton_SwSQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| import os | |
| from werkzeug.exceptions import NotFound | |
| from werkzeug.wrappers import Request, Response | |
| from werkzeug.wsgi import SharedDataMiddleware, wrap_file | |
| class Website(object): | |
| def dispatch_request(self, environ, request): | |
| filename = request.path if request.path != "/" else "index.html" |
| #!/usr/bin/env python | |
| # | |
| # brand templates are stored in url_pattern values | |
| # script converts these dirnames to brand_code values | |
| # | |
| # for each dir in the brand template | |
| # find the brand based on the dir being url_pattern of a brand | |
| # get the brand code for the brand | |
| # change the dir name to the brand_code value |
| {% if facebook_apikey %} | |
| <script src="https://connect.facebook.net/en_US/all.js"></script> | |
| <script type="text/javascript"> | |
| FB.init({ | |
| apiKey: "{{ facebook_apikey }}", | |
| status: true, | |
| cookie: true, | |
| xfbml: true | |
| }); | |
| import redis | |
| import web | |
| SESSION = 'SESSION:' | |
| class RedisStore(web.session.Store): | |
| """Store for saving a session in redis: | |
| import rediswebpy | |
| session = web.session.Session(app, rediswebpy.RedisStore(), initializer={'count': 0}) |