Author: batiste.bieler
Date: Mon Apr 20 13:09:38 2009
New Revision: 468
Modified:
wiki/InstallDjangoPageCMS.wiki
Log:
Edited wiki page through web user interface.
Modified: wiki/InstallDjangoPageCMS.wiki
==============================================================================
--- wiki/InstallDjangoPageCMS.wiki (original)
+++ wiki/InstallDjangoPageCMS.wiki Mon Apr 20 13:09:38 2009
@@ -3,13 +3,15 @@
=Install in legacy project=
-To install django-page-cms please read carefully this document. Pay a
special attention to the bold *must* statements.
+This document explain how to install django page CMS into an existing
Django project. This document assume that you already know how to setup a
Django project.
-If you have any problem installing this CMS, take a look at the example
application that stands in the example directory first. It will certainly
help you to get started.
+If you have any problem installing this CMS, take a look at the example
application that stands in the example directory. This application works
out of the box and will certainly help you to get started.
+
+Pay a special attention to the following bold *must* statements.
==Install by using pip==
-The pip install is by far the easiest one. Please use this method if you
have the choice.
+The pip install is by far the easiest one. Use this method if you have the
choice.
use :
@@ -47,7 +49,7 @@
==Urls==
-Please take a look in the `urls.py` of the default project and copy
desired URLs in your settings. Basically you need to have something like
this:
+Take a look in the `example/urls.py` and copy desired URLs in your own
`urls.py`. Basically you need to have something like this:
{{{
urlpatterns = patterns('',
@@ -57,11 +59,24 @@
)
}}}
+When you will visit the site the first time (`/pages/`), you will get a
404 error because there is no published page. Go to the admin first and
create and publish some pages.
+
+You will certainly want to activate the static file serve view in your
`urls.py` if you are in developement mode:
+
+{{{
+if settings.DEBUG:
+ urlpatterns += patterns('',
+ # Trick for Django to support static files (security hole: only
for Dev environement! remove this on Prod!!!)
+ url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
+ url(r'^admin_media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.ADMIN_MEDIA_ROOT}),
+ )
+}}}
+
==Settings==
All the Django page CMS specific settings and options are listed and
explained in the `pages/settings.py` file.
-Django page CMS require that several of these settings to be set. You will
recognize these settings in the following document by a bold "*must*".
+Django page CMS require several of these settings to be set. They are
marked in this document with a bold "*must*".
===Tagging===
@@ -201,8 +216,12 @@
===Media directory===
The django CMS come with some javascript and CSS files. These files are
standing in the `pages/media/pages` directory.
+
+If you don't know how to serve static files with Django please read :
+
+http://docs.djangoproject.com/en/dev/howto/static-files/
-The CMS setting `PAGES_MEDIA_URL` enable you to tell the the browser where
to request these files. By default the value of `PAGES_MEDIA_URL` is set
to :
+Django CMS has a special setting called `PAGES_MEDIA_URL` that enable you
to change how the browser will ask for these files in the CMS admin. By
default the value of `PAGES_MEDIA_URL` is set to :
{{{
PAGES_MEDIA_URL = getattr(settings, 'PAGES_MEDIA_URL',
join(settings.MEDIA_URL, 'pages/'))
@@ -214,9 +233,23 @@
PAGES_MEDIA_URL = settings.MEDIA_URL + "pages/"
}}}
+In the CMS admin template you have
+
+{{{
+<link rel="stylesheet" type="text/css" href="{{ PAGES_MEDIA_URL
}}css/pages.css" />
+<script type="text/javascript" src="{{ PAGES_MEDIA_URL
}}javascript/jquery.js"></script>
+}}}
+
+That will be rendered by default like this if `MEDIA_URL == '/media/'`
+
+{{{
+<link rel="stylesheet" type="text/css" href="/media/pages/css/pages.css" />
+<script type="text/javascript"
src="/media/pages/javascript/jquery.js"></script>
+}}}
+
You can off course redefine this variable in your setting file if you are
not happy with this default.
-It means that *you must at least create a symbolic link or copy the
directory `pages/media/pages/`* into your media directory to have a fully
functioning administration interface.
+*You must at least create a symbolic link or copy the directory
`pages/media/pages/`* into your media directory to have a fully functioning
administration interface.
The example application directly point the `MEDIA_ROOT` on `page/media`
directory :
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---