Editing Django models in the front end¶
I try to take advantage of the powerful Django admin in all my web projects, at least in the beginning.
However, as the project evolves and the frontend improves, the usage of the admin tends to be more and more residual.
Adding editing capabilities to the frontend in a modern user interface requires the usage of modal forms, which, to be honest, have always puzzled me for some reason.
This project is not a reusable Django package, but rather a collection of techniques and examples used to cope with modal popups, form submission and validation via ajax, and best practices to organize the code in an effective way to minimize repetitions.
- Basic modals
- Basic modals with Django
- Modals with simple content
- Form validation in the modal
- Creating and updating a Django Model in the front-end
- Creating and updating a Django Model in the front-end (optimized)
- A fully generic solution for Django models editing in the front-end
- Front-end generic helpers to work with any Model
- Possible enhancements
A sample Django project which uses all the techniques discussed here is available on Github: