Commits

Carl Meyer  committed 6ec3421

update setup.py

  • Participants
  • Parent commits c1ba64b

Comments (0)

Files changed (4)

File docs/index.rst

-Welcome to the localeurl documentation
-======================================
+Welcome to django-localeurl
+===========================
 
 The localeurl Django_ application allows you to specify the language
 of a page in the URL.
   * Search engines will index all languages.
   * Every page should have a unique URL. If you feel that different languages
     means different pages, then each language should get its own unique URL.
-  * Setting the language for the website should be done using a POST request
-    (because it influences subsequent page views, see `Django ticket #3651`_).
-    You might not want to use POST requests.
+  * If you don't set the language via the URL, setting the language
+    for the website should be done using a POST request (because it
+    influences subsequent page views, see `Django ticket #3651`_).
+    You might prefer a simple link for changing the language, and
+    localeurl allows this.
+
+.. _Django: http://www.djangoproject.com/
+.. _`Django ticket #3651`: http://code.djangoproject.com/ticket/3651
+
+You can install localeurl with pip_::
+
+    pip install django-localeurl
+
+or install the `in-development version`_::
+
+    pip install django-localeurl==dev
+
+.. _pip: http://pip.openplans.org
+.. _`in-development version`: http://bitbucket.org/carljm/django-localeurl/get/tip.gz#egg=django-localeurl-dev
+
+.. comment: split here
 
 The localeurl code is licensed under the `MIT License`_. See the
 ``LICENSE.txt`` file in the distribution.
 
-.. _Django: http://www.djangoproject.com/
-.. _`Django ticket #3651`: http://code.djangoproject.com/ticket/3651
 .. _`MIT License`: http://www.opensource.org/licenses/mit-license.php
 
 
 .. toctree::
 	:maxdepth: 2
 
-	installation
+	setup
 	usage
 	history

File docs/installation.rst

-============
-Installation
-============
-
-This section describes how to install the localeurl application in your Django
-project.
-
-
-Prerequisites
--------------
-
-The localeurl application requires Django_ 1.0 or higher.
-
-.. _Django: http://www.djangoproject.com/download/
-
-
-Installation
-------------
-
-Installation basically consists of installing the middleware and adding
-``'localeurl'`` to the installed applications list.
-
-#. Place the ``localeurl`` module in your Python path. You can put it into your
-   Django project directory or run ``python setup.py install`` from a shell.
-
-#. Add ``'localeurl.middleware.LocaleURLMiddleware'`` to
-   ``settings.MIDDLEWARE_CLASSES``. It must come *before*
-   ``'django.middleware.common.CommonMiddleware'`` or ``settings.APPEND_SLASH``
-   will not work.
-
-#. Add ``'localeurl'`` to ``settings.INSTALLED_APPS``. Because the application
-   needs to replace the standard ``urlresolvers.reverse`` function, it is
-   important to place it at the top of the list::
-
-     INSTALLED_APPS = (
-         'localeurl',
-         ...
-     )
-
-#. If you want to use the view, include the localeurl URLconf module in your
-   project::
-
-     urlpatterns = patterns('',
-         ...
-         (r'^localeurl/', include('localeurl.urls')),
-         ...
-     )
-
-#. Make sure ``settings.LANGUAGE_CODE`` or its root language is in
-   ``settings.LANGUAGES``. For example, if ``LANGUAGE_CODE == 'en-us'`` then
-   ``LANGUAGES`` must contain either ``'en-us'`` or ``'en'``. If you have not
-   changed either option you do not have to do anything.
-
-
-.. _configuration:
-
-Configuration
--------------
-
-The application can be configured by editing the project's ``settings.py``
-file.
-
-``LOCALE_INDEPENDENT_PATHS``
-  A tuple of regular expression objects matching paths that will not be
-  redirected to add the language prefix. For example, a site with a language
-  selection splash page would add ``'^/$'`` as a locale independent path match.
-  Note that for performance reasons you must use ``re`` objects, not strings.
-
-Example::
-
-  import re
-  LOCALE_INDEPENDENT_PATHS = (
-      re.compile('^/$'),
-      re.compile('^/games/'),
-      re.compile('^/ajax/'),
-  )
-
-``LOCALE_INDEPENDENT_MEDIA_URL`` (default: ``True``)
-  Whether paths starting with ``settings.MEDIA_URL`` (if it is a path, i.e. not
-  a full URL) are considered to be locale-independent.
-
-``PREFIX_DEFAULT_LOCALE`` (default: ``True``)
-  Whether to add the prefix for the default language
-  (``settings.LANGUAGE_CODE``). For example, if ``LANGUAGE_CODE == 'en'`` then
-  the path ``/about/`` will be passed to the URL resolver unchanged and
-  ``/en/about/`` will be redirected to ``/about/``.
-
-``LOCALEURL_USE_ACCEPT_LANGUAGE`` (default: ``False``)
-  Whether to check the ``Accept-Language`` header from the browser as
-  an intermediate fallback in case no locale is specified in the
-  URL. (The default behavior, preserved for backwards compatibility,
-  is to fallback directly to ``settings.LANGUAGE_CODE``).

