Django

Code

Changeset 2764

Show
Ignore:
Timestamp:
04/27/06 23:54:51 (2 years ago)
Author:
adrian
Message:

magic-removal: Proofread docs/flatpages.txt

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/magic-removal/docs/flatpages.txt

    r2608 r2764  
    44 
    55Django comes with an optional "flatpages" application. It lets you store simple 
    6 "flat" HTML content in a database and handles the management for you. 
     6"flat" HTML content in a database and handles the management for you via 
     7Django's admin interface and a Python API. 
    78 
    89A flatpage is a simple object with a URL, title and content. Use it for 
     
    2425To install the flatpages app, follow these steps: 
    2526 
    26     1. Add ``"django.contrib.flatpages"`` to your INSTALLED_APPS_ setting. 
    27     2. Add ``"django.contrib.flatpages.middleware.FlatpageFallbackMiddleware"`` 
     27    1. Add ``'django.contrib.flatpages'`` to your INSTALLED_APPS_ setting. 
     28    2. Add ``'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware'`` 
    2829       to your MIDDLEWARE_CLASSES_ setting. 
    29     3. Run the command ``django-admin.py install flatpages``. 
     30    3. Run the command ``manage.py syncdb``. 
    3031 
    3132.. _INSTALLED_APPS: http://www.djangoproject.com/documentation/settings/#installed-apps 
     
    3536============ 
    3637 
    37 ``django-admin.py install flatpages`` creates two tables in your database: 
    38 ``django_flatpage`` and ``django_flatpage_sites``. ``django_flatpage`` is a 
    39 simple lookup table that essentially maps a URL to a title and bunch of text 
    40 content. ``django_flatpage_sites`` associates a flatpage with a site. 
     38``manage.py syncdb`` creates two tables in your database: ``django_flatpage`` 
     39and ``django_flatpage_sites``. ``django_flatpage`` is a simple lookup table 
     40that simply maps a URL to a title and bunch of text content. 
     41``django_flatpage_sites`` associates a flatpage with a site. 
    4142 
    4243The ``FlatpageFallbackMiddleware`` does all of the work. Each time any Django 
     
    8182 
    8283Flatpages are represented by a standard `Django model`_, which lives in 
    83 `django/contrib/flatpages/models/flatpages.py`_. You can access flatpag
    84 objects via the `Django database API`_. 
     84`django/contrib/flatpages/models.py`_. You can access flatpage objects via th
     85`Django database API`_. 
    8586 
    8687.. _Django model: http://www.djangoproject.com/documentation/model_api/ 
     
    9192================== 
    9293 
    93 By default, flatpages are rendered via the template ``flatpages/default``, but 
    94 you can override that for a particular flatpage. 
     94By default, flatpages are rendered via the template ``flatpages/default.html``, 
     95but you can override that for a particular flatpage. 
    9596 
    96 Creating the ``flatpages/default`` template is your responsibility; in your 
    97 template directory, just create a ``flatpages`` directory containing a file 
    98 ``default.html``. 
     97Creating the ``flatpages/default.html`` template is your responsibility; in 
     98your template directory, just create a ``flatpages`` directory containing a 
     99file ``default.html``. 
    99100 
    100101Flatpage templates are passed a single context variable, ``flatpage``, which is 
    101102the flatpage object. 
    102103 
    103 Here's a sample ``flatpages/default`` template:: 
     104Here's a sample ``flatpages/default.html`` template:: 
    104105 
    105106    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"