O'Reilly logo

Django Unleashed by Andrew Pinkham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

22.4 Data Migrations

When we erased our database, we removed all of the users we had previously added. I’m lazy, and if I know I need those users on my website, I am loathe to create them again every time. I’m therefore going to create a data migration to create basic user accounts.

Please take a moment to consider that what I am doing is a huge security risk. If this code is available publicly (it is) or unchanged at production (https://site.django-unleashed.com does not have these users), then these accounts are attack vectors and provide the bad people and bad robots with access to our website. In a normal website, you probably don’t want to do what I am about to. However, this website isn’t really a production website—it’s a website to learn ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required