Skip to content

Django and Angular along with workflow tools like npm, gulp, bower, and jade

Notifications You must be signed in to change notification settings

theyoungastros/djangular-boilerplate

Repository files navigation

Djangular Boilerplate

Django and Angular along with workflow tools like npm, gulp, bower, and jade.

Requirements

  • Pip
  • Virtual Env
  • Postgresql
  • NPM
  • Gulp
  • Bower

Install Pip

$ sudo easy_install pip

Install Virtual Env

$ pip install virtualenv

Install Postgresql

http://www.postgresql.org/download/macosx/

  • Download Postgres.app
  • Install and Run

Install NPM

http://nodejs.org/

  • Install

Install Node Dependencies

$ sudo npm install gulp -g
$ sudo npm install bower -g

Project Setup

Create Virtual Environment

$ cd ~/
$ mkdir envs
$ cd envs
virtualenv __ProjectName__
$ cd __ProjectName__

Clone Repo into ~/envs/ProjectName/app

$ cd ~/envs/
$ mkdir __ProjectName__
$ cd __ProjectName__
$ git clone https://github.com/theyoungastros/djangular-boilerplate app

Frontend Setup

$ cd ~/envs/__ProjectName__/app
$ npm install
$ bower install
$ gulp build

Setup Database

Configure Local Settings

$ vi ~/envs/__ProjectName__/app/root/settings.py

Replace database settings with the following:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'DATABASE_NAME',
        'USER': '*YOUR_USERNAME*',
        'PASSWORD': '',
        'HOST': 'localhost',
        'PORT': '5432',
    },
}

Edit ~/envs/ProjectName/bin/activate

Replace the following:

PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH

with:

PATH="$VIRTUAL_ENV/bin:$PATH"
PATH="/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH"
export PATH

Migrate DB & Run Server

$ cd ~/envs/__ProjectName__/
$ source bin/activate
$ cd app
$ pip install -r requirements.txt
$ psql 
$ > create database DATABASE_NAME;
$ > \q
$ python app/manage.py migrate
$ python app/manage.py createsuperuser

# follow prompts
$ python app/manage.py runserver

http://localhost:8000/admin

About

Django and Angular along with workflow tools like npm, gulp, bower, and jade

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published