Skeleton of web application using Django and AngularJS


What is skeleton?

This is starting point in which few basic functionalities are already implemented and anyone can use this to take it further according to your project's requirement. That means initial efforts can be saved by this any skeleton.

Which technologies are included in this skeleton?

Following technologies are included,

  • Python3 - programming language
  • Django 1.10 - Web application framework
  • Django rest framework - Framework to implement REST APIs supported to Django
  • AngularJS < 2 - Front end javascript MVC framework
  • PostgreSQL - Database server

Features included in this skeleton

Integration

  1. Django Rest Framework, Materialize UI framework and bootstrap is integrated for User interface. However this is for just to show a way how anyone can setup user interface for OPA (One Page Application) with Django framework and AngularJS.

Admin Panel

  1. Admin interface is also made over by Material Design. You can change the color theme by changing configuration in settings.py of project.
  2. Authentication

Custom user model and manager with supporting permission and group both. Following APIs are implemented using Session Authentication.

  • Log in
  • Log out
  • Register User
  • List of users
  • Update user
  • Delete user.

Download code from Github

  1. Download zip using this link
  2. Unzip and change directory to that folder
  3. Replace "skeleton" name by your project code name.
    • ./configure.sh your_project
  4. Delete .git folder to detach from this public repository

Setup your_project to start

1. Download following Linux dependencies

  • python3-dev
  • python-virtualenv
  • python-pip
  • nodejs
  • npm
  • PostgreSQL-server (find appropriate version and change the version number)
sudo apt install -y python3-dev python-virtualenv python-pip nodejs npm PostgreSQL-9.5

2. Create and activate python virtualenv

virtualenv venv -p /usr/bin/python3.5 .
source ./venv/bin/activate

3. Install python packages using requirements

pip install -r requirements.txt

4. Install angular components

sudo ln -sf /usr/bin/nodejs /usr/bin/node
sudo chmod +x /usr/bin/node
sudo npm install -g bower
bower install

5. Setup Database

sudo su postgres
createuser your_project --superuser
createdb your_project -o your_project
psql your_project
\password your_project

CTRL + D

CTRL + D

Note - Password you must enter "your_project123". However you can set any password but if you do then before proceeding to next step you have to change password in to settings.py of project.

6. Migrate Database schmea

python manage.py migrate

7. Run server

python manage.py runserver

I hope you find your initial requirements fulfilled in this skeleton. If you get any kind of error or difficulty please post your query in below comment section.

Thanks.

blog comments powered by Disqus