diff --git a/INSTALL b/INSTALL index 6bcf12e..b2ae22e 100644 --- a/INSTALL +++ b/INSTALL @@ -5,7 +5,9 @@ To install it, run the following command inside this directory: 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 diff --git a/docs/overview.txt b/docs/overview.txt index dcaaefd..d20a98b 100644 --- a/docs/overview.txt +++ b/docs/overview.txt @@ -12,10 +12,15 @@ of the templates saved in the database. .. _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 @@ Setup 4. Sync your database ``python manage.py syncdb`` 5. Restart your Django server +.. _Mercurial repository: http://bitbucket.org/jezdez/django-dbtemplates/ + Usage ===== @@ -71,6 +78,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:: + + + +
+