===========================
Djanho xhtml pages (hpages)
===========================
This application let you have a minimalistic CMS_ for Django_. Pages are written
in xhtml, hierarchy is managed only by you, administration is made with the
defualt Django administration interface.
.. _CMS: Content Managment System
.. _Django: http://www.djangoproject.com/
Basic use
=========
* Install hpages somewhere in your python path
* Edit your ``setings.py`` file, and add hpages in ``INSTALLED_APPS``. Because
hpages use Django default apps and Admin, your INSTALLED_APPS should be, at
least:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'hpages'
)
* Next, edit your ``urls.py`` file to handle hpages page. There is only one
entry to add. You can chosse to manage only some sub-url of your site by
hpages, by adding something like:
(r'^section/(?P.*)$', 'hpages.views.display_page')
But you can also manage all your site using hpages, with this:
(r'^(?P.*)$', 'hpages.views.display_page')
Because this grab all url, you should add this line after all other url
handler (admin, etc).
* Run ``python manage.py syncdb`` to make all tables in the database
Create pages
============
Next, you can login in the admin interface, and create a new page. You can
fill some field:
* Title: the title of the page, as in head than in the page.
* Adress: the url of your page, after the first prefix. For example, if
all your site is managed by hpages (second example in the ``urls.py``
part), for the url ``http://example.org/mypage/``, you have to write
``mypages``. For ``http://example.org/mysection/mysecondpage/``, you
have to write ``mysection/mysecondpage``.
See also the ``Special url`` section.
* Site: select on which site this page will be accessible
* Content: the content of the page, in full xhtml. Write here what you
have written if your site was static.
* Author: set the author of the page
* Language: define the value of the ``lang=''`` attribut of the page
* Metadata: see the``Metadata`` part.
* The last modification date is updated automaticaly
Special urls
============
There is three special value for the Adress property of a page:
* "home": this value is used for the homepage of the web site. Because you
cannot set "/" as url (the first slash is implicit), use "home" instead.
This page will also be accessible by the ``/home`` url, but you shouldn't
use it: just link to ``/``.
* "navbar": this page contain the navigation bar. This page will be displayed
on each page of the site, in the "navbar" part of the template.
* "footer": act like the navigation bar, but for the footer.
Metadata
========
Metadata objects are or tags. If you want to add one of theses
tag on a site or a single page, first make a new Meta object, and fill the
fields.
* If you want to add this tag on all page of a site, set it in the Meta
properties pages.
* If you want to add this tag on a single page, add it in the Metadata
property of the page.