mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Used auto-numbered lists in documentation.
This commit is contained in:
committed by
Tim Graham
parent
cf915cb513
commit
9b15ff08ba
@@ -8,9 +8,9 @@ Overview
|
||||
========
|
||||
In general, GeoDjango installation requires:
|
||||
|
||||
1. :ref:`Python and Django <django>`
|
||||
2. :ref:`spatial_database`
|
||||
3. :doc:`geolibs`
|
||||
#. :ref:`Python and Django <django>`
|
||||
#. :ref:`spatial_database`
|
||||
#. :doc:`geolibs`
|
||||
|
||||
Details for each of the requirements and installation instructions
|
||||
are provided in the sections below. In addition, platform-specific
|
||||
|
||||
@@ -31,7 +31,7 @@ then inserting into a GeoDjango model.
|
||||
Example
|
||||
=======
|
||||
|
||||
1. You need a GDAL-supported data source, like a shapefile (here we're using
|
||||
#. You need a GDAL-supported data source, like a shapefile (here we're using
|
||||
a simple polygon shapefile, ``test_poly.shp``, with three features)::
|
||||
|
||||
>>> from django.contrib.gis.gdal import DataSource
|
||||
@@ -50,7 +50,7 @@ Example
|
||||
PRIMEM["Greenwich",0],
|
||||
UNIT["Degree",0.017453292519943295]]
|
||||
|
||||
2. Now we define our corresponding Django model (make sure to use :djadmin:`migrate`)::
|
||||
#. Now we define our corresponding Django model (make sure to use :djadmin:`migrate`)::
|
||||
|
||||
from django.contrib.gis.db import models
|
||||
|
||||
@@ -61,7 +61,7 @@ Example
|
||||
def __str__(self):
|
||||
return 'Name: %s' % self.name
|
||||
|
||||
3. Use :class:`LayerMapping` to extract all the features and place them in the
|
||||
#. Use :class:`LayerMapping` to extract all the features and place them in the
|
||||
database::
|
||||
|
||||
>>> from django.contrib.gis.utils import LayerMapping
|
||||
|
||||
@@ -292,8 +292,8 @@ transform do not change. For example::
|
||||
|
||||
To use this field, you'll need to:
|
||||
|
||||
1. Add ``'django.contrib.postgres'`` in your :setting:`INSTALLED_APPS`.
|
||||
2. :ref:`Setup the hstore extension <create-postgresql-extensions>` in
|
||||
#. Add ``'django.contrib.postgres'`` in your :setting:`INSTALLED_APPS`.
|
||||
#. :ref:`Setup the hstore extension <create-postgresql-extensions>` in
|
||||
PostgreSQL.
|
||||
|
||||
You'll see an error like ``can't adapt type 'dict'`` if you skip the first
|
||||
|
||||
@@ -14,12 +14,12 @@ Installation
|
||||
|
||||
To install the redirects app, follow these steps:
|
||||
|
||||
1. Ensure that the ``django.contrib.sites`` framework
|
||||
#. Ensure that the ``django.contrib.sites`` framework
|
||||
:ref:`is installed <enabling-the-sites-framework>`.
|
||||
2. Add ``'django.contrib.redirects'`` to your :setting:`INSTALLED_APPS` setting.
|
||||
3. Add ``'django.contrib.redirects.middleware.RedirectFallbackMiddleware'``
|
||||
#. Add ``'django.contrib.redirects'`` to your :setting:`INSTALLED_APPS` setting.
|
||||
#. Add ``'django.contrib.redirects.middleware.RedirectFallbackMiddleware'``
|
||||
to your :setting:`MIDDLEWARE` setting.
|
||||
4. Run the command :djadmin:`manage.py migrate <migrate>`.
|
||||
#. Run the command :djadmin:`manage.py migrate <migrate>`.
|
||||
|
||||
How it works
|
||||
============
|
||||
|
||||
@@ -31,15 +31,13 @@ Installation
|
||||
|
||||
To install the sitemap app, follow these steps:
|
||||
|
||||
1. Add ``'django.contrib.sitemaps'`` to your :setting:`INSTALLED_APPS`
|
||||
setting.
|
||||
#. Add ``'django.contrib.sitemaps'`` to your :setting:`INSTALLED_APPS` setting.
|
||||
|
||||
2. Make sure your :setting:`TEMPLATES` setting contains a ``DjangoTemplates``
|
||||
#. Make sure your :setting:`TEMPLATES` setting contains a ``DjangoTemplates``
|
||||
backend whose ``APP_DIRS`` options is set to ``True``. It's in there by
|
||||
default, so you'll only need to change this if you've changed that setting.
|
||||
|
||||
3. Make sure you've installed the
|
||||
:mod:`sites framework <django.contrib.sites>`.
|
||||
#. Make sure you've installed the :mod:`sites framework<django.contrib.sites>`.
|
||||
|
||||
(Note: The sitemap application doesn't install any database tables. The only
|
||||
reason it needs to go into :setting:`INSTALLED_APPS` is so that the
|
||||
|
||||
@@ -261,14 +261,13 @@ Enabling the sites framework
|
||||
|
||||
To enable the sites framework, follow these steps:
|
||||
|
||||
1. Add ``'django.contrib.sites'`` to your :setting:`INSTALLED_APPS`
|
||||
setting.
|
||||
#. Add ``'django.contrib.sites'`` to your :setting:`INSTALLED_APPS` setting.
|
||||
|
||||
2. Define a :setting:`SITE_ID` setting::
|
||||
#. Define a :setting:`SITE_ID` setting::
|
||||
|
||||
SITE_ID = 1
|
||||
|
||||
3. Run :djadmin:`migrate`.
|
||||
#. Run :djadmin:`migrate`.
|
||||
|
||||
``django.contrib.sites`` registers a
|
||||
:data:`~django.db.models.signals.post_migrate` signal handler which creates a
|
||||
|
||||
Reference in New Issue
Block a user