Ticket #6080: reusableapps2.diff
File reusableapps2.diff, 6.7 KB (added by , 17 years ago) |
---|
-
setup.py
1 from distutils.core import setup 2 from distutils.command.install import INSTALL_SCHEMES 1 try: 2 from setuptools import setup 3 except ImportError: 4 from distutils.core import setup 5 from distutils.command.install import INSTALL_SCHEMES 6 # Tell distutils to put the data_files in platform-specific installation 7 # locations. See here for an explanation: 8 # http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb 9 for scheme in INSTALL_SCHEMES.values(): 10 scheme['data'] = scheme['purelib'] 3 11 import os 4 12 import sys 5 13 … … 17 25 return result 18 26 return fullsplit(head, [tail] + result) 19 27 20 # Tell distutils to put the data_files in platform-specific installation21 # locations. See here for an explanation:22 # http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb23 for scheme in INSTALL_SCHEMES.values():24 scheme['data'] = scheme['purelib']25 26 28 # Compile the list of packages available, because distutils doesn't have 27 29 # an easy way to do this. 28 30 packages, data_files = [], [] … … 46 48 # Dynamically calculate the version based on django.VERSION. 47 49 version_tuple = __import__('django').VERSION 48 50 if version_tuple[2] is not None: 49 version = "%d.%d _%s" % version_tuple51 version = "%d.%d%s" % version_tuple 50 52 else: 51 53 version = "%d.%d" % version_tuple[:2] 52 54 … … 54 56 name = "Django", 55 57 version = version, 56 58 url = 'http://www.djangoproject.com/', 59 download_url = 'http://www.djangoproject.com/download/', 60 license = 'BSD', 57 61 author = 'Lawrence Journal-World', 58 62 author_email = 'holovaty@gmail.com', 59 63 description = 'A high-level Python Web framework that encourages rapid development and clean, pragmatic design.', 60 64 packages = packages, 61 65 data_files = data_files, 62 66 scripts = ['django/bin/django-admin.py'], 67 install_requires = ['setuptools>=0.6c7', 'Flup'], 68 extras_require = { 69 'MySQL': ["MySQLdb>=1.2.1p2"], 70 'SQLite': ["pysqlite>=2.0.3"], 71 'PostgreSQL': ["psycopg>=1.1.21"], 72 'PostgreSQL2': ["psycopg2>=2.0.5"], 73 'Oracle': ["cx_Oracle>=4.3.1"], 74 'PyYaml': ["PyYaml"], 75 }, 76 zip_safe = False, 63 77 ) -
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, defined in the 2054 environment variable ``PYTHONPATH`` as a list of directory names, is allowed. 2055 Please note this also applies to so-called `Python eggs`_, a single-file 2056 distribution format for Python libraries and modules, if the setuptools_ are 2057 installed on your system. 2058 2053 2059 For example, if the models for your application live in the module 2054 ``mysite.myapp.models`` ( the package structure that is created for an2060 ``mysite.myapp.models`` (e.g. the package structure that is created for an 2055 2061 application by the ``manage.py startapp`` script), ``INSTALLED_APPS`` should 2056 2062 read, in part:: 2057 2063 … … 2061 2067 #... 2062 2068 ) 2063 2069 2070 .. _`Python eggs`: http://peak.telecommunity.com/DevCenter/PythonEggs 2071 .. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools 2072 2064 2073 Providing initial SQL data 2065 2074 ========================== 2066 2075