Code Monkey home page Code Monkey logo

django_northwind's Introduction

Django Northwind

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.

Practice with different schemas like SqLite, MySql, Postgres or

others using Django Northwind.

Files

  • Diagram:
    • northwind/diagram/northwind_diagram.png
  • Data:
    • Postgres sql script
    • Sample data for django
      • northwind/fixtures/northwind.json

How to use

Choose the folder that you are going to use

cd codes

Python

Install the dependencies required by the Python environment. For ubuntu:

sudo apt-get install python-dev python-pip

Create the virtualenv. Remember to use python 3

virtualenv northwind_db

Clone Repository

git clone << Repository Url>>

Change the working directory to the repository

cd django_project

Install requirements. Remember to activate the virtual environment.

pip install -r requirements.txt

Runserver

Use the runserver to execute the application:

python manage.py runserver

After choosing the database in settings.py

create the schemas for the databases

python manage.py migrate

Populate the database with the sample data

python manage.py loaddata northwind/fixtures/northwind.json

Notes for Postgres

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'),
    }
}

django_northwind's People

Contributors

samgca avatar samuelgarcia-natgeo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.