Django Northwind is a version of the Microsoft Northwind sample database.
The Northwind database is an excellent tutorial schema for a small-business ERP, with categories, customers, region, territories, employees, shippers, suppliers, products and orders.
others using Django Northwind.
- Diagram:
- northwind/diagram/northwind_diagram.png
- Data:
- Postgres sql script
- Sample data for django
- northwind/fixtures/northwind.json
cd codes
Install the dependencies required by the Python environment. For ubuntu:
sudo apt-get install python-dev python-pip
virtualenv northwind_db
git clone << Repository Url>>
cd django_project
pip install -r requirements.txt
Use the runserver to execute the application:
python manage.py runserver
create the schemas for the databases
python manage.py migrate
python manage.py loaddata northwind/fixtures/northwind.json
For Postgres you need to install psycopg2:
pip install psycopg2==2.7.5
Enter to postgres shell
Create user for Postgres
CREATE ROLE 'DATABASE_NAME' WITH LOGIN ENCRYPTED PASSWORD 'DATABASE_PASSWORD';
Create database for Postgres
CREATE DATABASE 'DATABASE_NAME' WITH OWNER = DATABASE_NAME;
Sample configuration for Postgres settings database
DATABASES = {
'default': {
'ENGINE': os.environ.get('DATABASE_ENGINE', 'django.db.backends.postgresql_psycopg2'),
'NAME': os.environ.get('DATABASE_NAME'),
'USER': os.environ.get('DATABASE_USER'),
'PASSWORD': os.environ.get('DATABASE_PASSWORD'),
'HOST': os.environ.get('DATABASE_HOST'),
'PORT': os.environ.get('DATABASE_PORT'),
}
}