From SQL to Django models’ apps

This example demonstrates how to start from a raw database and end up with the forms to manage it in few steps.


This examples is based on the code available at the folder tutorials/tutorial_advance_db

First of all start your django project:

> django-admin startproject tutorial_advance_db

Configure your django app file to point your database and include the pyforms configurations.






Enter in the project folder and create the tutorial app:

> cd tutorial_advance_db
> mkdir tutorial

Generate the Django models from your SQL database.

> python inspectdb > tutorial/

Generate the Pyforms apps to manage the models by executing the next command:

> python export_pyforms_apps tutorial

Run migrations and execute the django project:

> python migrate
> python runserver