Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
49 lines (42 sloc) 1.79 KB
from distutils.core import setup
from distutils.command.install import INSTALL_SCHEMES
import os
import sys
# Tell distutils to put the data_files in platform-specific installation
# locations. See here for an explanation:
for scheme in INSTALL_SCHEMES.values():
scheme['data'] = scheme['purelib']
# Compile the list of packages available, because distutils doesn't have
# an easy way to do this.
packages, data_files = [], []
root_dir = os.path.dirname(__file__)
len_root_dir = len(root_dir)
django_dir = os.path.join(root_dir, 'django')
for dirpath, dirnames, filenames in os.walk(django_dir):
# Ignore dirnames that start with '.'
for i, dirname in enumerate(dirnames):
if dirname.startswith('.'): del dirnames[i]
if '' in filenames:
package = dirpath[len_root_dir:].lstrip('/').replace('/', '.')
data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])
# Small hack for working with bdist_wininst.
# See
if sys.argv[1] == 'bdist_wininst':
for file_info in data_files:
file_info[0] = '/PURELIB/%s' % file_info[0]
# Dynamically calculate the version based on django.VERSION.
version = "%d.%d-%s" % (__import__('django').VERSION)
name = "Django",
version = version,
url = '',
author = 'Lawrence Journal-World',
author_email = '',
description = 'A high-level Python Web framework that encourages rapid development and clean, pragmatic design.',
packages = packages,
data_files = data_files,
scripts = ['django/bin/'],
Jump to Line
Something went wrong with that request. Please try again.