Auto Generate Django Models
By Justin

Learn how to take a scraped dataset and turn it into Django models using inspectdb. You can also use this method for legacy databases.
We'll use:
- Django (v2.2+)
- Jupyter
- SQLAlchemy
- Pandas
- sqlite3
- Python (v3+)
You can use this method to convert SQLAlchemy-managed models into Django-managed models as well.
Tutorial
How to use (after watching tutorial):
- Download / Clone this Repo
- Activate a virtual environment python3 -m venv .
- Run pip install -r requirements.txt
- Run jupyter notebook
- Navigate to nbs/ and open Autogen_Final.ipynb
- Run All Cells
- Update models.py as you need related to the python manage.py inspectdb --database lite command.
If you get a import error related to django, just do steps 2-4 in a new terminal / powershell.