Giter VIP home page Giter VIP logo

django-pagelets's Introduction

django-pagelets

Simple, flexible app for integrating static, unstructured content in a Django site

For complete documentation checkout, http://django-pagelets.readthedocs.org

Features

  • "Pagelets" for adding small pieces of content to otherwise static templates
  • CMS "pages" which include any number of pagelets and, if needed, attachments
  • Different pagelet content types including HTML and Markdown
  • An integrated WYSIWYG editor (WYMeditor) which can be selectively enabled/disabled

Required Dependencies

  • Django admin site
  • The django.core.context_processors.request context processor

Optional Dependencies

Installation and Setup

  1. django-pagelets is available on PyPI, so the easiest way to install it is to use pip:

    pip install django-pagelets
  2. Add pagelets to INSTALLED_APPS in settings.py and run syncdb:

    INSTALLED_APPS = (
        ...,
        'pagelets',
        ...
    )
  3. Add django.core.context_processors.request to TEMPLATE_CONTEXT_PROCESSORS:

    TEMPLATE_CONTEXT_PROCESSORS = (
        "django.contrib.auth.context_processors.auth",
        "django.core.context_processors.debug",
        "django.core.context_processors.i18n",
        "django.core.context_processors.media",
        "django.contrib.messages.context_processors.messages",
        "django.core.context_processors.request", # <----
    )
  4. Add the pagelets URLs to urls.py, e.g.:

    urlpatterns += patterns('',
        (r'^pagelets-management/', include('pagelets.urls.management')),
        (r'^', include('pagelets.urls.content')),
    )
  5. In development, you can serve pagelet's static media in urls.py:

    import pagelets
    path = os.path.join(os.path.dirname(pagelets.__file__), 'media')
    
    urlpatterns += patterns('',
        (
            r'^%spagelets/(?P<path>.*)' % settings.MEDIA_URL.lstrip('/'),
            'django.views.static.serve',
            {'document_root': path, 'show_indexes': True}
        ),
    )
  6. Visit the admin site, add and save a new page, and click the View on site link. If everything is setup correctly, you should be able to see and edit the content you just added.

Development sponsored by Caktus Consulting Group, LLC..

django-pagelets's People

Contributors

copelco avatar mlavin avatar tobiasmcnulty avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.