Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 59f158fc1e
Fetching contributors…

Cannot retrieve contributors at this time

file 42 lines (29 sloc) 1.245 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
Using django-boxes
==================


Basics
------

To integrate ``django-boxes`` with your site, there are a few things
that are required. A minimal integration can work like this:

1. List this application in the ``INSTALLED_APPS`` portion of your settings
    file. Your settings file will look something like::
   
        INSTALLED_APPS = (
            # ...
            "boxes",
        )

2. Add the ``boxes`` URLs to the end of your root URLconf. Your URLconf
    will look something like::
    
        urlpatterns = patterns("",
            # ...
            url(r"^admin/", include(admin.site.urls)),
            url(r"^boxes/", include("boxes.urls")),
        )

3. Add two templates under ``templates/boxes/``. One called ``refresh.html``
    that has nothing in context and the other, ``box_edit.html`` that has a
    ``form`` variable in context.

4. Wherever you want to display a content box::
    
        {% load boxes_tags %}
    
    Then, use the ``box`` tag to display the content in addition to edit
    links if authorized::
    
        {% box label [*args **kwargs] %}
    
    Where the ``*args`` and ``**kwargs`` are passed to the authorizatoin function,
    if not supplied no edit link will ever appear.
Something went wrong with that request. Please try again.