- Install Virtualbox
- Install XCode and the Command Line Tools
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
diff --git a/pyramid/router.py b/pyramid/router.py | |
index ba4f85b..a11e556 100644 | |
--- a/pyramid/router.py | |
+++ b/pyramid/router.py | |
@@ -1,10 +1,12 @@ | |
from zope.interface import ( | |
implementer, | |
providedBy, | |
+ Interface, | |
) |
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
setup( | |
entry_points={ | |
'paste.filter_app_factory': [ | |
'ssl_only = myapp.middlewares.ssl_only:make_filter', | |
], | |
} | |
) |
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
from pyramid.interfaces import IRequest | |
from zope.interface.registry import Components | |
def includeme(config): | |
config.add_request_method(find_service) | |
config.add_request_method(lambda _: Components(), 'service_cache', | |
reify=True) | |
config.add_directive('register_service', register_service) | |
config.add_directive('register_service_factory', register_service_factory) |
I hereby claim:
- I am mmerickel on github.
- I am mmerickel (https://keybase.io/mmerickel) on keybase.
- I have a public key whose fingerprint is CC1A 48C9 57AC 6ABE F05B 2C59 6BC9 77B0 56B8 29E5
To claim this, I am signing this object:
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
cookie_state = { | |
'session_id': session_id, | |
'is_deleted': False, | |
} | |
def update_cookie(request, response): | |
exc = getattr(request, 'exception', None) | |
# exit early if there's an exception and the user specified |
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
from hashlib import sha256 | |
import os | |
from pyramid.session import SignedCookieSessionFactory | |
def make_session_id(): | |
rand = os.urandom() | |
return sha256(sha256(rand).digest()).hexdigest() | |
class MemorySessionSerializer(object): |
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
from ConfigParser import RawConfigParser | |
def load_settings(global_config, app_settings): | |
""" | |
Load an INI file with multiple sections into a single dictionary. | |
.. code-block:: ini | |
[sqlalchemy] | |
url = sqlite://%(here)s |
A workflow for docker that separates build-time dependencies from run-time dependencies.
Create the image used for building apps.
docker build -t pybuilder pybuilder
Create the image used for running apps.
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
from sqlalchemy import ( | |
create_engine, | |
Column, | |
ForeignKey, | |
) | |
from sqlalchemy import ( | |
Integer, | |
String, | |
) | |
from sqlalchemy.ext.declarative import declarative_base |