Hide
Hide

Reputation: 3317

Django ORM between MySQL and PostgreSQL

I'm learning some django lecture that used postgresql database.

But I am familiar with MySQL so I want to use mysql.

I heard that Django ORM automatically convert command to query.(So user do not have to know exact database query)

I want to know that, Can I use mysql instead of postgresql in this lecture?

Any problem with this?

Upvotes: 0

Views: 1039

Answers (1)

karthikr
karthikr

Reputation: 99660

Django's ORM by default supports

  • PostgreSQL
  • MySQL
  • SQLite
  • Oracle

with the right bindings.

You would require psycopg2 in order for the postgres connections to work. Once the setup is complete, the ORM can convert from model based queries to raw sql. You can inspect that using the .query on the queryset. Note that this also implies the ORM can support some of the advanced features of postgresql

Upvotes: 1

Related Questions