Simple pages is an application for building out pages on a site through the Django admin interface. If you are familiar with the django.contrib.flatpages app simple pages uses the same concept(and some of the same code) and builds out from there.
Features
- Create edit and delete pages within the Django Admin interface using the YUI Rich Text Editor.
- Create site sections for the primary navigation and have it dynamically generate the site navigation for you. With the ability to specify what sections and pages show in the navigation.
- Direct link to edit the pages as you are browsing the site to for quicker and easier editing.
- Ability to easily include page content on dynamic pages, such as a generic view listing page that you want to have some intro text and an image on.
- Easily extensible as it's a normal django app you can easily customize to fit your needs.
- Absolutely no restrictions on the site design.
- Easily integrates with other django apps.
Requirements
A relatively recent version django-svn.
Documentation
Quick Install
View more indepth installation instructions here
- Currently to get the code you'll have to check it out from the repository here.
- Checkout the above code and place "simplepages" on you python path.
- Add 'simplepages' to your projects settings.py file
- Add this "simplepages.middleware.PageFallbackMiddleware" as the last item in your settings.py MIDDLEWARE_CLASSES config
- Run the manage.py syncdb to create the necessary database tables
- You should now be able to go into your Sites admin and create Site Sections and pages for within those site sections.
- To view the page just browse to the url you entered when creating the page.
At this point the basic system should be working but a little more configuration has to be done to get the html editor, the edit this page, and the prepopulating the url with the section url to work.
- Copy the three javascript files in simplepages/media/admin/js to either your admin_media folder. Two of these files are new js files, but the "CollapsedFieldsets.js" will overwrite the existing one to fix this bug.
- In your projects urls.py file add in the following url:
- At this point the html editor and the prepopulating for the urls should be working. One more step is required for the edit this page functionality to appear on the site. Paste the below (also included in the sample_base.html template) into the bottom of your base.html template.
{% if user.is_staff %}
{# Determining if we should load the javascript for displaying admin links #}
<script type="text/javascript" src="{{ MEDIA_URL }}/admin/js/browse_edit.js" defer="true"></script>
{% endif %}Make sure to update the location to point to your admin media folder if it's not the 'admin' subdirectory of your media_url.
Everything should be setup and working now. If the rich text editor, the edit page or the prepopulate aren't working it's most likely due to incorrect paths to the javascript files so they aren't being loaded.
What Simple pages doesn't do
- It is not a full featured cms it only manages pages and it does that at a fairly simple level.
- The menu hierarchy is only one level, site section to pages. This can be extended to allow additional levels of links or even unlimited levels, but you'd have to code up that capability.