Developer manual ================= Make your app pluggable ------------------------ The easy way to make your app pluggable is to use the paster template:: $ easy_install DjangoPluggableApp PasteScript $ paster create -t django_app django-myapp This will create a directory named ``django-myapp`` with the packaging stuff (setup.py, MANIFEST.in, etc.) and a subdirectory ``myapp`` with a ready to go django's app. Here the generated tree: .. literalinclude:: tree.txt As you can see the template contain a testing project. At this time you can run tests using buildout:: $ python2.5 bootstrap.py -d $ ./bin/buildout $ ./bin/django-test myapp Creating test database 'default'... ... No fixtures found. . ---------------------------------------------------------------------- Ran 1 test in 0.170s OK Destroying test database 'default'... Or launch a dev server inside the testing project:: $ ./bin/django-serve Entry point ----------- If you don't use the template, you just need to add an entry point to your setup.py: .. literalinclude:: django-myapp/setup.py :start-after: Extra requirements And create the corresponding function in ``myapp.__init__.py``: .. literalinclude:: django-myapp/myapp/__init__.py This function instantiate a :class:`~pluggableapp.PluggableApp`. Update a few settings values in place (see API bellow) and return the app. PluggableApp api ---------------- .. automodule:: pluggableapp .. autoclass:: pluggableapp.PluggableApp :members: