python database / sql programming - where to start

前端 未结 9 2199
闹比i
闹比i 2021-02-02 03:25

What is the best way to use an embedded database, say sqlite in Python:

  1. Should be small footprint. I\'m only needing few thousands records per table. And just a ha
9条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-02 04:05

    start with Django

    http://www.djangoproject.com/

    ORM is the way to go here. You won't regret it. The tutorial here http://docs.djangoproject.com/en/dev/intro/tutorial01/ is fairly gentle.

    Why Django/ORM ? Django will have you up an running in about half an hour, will manage your database connections, data management interfaces, etc. Django works SQLLite: you won't need to manage a MySQL/PostGre instance.

    EDIT1: You don't need to use the web-app portion of Django for this. You can use the db.Model classes to manipulate your data directly. Whatever standalone app/script you will come up with, you can just use the Django data-model layer. And when you decide you want a web front-end, or atleast would like to edit your data via the admin console - you can post back here and thank me ( or everyone that said use an ORM ) :)

提交回复
热议问题