Ticket #6080: reusableapps2.diff

File reusableapps2.diff, 6.7 KB (added by jezdez, 7 years ago)

Removed "pkg_resources app loading with entrypoints"-code from first patch and added more documentation, since it's enough to have an egg file on the PYTHONPATH. kudos to jacob for bringing me back down to earth :)

  • setup.py

    1 from distutils.core import setup
    2 from distutils.command.install import INSTALL_SCHEMES
     2    from setuptools import setup
     3except 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']
    311import os
    412import sys
    1725        return result
    1826    return fullsplit(head, [tail] + result)
    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']
    2628# Compile the list of packages available, because distutils doesn't have
    2729# an easy way to do this.
    2830packages, data_files = [], []
    4648# Dynamically calculate the version based on django.VERSION.
    4749version_tuple = __import__('django').VERSION
    4850if version_tuple[2] is not None:
    49     version = "%d.%d_%s" % version_tuple
     51    version = "%d.%d%s" % version_tuple
    5153    version = "%d.%d" % version_tuple[:2]
    5456    name = "Django",
    5557    version = version,
    5658    url = 'http://www.djangoproject.com/',
     59    download_url = 'http://www.djangoproject.com/download/',
     60    license = 'BSD',
    5761    author = 'Lawrence Journal-World',
    5862    author_email = 'holovaty@gmail.com',
    5963    description = 'A high-level Python Web framework that encourages rapid development and clean, pragmatic design.',
    6064    packages = packages,
    6165    data_files = data_files,
    6266    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,
  • docs/install.txt

    224224command ``svn update`` from within the ``django-trunk`` directory. When you do
    225225this, Subversion will automatically download any changes.
     227Using setuptools' ``develop`` command
     230**New in Django development version**
     232If you already installed setuptools_ you can skip step 3 and 4 of the
     233instructions above and use the ``develop`` command of setuptools instead::
     235    python setup.py develop
     237This adds a special file automatically to your system's ``site-packages``
     238directory and enables the Python intepreter to find the Django checkout
     239without the need to create a symbolic link or to set the ``PYTHONPATH``
     240environment variable. This is also platform-independent.
     242Installing using easy_install
     244**New in Django development version**
     246If you want to benefit from setuptools_'s package management and dependency
     247tracking, don't hesitate to install Django with easy_install_.
     2491. 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.)
     2532. Install Django's main development branch (the 'trunk') like so::
     255    easy_install http://code.djangoproject.com/svn/django/trunk/
     257   The above line checks out Django's source automatically and runs
     258   ``python setup.py install`` for you.
     260This also works with Django's latest offical version or any other release
     261available at the `Python Package Index`_::
     263    easy_install Django
     264    easy_install Django==0.95.2
     265    easy_install Django==0.90
     267The Django source packages includes not only files with the actual code but
     268also documentation, an example project and some extras. If you want to examine
     269these files or use setuptools' ``develop`` command, tell easy_install_ to
     270automatically extract the package after download to a given directory::
     272    easy_install -eb /path/to/django-source Django
     274Once you are ready to install Django from these source files, just rerun
     275easy_install_ with that directory as the target::
     277    easy_install /path/to/django-source
     279If you want setuptools to install one of several recommended extras or a
     280Python database binding during Django's installation, you can also use
     281easy_install_ like this::
     283    easy_install Django[PostgreSQL]
     284    easy_install Django[SQLite, PyYaml]
     286To see a full list of the available extras, open ``setup.py`` and look at the
     287``extras_require`` keyword.
    227290.. _`download page`: http://www.djangoproject.com/download/
    228291.. _Subversion: http://subversion.tigris.org/
    229292.. _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

    20502050Do this by editing your settings file and changing the ``INSTALLED_APPS``
    20512051setting to add the name of the module that contains your ``models.py``.
     2053Any module that can be found on the Python module search path, defined in the
     2054environment variable ``PYTHONPATH`` as a list of directory names, is allowed.
     2055Please note this also applies to so-called `Python eggs`_, a single-file
     2056distribution format for Python libraries and modules, if the setuptools_ are
     2057installed on your system.
    20532059For example, if the models for your application live in the module
    2054 ``mysite.myapp.models`` (the package structure that is created for an
     2060``mysite.myapp.models`` (e.g. the package structure that is created for an
    20552061application by the ``manage.py startapp`` script), ``INSTALLED_APPS`` should
    20562062read, in part::
    20612067        #...
    20622068    )
     2070.. _`Python eggs`: http://peak.telecommunity.com/DevCenter/PythonEggs
     2071.. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools
    20642073Providing initial SQL data
Back to Top