Generating dynamic forms

Before we get to the code, we have to decide on a data format to specify the structure of our dynamic forms. JSON is one of the most popular, if not the most popular, data storage and exchange formats on the web right now. You will probably be aware of what JSON, is and how it works and what it looks like. However, if you're not, here's a quick introduction.

JSON stands for JavaScript Object Notation. It uses the same format that JavaScript uses to declare objects. The biggest benefit for us Python guys is that it is almost exactly the same as the dictionary declaration syntax in Python. Let's say that we want to store some details about a user. In JSON, here is what that information would look like:

{ "name": "Jibran", ...

Get Django Project Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.