O'Reilly logo

Django Project Blueprints by Asad Jibran Ahmed

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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", ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required