Skip to main content

Developer-friendly, simple CMS for Django, "flatpages on steroids".

Project description

https://api.travis-ci.org/Open-E-WEB/django-powerpages.svg?branch=master https://img.shields.io/pypi/v/django-powerpages.svg https://coveralls.io/repos/github/Open-E-WEB/django-powerpages/badge.svg?branch=master

Developer-friendly, simple CMS for Django, “flatpages on steroids”.

Features

  • edit pages in Admin using syntax highlighting - HTML, CSS, JavaScript, Django template language

  • edit pages as files using your favourite text editor or IDE

  • on demand synchronization of pages between database and file system using Django commands

  • integration with Django’s template system

  • attach custom server-side logic to a page through configurable Page Processors

  • sitemap.xml

Installation

Install package using pip:

pip install django-powerpages

Add 'powerpages' to INSTALLED_APPS in your settings module:

INSTALLED_APPS = (
    ...
    'powerpages',
)

Define POWER_PAGES setting:

POWER_PAGES = {
    # absolute path to directory, where page files are located:
    'SYNC_DIRECTORY': '/path/to/directory/'
}

Include app’s URLs at the end of your urlconf:

urlpatterns = [
    ...
    url(r'', include('powerpages.urls', namespace='powerpages')),
]

Run migrations:

python manage.py migrate

Usage

Admin screenshots:

powerpages-scr-01.png powerpages-scr-02.png

Synchronization

Export pages from database to file system is done by website_dump command. All pages are saved as structure of files and directories inside settings.POWER_PAGES['SYNC_DIRECTORY'].

python manage.py website_dump

Example structure of output directory:

_index_.page
about-us/_index_.page
about-us/contact.page
download.page
robots.txt

Each of dumped files has the following structure:

{
   ... page fields as JSON
}
## TEMPLATE SOURCE: ##
... template content (plain text)

Import pages from directory into database is done using website_load command.

python manage.py website_load

Both website commands accept a variety of options to tweak their behaviour. For the full list of options, use --help.

TODO: complete the documentation

Requirements

Python: 2.7, 3.4, 3.5

Django: 1.9, 1.10

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-powerpages-0.0.3.tar.gz (1.2 MB view hashes)

Uploaded Source

Built Distribution

django_powerpages-0.0.3-py2.py3-none-any.whl (1.3 MB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page