johnny
johnny

Reputation: 19735

Is migration required in a Django application?

I want to use Django with nothing but legacy databases. Lots of them. I want to use raw SQL in my model(s).

Do I need migration to make Django function properly? I don't want to use migration because I don't want Django to do anything with or to my databases. I prefer to use SQL and return data.

Upvotes: 2

Views: 1046

Answers (2)

mipadi
mipadi

Reputation: 410662

No, you don't need to use migrations.

(Also, it may be relevant to note that you can use raw SQL, but Django will still set up some things for you so you can use its ORM, even with legacy databases. But migrations are not one of these things it does for you.)

Upvotes: 2

George Cummins
George Cummins

Reputation: 28906

Migrations are not required. They can be useful for creating and tracking database changes via code, but Django applications will run properly without them.

Upvotes: 2

Related Questions