Adjax is Ajax for Django
Adjax is a small framework to streamline the building of ajax-based sites using the Django web development framework.
The library can be used:
- in Django views to explicitly update html elements, display messages.
- in Django templates to mark values as being updatable
- in unobtrusive Javascript to turn links and forms into ajax request triggers
The gory details
Adjax looks to keep the development of common ajax tasks more organised and clean. As much as possible, ajax functionality is defined in Django views, javascript is kept unobtrusive (defined in linked files) and the developer has full freedom over the HTML produced by the system.
Adjax's mostly attainable goals are:
- Help developers Don't Repeat Themselves
- Provide a straightforward, consistent predictable API
- Automate as much as possible
- Graceful degredation, full functionality without javascript
- Allow developers to define program functionality completely within the view
- Allow developers to easily install completely customised HTML/CSS/javascript
- Allow developers to use different javascript frameworks (ie other than jQuery)
Have a look at the API to see if it implements these goals, and is useful for you.
What else is there
- dajax: A new and comprehensive ajax framework, with more support and maintenance than Adjax currently has. API isn't as clean and straightforward but much better documented, with examples.
- django-ajax-validation: A simple project targetting form validation, and doing it reasonably well and cleanly. Basic documentation (there isn't much to document anyway) and sporatic support.
- Roll your own: In some cases, comprehensive ajax functionality is unnecessary. If you need to update a section of a page, try using an include template and letting your view take an argument to render just the included template instead of the entire page. This is also an especially attractive option if you have specific requirements or don't lie the opinions/design decisions made by the available frameworks (please tell me!).