Skip to main content

Rendering helpers for AJAX enabled views

Project description

A few little helpers.

Instead of this:

def view(request):
    context_dict = {'items': MyModel.objects.all()}
    return render(request, "template.html", context_dict)

Use this:

from ajaxify import render_ajax

def view(request):
    context_dict = {'items': MyModel.objects.all()}
    return render_ajax(request, "template.html", template_fragment.html", context_dict)

Now if your view is responding to AJAX requests it will respond with only the generated fragment.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-ajaxify, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size django-ajaxify-0.0.1.tar.gz (1.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page