Package: django-magneto
OverviewMagneto is a content and template management application built for theDjangoframework.ATemplaterepresents a web page on your site. Within the template
can be used any built-inTemplate Tags, as well as custom installed ones.
Beyond HTML pages, aTemplatecan also represent content types such as
CSS, Javascript, JSON, and XML. When using template inheritance, templates
can be marked for use strictly by the template loader and not for display
as a web page.Key FeaturesBecause templates and web pages are synonymous you can use template tags
and filters in your pages.Manage content types like html, css, javascript, xml, json, and text.Database queries can be minimized with the use of a cached template loader
that caches pre-rendered templates.Use CodeMirror in the admin for template editing.Know who changed what and when with built-in support forReversion.
Easily go back to older versions of the content.Group related templates withTemplate Groups. Useful when you have a
large number of templates.HTML5 Boilerplatefixtures included to get started quickly.Support forSouthmigrations.Admin PagesSandbox InstallationAn example application is provided to make this application easy to download
and demo in a sandboxed environment. Use the following commands to run it:$ hg clone http://bitbucket.org/prestontimmons/django-magneto
$ cd django-magneto
$ python bootstrap.py
$ bin/buildout
$ cp -r magneto/media/ example/media/magneto
$ bin/django syncdb
$ bin/django migrate
$ bin/django loaddata html5boilerplate.json
$ bin/django runserver 0.0.0.0:8000Visithttp://localhost:8000/admin/and update your domain inSitesettings to match the server your running on. Now you can view and edit
the templates that were loaded in.Site InstallationConfigure yoursettings.pyMake suredjango.contrib.sitesanddjango.contrib.adminare
installed. AddmagnetoandreversiontoINSTALLED_APPS.
Optionally addsouthfor migration support.Example:INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.admindocs',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',

      ...

    'magneto',
    'reversion',

      ...

    'south', # optional for migrations
)Addmagneto.loader.CachedTemplateLoadertoTEMPLATE_LOADERS.Example:TEMPLATE_LOADERS = (
    'magneto.loader.CachedTemplateLoader',

      ...

    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
)Copy media files to where they can be found by the admin pages.
* See the notes on the MAGNETO_MEDIA_DIRECTORY setting below for more
information.Add a url entry in your site urls.py.Example:urlpatterns = patterns('',
    (r'^admin/', include(admin.site.urls)),
    (r'^accounts/login/$', 'django.contrib.auth.views.login'),

      ...

    # Mount it at a specific url
    (r'^pages/', include('magneto.urls')),

    # Or mount it at your root url
    (r'^', include('magneto.urls')),
)Runpython manage.py syncdb.Runpython manage.py runserver 0.0.0.0:8000to start the
Django devserver.Configurable SettingsMAGNETO_MEDIA_DIRECTORYThe url of the root folder where the magneto media files are.
This defaults to a folder calledmagnetoin the directory specified
by theMEDIA_URLsetting.NotesBuilt for Python 2.6, Django 1.2 according toPEP8and theDjango Style Guide. If you’re using previous versions of Python or
Django your mileage may vary. Let me know if anything doesn’t work.Standing on the shoulders of giantsThis application is like a combined version of DjangoDB Templatesand
the built-inFlatpagesapplication. Thanks toJannis Leidelfor
open-sourcing theDB Templatesapp and for everyone who contributed to
Django.