root/doc/overview

Revision ,14, 3.2 kB (checked in by Florian Birée <florian@…>, 7 months ago)

Make the documentation

Line 
1===========================
2Djanho xhtml pages (hpages)
3===========================
4
5This application let you have a minimalistic CMS_ for Django_. Pages are written
6in xhtml, hierarchy is managed only by you, administration is made with the
7defualt Django administration interface.
8
9.. _CMS: Content Managment System
10.. _Django: http://www.djangoproject.com/
11
12Basic use
13=========
14
15 * Install hpages somewhere in your python path
16 
17 * Edit your ``setings.py`` file, and add hpages in ``INSTALLED_APPS``. Because
18   hpages use Django default apps and Admin, your INSTALLED_APPS should be, at
19   least:
20
21    INSTALLED_APPS = (
22        'django.contrib.auth',
23        'django.contrib.contenttypes',
24        'django.contrib.sessions',   
25        'django.contrib.sites',
26        'django.contrib.admin',
27        'hpages'
28    )
29 
30 * Next, edit your ``urls.py`` file to handle hpages page. There is only one
31   entry to add. You can chosse to manage only some sub-url of your site by
32   hpages, by adding something like:
33   
34    (r'^section/(?P<url>.*)$', 'hpages.views.display_page')
35   
36   But you can also manage all your site using hpages, with this:
37   
38    (r'^(?P<url>.*)$', 'hpages.views.display_page')
39   
40   Because this grab all url, you should add this line after all other url
41   handler (admin, etc).
42 
43 * Run ``python manage.py syncdb`` to make all tables in the database
44
45Create pages
46============
47
48Next, you can login in the admin interface, and create a new page. You can
49fill some field:
50
51 * Title: the title of the page, as in head than in the page.
52 * Adress: the url of your page, after the first prefix. For example, if
53   all your site is managed by hpages (second example in the ``urls.py``
54   part), for the url ``http://example.org/mypage/``, you have to write
55   ``mypages``. For ``http://example.org/mysection/mysecondpage/``, you
56   have to write ``mysection/mysecondpage``.
57   See also the ``Special url`` section.
58 * Site: select on which site this page will be accessible
59 * Content: the content of the page, in full xhtml. Write here what you
60   have written if your site was static.
61 * Author: set the author of the page
62 * Language: define the value of the ``lang=''`` attribut of the page
63 * Metadata: see the``Metadata`` part.
64 * The last modification date is updated automaticaly
65
66Special urls
67============
68
69There is three special value for the Adress property of a page:
70
71 * "home": this value is used for the homepage of the web site. Because you
72   cannot set "/" as url (the first slash is implicit), use "home" instead.
73   This page will also be accessible by the ``/home`` url, but you shouldn't
74   use it: just link to ``/``.
75 
76 * "navbar": this page contain the navigation bar. This page will be displayed
77   on each page of the site, in the "navbar" part of the template.
78 
79 * "footer": act like the navigation bar, but for the footer.
80
81Metadata
82========
83
84Metadata objects are <meta> or <link> tags. If you want to add one of theses
85tag on a site or a single page, first make a new Meta object, and fill the
86fields.
87
88 * If you want to add this tag on all page of a site, set it in the Meta
89   properties pages.
90 * If you want to add this tag on a single page, add it in the Metadata
91   property of the page.
Note: See TracBrowser for help on using the browser.