Thanks, looks like I need to do a second pass at the documentation. ;-)

In my dev environment, I was trying to do a clean/fresh install; including the 
creation of the super user account.
If I don't use syncdb, I should also create the super user account using data 
migration? If so, it seems like I need to go do User.objects.create_superuser().

Thanks!


On Sep 21, 2014, at 6:55 PM, Markus Holtermann <[email protected]> wrote:

> Hey Anil,
> 
> On Sun, Sep 21, 2014 at 05:29:18PM -0700, Anil Jangity wrote:
>> $ python manage.py syncdb
> 
> Just as a side note: "syncdb" is deprecated and is being replaced by
> "migrate".
> 
>> 
>> I have a main/migration/update_site.py:
>> def update_site(apps, schema_editor):
>>   current_site = Site.objects.get_current()
>>   current_site.domain = "example.com"
>>   current_site.name = "Example"
>>   current_site.save()
>> 
>> 
>> class Migration(migrations.Migration):
>> 
>>   operations = [
>>       migrations.RunPython(update_site),
>>   ]
> 
> 
> You are missing a dependency to the sites app in your migration as well
> as to the previous migration in the "main" app. Have a look at
> https://docs.djangoproject.com/en/1.7/topics/migrations/#dependencies
> 
> Adding
> 
> dependencies = [
>     ("main", "whatever_the_name_of_the_previous_migration_is"),
>     ("sites", "0001_initial"),
> ]
> 
> should work.
> 
> I tried to explain the way dependencies in Django's new migration
> framework work in a blog post:
> https://markusholtermann.eu/2014/09/django-17-database-migrations-done-right/#how-do-dependencies-between-migrations-work
> Might be interesting.
> 
> /Markus

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/538B6FC0-500E-4E2D-A3E6-295FBABAEBCF%40me.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to