This file contains 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 flask import Flask | |
from flask.ext.sqlalchemy import SQLAlchemy | |
from flask.ext import admin | |
from flask.ext.admin.contrib import sqlamodel | |
from flask.ext.admin.model import InlineFormAdmin | |
# Create application | |
app = Flask(__name__) |
This file contains 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
def push_context(fn): | |
@wraps(fn) | |
def decorator(*args, **kwargs): | |
app_host = app.config.get('SERVER_NAME') | |
app_root = app.config.get('APPLICATION_ROOT') | |
base_url = 'https://{}/'.format(app_host if app_host else 'localhost') | |
if app_root: | |
base_url += app.root.lstrip('/') | |
app.test_request_context(base_url=base_url).push() | |
return fn(*args, **kwargs) |
This file contains 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
<!-- | |
256 CSS Classes can Override #id: | |
* http://news.ycombinator.com/item?id=4388649 | |
* http://stackoverflow.com/questions/2809024/points-in-css-specificity/11934505#11934505 | |
W3C documentation on selector specificity: | |
* http://www.w3.org/TR/CSS2/cascade.html#specificity | |
Code samples from: | |
* http://codepen.io/anon/pen/zbcxs | |
* http://codepen.io/chriscoyier/pen/lzjqh | |
Also implementation source from Mozilla and WebKit: |
This file contains 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/werkzeug/testsuite/test.py b/werkzeug/testsuite/test.py | |
index 795de90..5ee8864 100644 | |
--- a/werkzeug/testsuite/test.py | |
+++ b/werkzeug/testsuite/test.py | |
@@ -26,7 +26,7 @@ from werkzeug.datastructures import MultiDict | |
def cookie_app(environ, start_response): | |
- """A WSGI application which sets a cookie, and returns as a ersponse any | |
+ """A WSGI application which sets a cookie, and returns as a response any |
NewerOlder