Ticket #6080: reusableapps3.diff
File reusableapps3.diff, 7.8 KB (added by , 17 years ago) |
---|
-
setup.py
1 from distutils.core import setup 2 from distutils.command.install import INSTALL_SCHEMES 3 import os 4 import sys 1 import os, sys 2 try: 3 from setuptools import setup 4 except ImportError: 5 from distutils.core import setup 6 use_setuptools = False 7 else: 8 use_setuptools = True 5 9 6 10 def fullsplit(path, result=None): 7 11 """ … … 17 21 return result 18 22 return fullsplit(head, [tail] + result) 19 23 20 # Tell distutils to put the data_files in platform-specific installation 21 # locations. See here for an explanation: 22 # http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb 23 for scheme in INSTALL_SCHEMES.values(): 24 scheme['data'] = scheme['purelib'] 24 setuptools_options = {} 25 version_tuple = __import__('django').VERSION 26 if use_setuptools: 27 # Additional arguments for use with setuptools 28 setuptools_options = dict( 29 install_requires = ['setuptools>=0.6c7', 'Flup'], 30 extras_require = { 31 'MySQL': ["MySQLdb>=1.2.1p2"], 32 'SQLite': ["pysqlite>=2.0.3"], 33 'PostgreSQL': ["psycopg>=1.1.21"], 34 'PostgreSQL2': ["psycopg2>=2.0.5"], 35 'Oracle': ["cx_Oracle>=4.3.1"], 36 'PyYaml': ["PyYaml"], 37 }, 38 zip_safe = False, 39 ) 40 # Dynamically calculate the version based on django.VERSION but leave out 41 # any non-int part, to use tag_build and tag_svn_revision from setup.cfg 42 version = '.'.join([str(i) for i in version_tuple if type(i) == int]) 43 else: 44 # Dynamically calculate the version based on django.VERSION. 45 if version_tuple[2] is not None: 46 version = "%d.%d_%s" % version_tuple 47 else: 48 version = "%d.%d" % version_tuple[:2] 49 # Tell distutils to put the data_files in platform-specific installation 50 # locations. See here for an explanation: 51 # http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb 52 from distutils.command.install import INSTALL_SCHEMES 53 for scheme in INSTALL_SCHEMES.values(): 54 scheme['data'] = scheme['purelib'] 25 55 26 56 # Compile the list of packages available, because distutils doesn't have 27 57 # an easy way to do this. … … 43 73 elif filenames: 44 74 data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]]) 45 75 46 # Dynamically calculate the version based on django.VERSION.47 version_tuple = __import__('django').VERSION48 if version_tuple[2] is not None:49 version = "%d.%d_%s" % version_tuple50 else:51 version = "%d.%d" % version_tuple[:2]52 53 76 setup( 54 77 name = "Django", 55 78 version = version, 56 79 url = 'http://www.djangoproject.com/', 80 download_url = 'http://www.djangoproject.com/download/', 81 license = 'BSD', 57 82 author = 'Lawrence Journal-World', 58 83 author_email = 'holovaty@gmail.com', 59 84 description = 'A high-level Python Web framework that encourages rapid development and clean, pragmatic design.', 60 85 packages = packages, 61 86 data_files = data_files, 62 87 scripts = ['django/bin/django-admin.py'], 88 **setuptools_options 63 89 ) -
docs/install.txt
224 224 command ``svn update`` from within the ``django-trunk`` directory. When you do 225 225 this, Subversion will automatically download any changes. 226 226 227 Using setuptools' ``develop`` command 228 ------------------------------------- 229 230 **New in Django development version** 231 232 If you already installed setuptools_ you can skip step 3 and 4 of the 233 instructions above and use the ``develop`` command of setuptools instead:: 234 235 python setup.py develop 236 237 This adds a special file automatically to your system's ``site-packages`` 238 directory and enables the Python intepreter to find the Django checkout 239 without the need to create a symbolic link or to set the ``PYTHONPATH`` 240 environment variable. This is also platform-independent. 241 242 Installing using easy_install 243 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 244 **New in Django development version** 245 246 If you want to benefit from setuptools_'s package management and dependency 247 tracking, don't hesitate to install Django with easy_install_. 248 249 1. Make sure that you have Subversion_ and setuptools_ installed, and that you 250 can run its commands from a shell. (Enter ``svn help`` or 251 ``easy_install --help`` at a shell prompt to test this.) 252 253 2. Install Django's main development branch (the 'trunk') like so:: 254 255 easy_install http://code.djangoproject.com/svn/django/trunk/ 256 257 The above line checks out Django's source automatically and runs 258 ``python setup.py install`` for you. 259 260 This also works with Django's latest offical version or any other release 261 available at the `Python Package Index`_:: 262 263 easy_install Django 264 easy_install Django==0.95.2 265 easy_install Django==0.90 266 267 The Django source packages includes not only files with the actual code but 268 also documentation, an example project and some extras. If you want to examine 269 these files or use setuptools' ``develop`` command, tell easy_install_ to 270 automatically extract the package after download to a given directory:: 271 272 easy_install -eb /path/to/django-source Django 273 274 Once you are ready to install Django from these source files, just rerun 275 easy_install_ with that directory as the target:: 276 277 easy_install /path/to/django-source 278 279 If you want setuptools to install one of several recommended extras or a 280 Python database binding during Django's installation, you can also use 281 easy_install_ like this:: 282 283 easy_install Django[PostgreSQL] 284 easy_install Django[SQLite, PyYaml] 285 286 To see a full list of the available extras, open ``setup.py`` and look at the 287 ``extras_require`` keyword. 288 289 227 290 .. _`download page`: http://www.djangoproject.com/download/ 228 291 .. _Subversion: http://subversion.tigris.org/ 229 292 .. _from the Control Panel: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sysdm_advancd_environmnt_addchange_variable.mspx 293 .. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools 294 .. _`Python Package Index`: http://pypi.python.org/ 295 .. _easy_install: http://peak.telecommunity.com/DevCenter/EasyInstall -
docs/model-api.txt
2050 2050 Do this by editing your settings file and changing the ``INSTALLED_APPS`` 2051 2051 setting to add the name of the module that contains your ``models.py``. 2052 2052 2053 Any module that can be found on the Python module search path, which is defined 2054 in the environment variable ``PYTHONPATH`` as a list of directory names, is 2055 allowed. Please note this also applies to so-called `Python eggs`_, a single-file 2056 distribution format for Python libraries and modules such as Django apps. 2057 2053 2058 For example, if the models for your application live in the module 2054 ``mysite.myapp.models`` ( the package structure that is created for an2059 ``mysite.myapp.models`` (e.g. the package structure that is created for an 2055 2060 application by the ``manage.py startapp`` script), ``INSTALLED_APPS`` should 2056 2061 read, in part:: 2057 2062 … … 2061 2066 #... 2062 2067 ) 2063 2068 2069 .. _`Python eggs`: http://peak.telecommunity.com/DevCenter/PythonEggs 2070 .. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools 2071 2064 2072 Providing initial SQL data 2065 2073 ========================== 2066 2074 -
setup.cfg
2 2 doc_files = docs examples extras AUTHORS INSTALL LICENSE README 3 3 install-script = scripts/rpm-install.sh 4 4 5 [egg_info] 6 tag_build = pre 7 tag_svn_revision = 1