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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access