Giter Site home page Giter Site logo

django-api-template's Introduction

Django API logo

Django REST API Template

Django REST API Template for Github Projects

Using Demo API Server

# Clone repo
git clone https://github.com/nikhiljohn10/django-api-template.git

# Run demo server
cd django-api-template && . app/bin/install && api demo

Demo username: admin

Demo password: @dmin1234

Demo url: http://localhost:8000/

Developing

With 'Use this template' button on Github, you can create a new repo in your profile with this project as template. This method is suggested if you only wish to use the template.

Fork the repo for contributing to this repo

# Dependencies for postgresql client (Only needed if it is enabled)
sudo apt update && sudo apt upgrade -y && sudo apt autoremove
sudo apt install -y libpq-dev python3-dev

# Clone repo using one of the three methods below
git clone [email protected]:nikhiljohn10/django-api-template.git
gh repo clone nikhiljohn10/django-api-template
cd django-api-template

# Change branch
git checkout develop

# Installing API manager
. app/bin/install

# To run development server
api setup
api user yourname [email protected]
api run

API Manager Commands

Use cd command to change to project top-level directory before using the following commands.

  • Install - . app/bin/install
  • Reactivate - apim
  • Uninstall - apim-uninstall

Note: API Manage only exist inside your currect terminal session. If you close the terminal after installation, you need to run install command again to reactivate the virtual environment.

API Manager Usage

Usage: $ api OPTION

OPTIONS:

    -c | clean        : Clean up project to start fresh
    -i | install      : Install python dependencies
    -m | migrate      : Migrate database
    -o | demo         : Load demo data in to database
    -s | setup        : Initialise and configure API server
    -u | user [U] [E] : Add superuser with U:username and E:email as arguments
    -r | run          : Run development API server
    -d | deploy       : Deploy API server using gunicorn
    -h | help         : Display help
    -x | exit         : Exit API Manager

Note: Above commands will only work if API manager is active inside the top-level directory (Here it is django-api-template). For example, the prompt will say (API) django-api-template$ is API manager is active inside your project folder.

Docker

  • start_psql : Deploy postgresql standalone docker container
  • stop_psql : Stop postgresql container
  • kill_psql : Remove postgresql container

Contribute

Check out CONTRIBUTING.md for information about getting involved.

Code of Conduct

Everyone interacting in the this project's codebases, issue trackers, etc are expected to follow the Code of Conduct.

License

This project is licensed under MIT License

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.