Follow this instructions to start using dajaxice in your django project.

Installing dajaxice

Add dajaxice in your project inside INSTALLED_APPS:


Ensure that your TEMPLATE_LOADERS, looks like the following. Probably you’ll only need to uncomment the last line.:


Ensure that TEMPLATE_CONTEXT_PROCESSORS has django.core.context_processors.request. Probably you’ll only need to add the last line:


Add dajaxice.finders.DajaxiceFinder to STATICFILES_FINDERS:


Configure dajaxice url

Add the following code inside

from dajaxice.core import dajaxice_autodiscover, dajaxice_config

Add a new line in urlpatterns with this code:

urlpatterns = patterns('',
    url(dajaxice_config.dajaxice_url, include('dajaxice.urls')),

If you aren’t using django.contrib.staticfiles, you should also enable it importing:

from django.contrib.staticfiles.urls import staticfiles_urlpatterns

and adding this line to the bottom of your

urlpatterns += staticfiles_urlpatterns()

Install dajaxice in your templates

Dajaxice needs some JS to work. To include it in your templates, you should load dajaxice_templatetags and use dajaxice_js_import TemplateTag inside your head section. This TemplateTag will print needed js.

{% load dajaxice_templatetags %}

    <title>My base template</title>
    {% dajaxice_js_import %}

This templatetag will include all the js dajaxice needs.

Use Dajaxice!

Now you can create your first ajax function following the Quickstart.