File docs/setup.rst

+============
+Installation
+============
+
+This section describes how to install the localeurl application in your Django
+project.
+
+
+Prerequisites
+-------------
+
+The localeurl application requires Django_ 1.0 or higher.
+
+.. _Django: http://www.djangoproject.com/download/
+
+
+Setup
+-----
+
+Setup consists of installing the middleware and adding ``'localeurl'``
+to the installed applications list.
+
+#. Add ``'localeurl.middleware.LocaleURLMiddleware'`` to
+   ``settings.MIDDLEWARE_CLASSES``. It must come *before*
+   ``'django.middleware.common.CommonMiddleware'`` or ``settings.APPEND_SLASH``
+   will not work.
+
+#. Add ``'localeurl'`` to ``settings.INSTALLED_APPS``. Because the application
+   needs to replace the standard ``urlresolvers.reverse`` function, it is
+   important to place it at the top of the list::
+
+     INSTALLED_APPS = (
+         'localeurl',
+         ...
+     )
+
+#. If you want to use the view, include the localeurl URLconf module in your
+   project::
+
+     urlpatterns = patterns('',
+         ...
+         (r'^localeurl/', include('localeurl.urls')),
+         ...
+     )
+
+#. Make sure ``settings.LANGUAGE_CODE`` or its root language is in
+   ``settings.LANGUAGES``. For example, if ``LANGUAGE_CODE == 'en-us'`` then
+   ``LANGUAGES`` must contain either ``'en-us'`` or ``'en'``. If you have not
+   changed either option you do not have to do anything.
+
+
+.. _configuration:
+
+Configuration
+-------------
+
+The application can be configured by editing the project's ``settings.py``
+file.
+
+``LOCALE_INDEPENDENT_PATHS``
+  A tuple of regular expression objects matching paths that will not be
+  redirected to add the language prefix. For example, a site with a language
+  selection splash page would add ``'^/$'`` as a locale independent path match.
+  Note that for performance reasons you must use ``re`` objects, not strings.
+
+Example::
+
+  import re
+  LOCALE_INDEPENDENT_PATHS = (
+      re.compile('^/$'),
+      re.compile('^/games/'),
+      re.compile('^/ajax/'),
+  )
+
+``LOCALE_INDEPENDENT_MEDIA_URL`` (default: ``True``)
+  Whether paths starting with ``settings.MEDIA_URL`` (if it is a path, i.e. not
+  a full URL) are considered to be locale-independent.
+
+``PREFIX_DEFAULT_LOCALE`` (default: ``True``)
+  Whether to add the prefix for the default language
+  (``settings.LANGUAGE_CODE``). For example, if ``LANGUAGE_CODE == 'en'`` then
+  the path ``/about/`` will be passed to the URL resolver unchanged and
+  ``/en/about/`` will be redirected to ``/about/``.
+
+``LOCALEURL_USE_ACCEPT_LANGUAGE`` (default: ``False``)
+  Whether to check the ``Accept-Language`` header from the browser as
+  an intermediate fallback in case no locale is specified in the
+  URL. (The default behavior, preserved for backwards compatibility,
+  is to fallback directly to ``settings.LANGUAGE_CODE``).
 # Copyright (c) 2008 Joost Cassee
 # Licensed under the terms of the MIT License (see LICENSE.txt)
 
-from distutils.core import setup
+from setuptools import setup
 import metadata
 
 app_name = metadata.name
 version = metadata.version
 
+long_description = open('docs/index.rst').read().split('split here', 1)[0] + """
+
+See the `full documentation`_.
+
+.. _`full documentation`: http://packages.python.org/django-localeurl/
+"""
+
 setup(
     name = "django-%s" % app_name,
     version = version,
 
     author = "Joost Cassee",
     author_email = "joost@cassee.net",
+    maintainer = "Carl Meyer",
+    maintainer_email = "carl@oddbird.net",
     description = "A Django application that allow you to specify the" \
             " language of a page in the URL.",
-    long_description = \
-"""
-Suppose you have a Django website in multiple languages. The localeurl
-application allow you to specify the language of a page in the URL, like so:
-`http://www.example.com/nl/company/profile`. Any URLs without language prefix
-will be redirected to add the prefix for the default language.
-
-Some reasons for using localeurl:
-
-* Search engines will index all languages.
-* Every page should have a unique URL. If you feel that different languages
-  means different pages, then each language should get its own unique URL.
-* Setting the language for the website should be done using a POST request
-  (because it influences subsequent page views, see `Django ticket #3651`_).
-  You might not want to use POST requests.
-
-.. _Django ticket #3651: http://code.djangoproject.com/ticket/3651
-""",
+    long_description = long_description,
     license = "MIT License",
     keywords = "django i18n",
     classifiers = [
         'Topic :: Software Development :: Libraries :: Python Modules',
         'Topic :: Software Development :: Localization',
     ],
-    platforms = ['any'],
-    url = "http://code.google.com/p/django-%s/" % app_name,
-    download_url = "http://code.google.com/p/django-%s/downloads/list" \
-            % app_name,
+    url = "http://packages.python.org/django-%s/" % app_name,
 )