Skip to content

Dockerized Django backend serving as a RESTful endpoint

Notifications You must be signed in to change notification settings

mleers/DjangoRestAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django RESTful service

Full stack project using a simple React frontend and Django backend. These components can be ran individually or as a multi-container Docker project.

Features CRUD capabilites using Django backend/builtin database to serve as a RESTful endpoint. Uses the Django Rest Framework

Starting the service

Requisites:

  • python 3.6+ (tested)
  • djangorestframework library pip3 install djangorestframework
  • npm/node
  • Docker desktop (if using Docker deployment)

Locally built:

Windows

Create virtual environment (optional)

  1. python -m venv env
  2. env\Scripts\python.exe -m pip install -r requirements.txt

Start here if skipping virtual env

  1. pip3 install -r requirements.txt
  2. python manage.py runserver
  3. Go to https://localhost:8000/api/ (unless port specified otherwise)

Mac

  1. cd DjangoRestAPI/general_store
  2. python3 manage.py runserver
  3. Go to https://localhost:8000/api/ (unless port specified otherwise)

Accessing the frontend:

  • cd DjangoRestAPI/general_store/frontend
  • npm install
  • npm start
  • Got to https://localhost:3000/ with backend running to see data

Docker

requires docker-compose

  1. docker-compose up from root directory

Tasks:

  • Create catalog of url patterns

  • Achieve CRUD functionality using API decorators (function based)

    • Global Get
    • instance Get
    • instance Post
    • instance Put
    • instance Delete
  • Create data model

  • Serialize data

  • Add superuser

  • Add basic frontend

  • Dockerize project

About

Dockerized Django backend serving as a RESTful endpoint

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published