Author: leidel
Date: Sat Nov 15 18:03:22 2008
New Revision: 79
Modified:
trunk/INSTALL
trunk/docs/overview.txt
trunk/example/manage.py (contents, props changed)
Log:
Added some documentation for the example project, support to start it
directly and small touches on the docs
Modified: trunk/INSTALL
==============================================================================
--- trunk/INSTALL (original)
+++ trunk/INSTALL Sat Nov 15 18:03:22 2008
@@ -5,7 +5,9 @@
Or if you'd prefer you can simply place the included ``dbtemplates``
directory somewhere on your Python path, or symlink to it from
somewhere on your Python path; this is useful if you're working from a
-Subversion checkout.
+Subversion checkout. Since ``dbtemplates`` is registered in the
+Python Package Index you can also run ``easy_install django-dbtemplates``
+or ``pip django-dbtemplates`` optionally.
Note that this application requires Python 2.3 or later, and a recent
Subversion checkout of Django. You can obtain Python from
Modified: trunk/docs/overview.txt
==============================================================================
--- trunk/docs/overview.txt (original)
+++ trunk/docs/overview.txt Sat Nov 15 18:03:22 2008
@@ -12,10 +12,15 @@
.. _template loader:
http://docs.djangoproject.com/en/dev/ref/templates/api/#loading-templates
+.. contents:: Table of Contents
+ :backlinks: none
+
Setup
=====
-1. Get the source from the subversion repository
+1. Get the source from the `Mercurial repository`_ or install it from the
+ Python Package Index by running ``easy_install django-dbtemplates`` or
+ ``pip django-dbtemplates``.
2. Follow the instructions in the INSTALL file
3. Edit the settings.py of your Django site:
@@ -51,6 +56,8 @@
4. Sync your database ``python manage.py syncdb``
5. Restart your Django server
+.. _Mercurial repository: http://bitbucket.org/jezdez/django-dbtemplates/
+
Usage
=====
@@ -70,6 +77,46 @@
contents in the database, you just need to leave the content field empty to
automatically populate it. That's especially useful if you don't want to
copy and paste its content manually to the textarea.
+
+Example
+=======
+
+``dbtemplates`` comes with an example Django project that let's you try it
+out. The example uses Django's own `flatpages app`_ to enable you to create
+a simple page using ``dbtemplates``. Flat pages are a perfect fit to
+dbtemplates since they come prepackaged and are simple to use.
+
+Here is how it works:
+
+1. Open your command line and change to the ``example`` directory in the
+ directory with the extracted source distribution.
+2. Run ``python manage.py syncdb`` and follow the instructions.
+3. Run ``python manage.py runserver`` and open your favorite browser with
the
+ address http://127.0.0.1:8000/admin/.
+4. Next add a new `Template` object in the ``dbtemplates`` section and use
+ ``flatpages/default.html`` as the value for the ``name`` field. For the
+ ``content`` field use this example::
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
+ "http://www.w3.org/TR/REC-html40/loose.dtd">
+ <html>
+ <head>
+ <title>{{ flatpage.title }}</title>
+ </head>
+ <body>
+ {{ flatpage.content }}
+ </body>
+ </html>
+
+5. Return to the home screen of the admin interface and add a new flat
page.
+ Use ``/`` (yep, just a forward slash) and whatever ``title`` and
+ ``content`` you prefer. Please make sure you select the default site
+ ``example.com`` before you save the flat page.
+6. Visit http://127.0.0.1:8000/ and see the flat page you just created
+ rendered with the ``flatpages/default.html`` template provided by
+ ``dbtemplates``.
+
+.. _flatpages app:
http://docs.djangoproject.com/en/dev/ref/contrib/flatpages/
Caching
=======
Modified: trunk/example/manage.py
==============================================================================
--- trunk/example/manage.py (original)
+++ trunk/example/manage.py Sat Nov 15 18:03:22 2008
@@ -1,5 +1,9 @@
#!/usr/bin/env python
+import os, sys
from django.core.management import execute_manager
+
+sys.path.insert(0, os.path.abspath('./..'))
+
try:
import settings # Assumed to be in the same directory.
except ImportError:
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---