[Answer]-Django and external sqlite db driven by python script

1👍

If you care about taking control over every single aspect of how you want to render your data in HTML and serve it to others, Then for sure Django is a great tool to solve your problem.

Django’s ORM models make it easier for you to read and write to your database, and they’re database-agnostic. Which means that you can reuse the same code with a different database (like MySQL) in the future.

So, to wrap it up. If you’re planning to do more development in the future, then use Django. If you only care about creating these HTML pages once and for all, then don’t.

PS: With Django, you can easily integrate these scripts into your Django project as management commands, run them with cronjobs and integrate everything you develop together with a unified data access layer.

👤Emam

0👍

Django can use different databases, sqlite is the easiest one to setup since python standard library comes with everything it needs for sqlite, while you generally need separate software to setup other databases. That’s why it’s used in the tutorial.

Django core itself does not require a database. You can setup a django based site without a database. However many of the modules like the authentication module does require database setup.

You don’t have to write models, you can create a connection with DBAPI or other database drivers directly inside django. Of course, this means that parts of the framework that integrates with the ORM wouldn’t be aware of the database connection you create yourself, like the Form class, the generic view, or the automatic admin view, so you’ll be missing these features that makes Django very powerful framework.

You can create unmanaged models to allow many parts of django to be aware of your existing database and utilize Django’s more advanced features with your existing database. See https://docs.djangoproject.com/en/dev/howto/legacy-databases/

Leave a comment