from django.conf import settings
from django.core.management.commands import syncdb
opts, args = build_configuration()
my_app = 'fooapp'
settings.configure(
DATABASE_ENGINE=opts['db_engine'],
DATABASE_NAME=opts['db_name'],
DATABASE_USER=opts['db_user'],
DATABASE_PASSWORD=opts['db_pass'],
DATABASE_HOST=opts['db_host'],
DATABASE_PORT=opts['db_port'],
INSTALLED_APPS=(my_app,)
)
cmd = syncdb.Command()
cmd.handle_noargs()
And do let me know if that works. Thanks!
2 comments:
I misspelled optparse.
As you're using Blogger, you can just edit your post even after it's published to correct spelling etc.
Post a Comment