Git Product home page Git Product logo

quickstart-django-api's Introduction

quickstart-django-api

QuickStartAPI

Technologies Stack.

Features

Getting Started

Ensure you have installed the following:

  • Git
  • Python 3.10.4
  • PostgreSQL 14

Part One: Terminal commands

Clone the repo:

git clone https://git.jambopay.co.ke/ochazima/quickstart-django-api.git

Change directory

cd quickstart-django-api

Part Two: Terminal commands

Enter the postgres Shell:

sudo -u postgres -i psql

Create the database and user as ypu wish to use:

CREATE DATABASE quickstart-django-api;

Create the user:

CREATE USER quickstart-django-api WITH PASSWORD 'quickstart-django-api';

Grant the user access to the database:

GRANT ALL PRIVILEGES ON DATABASE quickstart-django-api TO quickstart-django-api;

Create a .env file under root project directory following the template in example.env

Part Three: Termial commands (Project Setup)

Create virtualenv:

python3 -m venv venv

Activate the virtual environment

source venv/bin/activate

Install the requirements

pip3 install --upgrade pip

pip3 install -r requirements.txt

Run the migrations for postgres

python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py createsuperuser

Run the Application

python3 manage.py runserver

Run the application: PRODUCTION Mode

gunicorn manage:app --worker-class gevent --bind 127.0.0.1:5000 --log-level info

Part Four: Termial commands (Celery Worker Setup)

On a new terminal window activate the preinstalled virtual environment:

source venv/bin/activate

Start the celery workers with command:

celery -A QuickStartAPI worker -l info

Part Five: Termial commands (Flower Celery Worker Monitor Tool)

On a new terminal window activate the preinstalled virtual environment:

source venv/bin/activate

Start the flower monitor with command:

celery -A QuickStartAPI flower --port=5566 -E

Endpoints Documentation are accessible at **http://127.0.0.1:8000/

Used Packages

  • celery==5.2.7
  • Django==4.1.5
  • django-debug-toolbar==3.6.0
  • django-environ==0.9.0
  • django-filter==22.1
  • django-cors-headers==3.13.0
  • djangorestframework==3.14.0
  • djangorestframework_simplejwt==5.2.2
  • django-redis==5.2.0
  • drf-yasg==1.21.4
  • flower==1.2.0
  • psycopg2-binary==2.9.5
  • pytest==7.2.0
  • pytest-cov==4.0.0
  • pytest-django==4.5.2
  • requests==2.28.1
  • sentry-sdk==1.12.1

Documentation

To generate the code documentation run:

make html

You can find the html file to open under docs/build/html/index.html

License

Copyright (c) 2022, Outhan Chazima.

quickstart-django-api's People

Contributors

outhanchazima avatar

Watchers

 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.