| 1 |
# -*- coding: utf-8 -*- |
| 2 |
""" |
| 3 |
dj-static |
| 4 |
~~~~~~~~~ |
| 5 |
|
| 6 |
This is a simple Django middleware utility that allows you to properly |
| 7 |
serve static assets from production with a WSGI server like Gunicorn. |
| 8 |
|
| 9 |
Django `doesn't recommend <https://docs.djangoproject.com/en/1.5/howto/static-files/#admonition-serving-the-files>`_ |
| 10 |
the production use of its static file server for a number of reasons. |
| 11 |
There exists, however, a lovely WSGI application aptly named `Static <http://lukearno.com/projects/static/>`_. |
| 12 |
|
| 13 |
It is suitable for the production use of static file serving, unlike Django. |
| 14 |
|
| 15 |
Usage |
| 16 |
----- |
| 17 |
|
| 18 |
Configure your static assets in ``settings.py``:: |
| 19 |
|
| 20 |
STATIC_ROOT = 'staticfiles' |
| 21 |
STATIC_URL = '/static/' |
| 22 |
|
| 23 |
Then, update your ``wsgi.py`` file to use dj-static:: |
| 24 |
|
| 25 |
from django.core.wsgi import get_wsgi_application |
| 26 |
from dj_static import Cling |
| 27 |
|
| 28 |
application = Cling(get_wsgi_application()) |
| 29 |
|
| 30 |
""" |
| 31 |
|
| 32 |
from setuptools import setup |
| 33 |
|
| 34 |
setup( |
| 35 |
name='dj-static', |
| 36 |
version='0.0.6', |
| 37 |
url='https://github.com/kennethreitz/dj-static', |
| 38 |
license='BSD', |
| 39 |
author='Kenneth Reitz', |
| 40 |
author_email='[email protected]', |
| 41 |
description='Serve production static files with Django.', |
| 42 |
long_description=__doc__, |
| 43 |
py_modules=['dj_static'], |
| 44 |
zip_safe=False, |
| 45 |
install_requires=['static3'], |
| 46 |
include_package_data=True, |
| 47 |
platforms='any', |
| 48 |
classifiers=[ |
| 49 |
'Environment :: Web Environment', |
| 50 |
'Intended Audience :: Developers', |
| 51 |
'License :: OSI Approved :: BSD License', |
| 52 |
'Operating System :: OS Independent', |
| 53 |
'Programming Language :: Python', |
| 54 |
'Programming Language :: Python :: 3', |
| 55 |
'Topic :: Internet :: WWW/HTTP :: Dynamic Content', |
| 56 |
'Topic :: Software Development :: Libraries :: Python Modules' |
| 57 |
] |
| 58 |
) |