You just installed Django's auth system, which means you don't have any superusers defined. Would you like to create one now? (yes/no): yes Username (leave blank to use 'XXX'): admin Email address: admin Error: Enter a valid email address. Email address: XXX@company.com Password: Password (again): Superuser created successfully. Installing custom SQL ... Installing indexes ... Installed 0 object(s) from 0 fixture(s)
The syncdb command looks at the INSTALLED_APPS setting and creates any necessary database tables according to the database settings in your mysite/settings.py file. You’ll see a message for each database table it creates, and you’ll get a prompt asking you if you’d like to create a superuser account for the authentication system. Go ahead and do that.
6. Use your own models to create MySQL tables
Notice that Django cannot create a database for you, but tables only, so we need to create a DB directly in MySQL first.
mysql -u root -p password: CREATE DATABASE mysite_db; USE mysite_db;
Create an app with Django:
python manage.py startapp myapp
This command would create a directory myapp under the root container, at the same level with manage.py: