Thanks Russell, that's clear now.

Cheers,
Dan


在 2015年3月20日星期五 UTC-5下午6:27:12,Russell Keith-Magee写道:
>
>
> On Sat, Mar 21, 2015 at 5:25 AM, Dan Dong <dong...@gmail.com <javascript:>
> > wrote:
>
>> Hi,
>>   Does anybody know how to supply the input parameters to "python 
>> manage.py syncdb" from a script? E.g, to set the the followings parameters:
>>
>> Would you like to create one now? (yes/no): yes
>> Username (leave blank to use 'root'): 
>> Email address: xxxxxxxxx
>> Password: xxxxxx
>> Password (again): xxxxxx
>>
>> You don't - and that's by design.
>
> If you're putting a password into a script, then that script is in plain 
> text, and so is your password - so you've just lost your security.
>
> So - you don't pass input parameters to the script. You run the script 
> with the --noinput flag, which will prevent the script from prompting for 
> user input.
>
> If you want to have an initial user in your database after syncdb, put 
> that user's data in a fixture, and load the fixture as part of the script. 
> The fixture will contain the password in a hashed format, so the password 
> will be protected.
>
> Yours,
> Russ Magee %-)
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/e12b2f3a-05c5-4c33-bcfd-5c6a8c6c9d1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to