This commit is contained in:
2017-05-08 09:36:33 -04:00
parent 6e4c1b880d
commit 852c4e888b
2 changed files with 52 additions and 4 deletions
+4 -4
View File
@@ -98,13 +98,13 @@ class Common(object):
"""Initializes the Flask application with Common."""
if not hasattr(app, 'extensions'):
app.extensions = {}
if 'common' in app.extensions:
raise RuntimeError("Flask-common extension already initialized")
raise RuntimeError("Flask-Common extension already initialized")
app.extensions['common'] = self
self.app = app
if not 'COMMON_FILESERVER_DISABLED' in app.config:
with app.test_request_context() as c:
+48
View File
@@ -0,0 +1,48 @@
"""
Flask-Common
-------------
A Flask extension with lots of common time-savers (file-serving, favicons, etc).
"""
import os
import sys
from setuptools import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
setup(
name='Flask-Common',
version='0.1.0',
url='https://github.com/kennethreitz/flask-common',
license='BSD',
author='Kenneth Reitz',
author_email='me@kennethreitz.org',
description='A Flask extension with lots of common time-savers (file-serving, favicons, etc).',
long_description=__doc__,
py_modules=['flask_common'],
# if you would be using a package instead use packages instead
# of py_modules:
# packages=['flask_sqlite3'],
zip_safe=False,
include_package_data=True,
platforms='any',
install_requires=[
'Flask',
'Gunicorn',
'WhiteNoise',
'crayons',
'maya',
'flask_cache'
],
classifiers=[
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)