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.
- Download / Clone this Repo
- Activate a virtual environment
python3 -m venv .
- Run
pip install -r requirements.txt
- Run
jupyter notebook
- Navigate to
nbs/
and openAutogen_Final.ipynb
- Run All Cells
- Update
models.py
as you need related to thepython 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.