Skip to main content

Django Ajax base view

Project description

Django Ajax View

Simple Django library for quickly using Ajax calls in regular views.

For example, suppose you have a regular TemplateView in Django, which you want to add Ajax interactivity to. Simply add an @ajax method to your controller, and it becomes accessible in the HTML template side as a function:

class MyController(AjaxView):
    ...

    @ajax
    def greetings(self, name):
        return f'Why hello there, {name}!'

Inside the rendered HTML:

const message = await greetings({name: 'Ken'})

See documentation for details. Licensed under MIT.

Project details


Download files

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

Source Distribution

django-ajaxview-1.0.6.tar.gz (27.8 kB view details)

Uploaded Source

File details

Details for the file django-ajaxview-1.0.6.tar.gz.

File metadata

  • Download URL: django-ajaxview-1.0.6.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for django-ajaxview-1.0.6.tar.gz
Algorithm Hash digest
SHA256 f05675453917dd823d2e86f154601a78f03abe3fa31d460d813e52cbfa5df88f
MD5 7b85624619062e01dac66eec2b990e7c
BLAKE2b-256 101bd91fc1b46c66baf12925cfb9f81c1250569a1e31c8777234e33a2952b611

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page