Prepare the Django Project
Setup a fresh Django project
- Install Django. (This is beyond the scope of this document.)
- Create a new Django project.
django-admin.py startproject mydjangoproject
cd mydjangoproject - Configure the settings.py file to point to the PostgreSQL database.
DATABASE_ENGINE = 'postgresql_psycopg2' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'mydatabase' # Or path to database file if using sqlite3. DATABASE_USER = 'myuseraccount' # Not used with sqlite3. DATABASE_PASSWORD = 'mypassword' # Not used with sqlite3.
- Do Django's syncdb so your PostgreSQL database has the Django minimum tables.
python manage.py syncdb
The rest of these commands happen inside the "mydjangoproject" Django project directory.
