This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A reusable Django app that allows to place dynamic content into templates.

Project Description

A reusable Django app that allows to place dynamic content into templates.

Usually you would use a CMS like django-cms for this scenario, which also has very useful static placeholders as of version 3, but sometimes you have a small project that doesn’t need a fully blown CMS. In this usecase a simple model with content that can be edited via the admin and which instances can be placed in templates would be nice to have.

As this app grows, we might add frontend editing ability in the future.

Installation

To get the latest stable release from PyPi

pip install django-dynamic-content

To get the latest commit from GitHub

pip install -e git+git://github.com/bitmazk/django-dynamic-content.git#egg=dynamic_content

Add dynamic_content to your INSTALLED_APPS

INSTALLED_APPS = (
    ...,
    'dynamic_content',
            'hvad',
            'ckeditor',
)

Please check out the ckeditor docs for installation and configuration: https://github.com/django-ckeditor/django-ckeditor

Before your tags/filters are available in your templates, load them by using

{% load dynamic_content_tags %}

Don’t forget to migrate your database

./manage.py migrate dynamic_content

Usage

Just put this into your template:

{% load dynamic_content_tags %}
{% get_content "FOOTER_INFO" default="Foobar!" as footer %}
    {{ footer.content|linebreaks }}
    {{ footer.content_html|safe }}

Of course you are not forced to use both content fields (html and non-html).

Templatetags

get_content

Usage: {% get_content "<content_identifier" [default="Default text"] as <variable_name> %}

This is an assignment tag that simply fetches the content from the database based on the given unique content identifier.

If no object with the given identifier is found, a new one will be created. If you pass in a default text, the new object will be created with that text.

Contribute

If you want to contribute to this project, please perform the following steps

# Fork this repository
# Clone your fork
mkvirtualenv -p python2.7 django-dynamic-content
make develop

git co -b feature_branch master
# Implement your feature and tests
git add . && git commit
git push -u origin feature_branch
# Send us a pull request for your feature branch
Release History

Release History

This version
History Node

0.3.1

History Node

0.3

History Node

0.2.3

History Node

0.2.2

History Node

0.2.1

History Node

0.2

History Node

0.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-dynamic-content-0.3.1.tar.gz (10.4 kB) Copy SHA256 Checksum SHA256 Source May 2, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting