Skip to main content

Posts

Showing posts with the label developer

Django: How and why to use migrations. Django-South.

Hi there guys and we're here to talk about migrations today. My app grown to complex app with profiles, social registration permits and so on. First time I've decided to make myself a simple app. Now it became complex enough and contains enough code to need code comments :). Anyway Migrations is a process anybody someday will need. I thought it's hard to learn or understand, but it's not. Main point is that you: - save your current database tables structure - change your model tables - scan for differences and create script - then write changes to your database with automatically generated python script. Sound's simple? I't not all so simple in fact. App that you need to learn is Django-south . Its main objectives are to provide a simple, stable and database-independent migration layer to prevent all the hassle schema changes over time bring to your Django applications. It has quite understandable tutorial here . So if you're tired of ALTER'in...