Code Monkey home page Code Monkey logo

drf_blog_api's Introduction

DRF Blog Api With Otp Authentication

Django Rest Framework

This project is a Blog site written with python3.9 and Django3.2 and Django_rest_framework_3.12 which is for using api.

The purpose of this project was to see how a blog with otp authentication can be implemented using the django-rest-framework.

Features

  • Authentication with phone number and Otp code.
  • Send otp code to user's phone.
  • Two-step verification for authentication.
  • Use cache to temporarily store otp code.
  • Generate tokens using simple-jwt after authentication.
  • Production-ready configuration for Static Files, Database Settings, Gunicorn, Ngnix, Docker.
  • Easy installation.
  • Ability to comment on blogs.
  • Use the PostgreSQL database to store data.

Technologies used

Requirements

install Docker

To run this project, you must install Docker.

and also install docker-compose.

Installation

Clone the project

git clone https://github.com/amirpsd/drf_blog_api.git && cd drf_blog_api && cp .env-sample .env && cp .env.db-example .env.db && rm .env-sample .env.db-example

#f03c15 Please enter the required information in the .env and .env.db files before running the project.

Run project

create docker network

docker network create nginx_network
docker network create blog_network

create docker volume

docker volume create db_data

run project

docker-compose up -d

You currently have 3 containers running:

  • web
  • nginx
  • db

Now create a super user with a web container to access the Django admin panel.

docker exec -it web python3 manage.py createsuperuser

After creating a super user, go to http://127.0.0.1:80/account/api/login/.

And after authentication, create the super user two-step password. http://127.0.0.1:80/account/api/create-two-step-password/

Finally, go to the admin panel. http://127.0.0.1:80/admin/

Endpoints

You can see the endpoints.yaml file to see the exact details of the endpoints.

or you can go to http://127.0.0.1:80/api/schema/swagger-ui/ or http://127.0.0.1:80/api/schema/redoc/ to see the endpoints after running the project.

LICENSE

see the LICENSE file for details.

drf_blog_api's People

Contributors

amirpsd 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.