On Sat, Dec 6, 2008 at 1:54 AM, Jeff Kowalczyk <[EMAIL PROTECTED]> wrote: > > During early prototyping, I'm relying on specific auth_user content in > the project admin, as my app model use User as a ForeignKeyField. > > Project layout is:myproject/myapp > > Initial SQL myproject/myapp/mymodel/sql/mymodel.sql works fine, and > I'm interested in initial_data.[xml/yaml/json for the same purpose. > > Is there an equivalent location under the project (or app) level for > loading auth_{user,user_user_permissions} data, including the one > superuser I always want configured?
This is one of the use cases that fixture loading was designed for. Put your user and permissions into a fixture called initial_data, and it will be automatically loaded whenever you run syncdb. If you don't want it to be automatically loaded (which is a good idea if you're dealing with passwords), choose another fixture name, and manually load the data using ./manage.py loaddata. http://docs.djangoproject.com/en/dev/howto/initial-data/ http://docs.djangoproject.com/en/dev/topics/serialization/ http://docs.djangoproject.com/en/dev/ref/django-admin/#loaddata-fixture-fixture You can write your fixtures by hand if you want; alternatively, you can use the dumpdata command to dump the current database contents (or part of the database): http://docs.djangoproject.com/en/dev/ref/django-admin/#dumpdata Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---