Thursday 9 August 2012

Adding Django-catalog

Django-catalog
This application was created to organize the objects in a tree structure.

Installation
A. Download

At present, a stable release Django-catalog there, but you can download the development version from the repository on github

pip install django-catalog


Two. Connect the application

To connect the installed Django-catalog, add in your project settings.py configuration file the following contents

INSTALLED_APPS = (
    'Catalog',
    'Catalog.contrib.defaults',

)
Three. Connect URLs applications

Add the URL of the application in the Django-catalog of your project urls.py

To use the scheme to access items on the tree slug

urlpatterns  = patterns ('',
    (r '^ catalog /', include ('catalog.urls.by_slug')),
)

To use the scheme to access elements of a tree on their id

urlpatterns  = patterns ('',
    (r '^ catalog /', include ('catalog.urls.by_id')),
)

4. Creating models

In order to use the directory to create for him a model. Previously, we hooked INSTALLED_APPS application directory implements the basic models and methods of work with them. At this stage, to ensure the health directory, we have enough. Start the synchronization of the database to create a catalog of standard models

python manage.py syncdb

Five. The administrative interface

To fill the catalog of categories and products go to the Django administration interface and select the Manage catalog.

6. The use of templates

Django-catalog is supplied with ready-made templates for the work, which should be enough to start using the directory.

No comments:

Post a Comment