Skip to main content

Editable text for PSU Django apps

Project description


Reusable Django app specifically for PSU's custom-built web applications.
Provides the ability to include user-editable text in any site using the psu_base plugin.

  • Template tags for editable text
  • WYSIWYG interface for editing the text

Quick Start


The following dependency is REQUIRED and must be installed in your app:


pip install psu-infotext


  1. Configure psu-base in your Django app
  2. Add PSU-Infotext to your INSTALLED_APPS in
  3. Configure your app's top-level to include Infotext views:
    urlpatterns = [
        path('infotext/', include(('psu_infotext.urls', 'psu_infotext'), namespace='infotext')),
  4. Run migrations: python migrate


Template Tags

The primary purpose of this app is to provide template tags that allow authorized users to update text on your site. For a small amount of text, use the {%infotext%} tag. For a larger amount of text, use the {%infotext_block%} tag.
The following example uses both tags:

{% load infotext_taglib %}

<h1>{%infotext code="main_heading" alt="Hello, World!"%}</h1>

{%infotext_block code="example_content"%}
    This is an example of longer <em>infotext</em><br>
        <li>Bla bla bla</li>

Required Attributes:

  • code: This should uniquely identify the text for the page (url/path)
  • alt: Alternate (default) text to use when not found in the database
    (This only applies to the {%infotext%} tag. The body of the {%infotext_block%} tag is used as the alt text)

Optional Attributes:

  • auto_prefix: Defaults to True. When true, the text will be made specific to the page by prepending the request path (url) to the code attribute. Set this to False for any text that is to be displayed on multiple pages (like an error message) to prevent multiple instances of the text that may get out-of-sync and display differently on different pages.
  • replacements: This may be a dict, or string representation of a dict, with the key being the text to search for, and the value being the replacement text.

Additional documentation exists in Confluence.

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

psu-infotext-2.0.0.tar.gz (13.5 kB view hashes)

Uploaded source

Built Distribution

psu_infotext-2.0.0-py2.py3-none-any.whl (26.6 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page