Code Monkey home page Code Monkey logo

django_rest's Introduction

Django Restful API For Custom Authentication

Django restful api login with Email and Mobile no. In this we get custom created authentication system. We can register with our mobile or email after register verification OTP sent to email and mobile. Both email and mobile has different OTP. so when user input the OTP from email then email verified and if OTP input from mobile then mobile varified. User also sent the resent OTP if mail or SMS not found.

Docs

https://github.com/harryanand060/django_rest/wiki

Branch

development:

compatible with >=django 3.0

Master:

compatible with django2.0

django_v3:

compatible with >=django3.0

Installation

  1. Download or clone project from git.

    for WINDOWS Install Git Bash

    https://git-scm.com/downloads

    after install the Git Bash

    git clone https://github.com/harryanand060/django_rest.git

  2. Create project with virtual environment also install pip pip.

  3. Install prerequisites

       pip isntall -r requirement.txt

(after coping the project to your directory where you create projcet).

  1. Inside app we have .env.test rename to .env and then update

    Generate SECRET_KEY

    python manage.py generate_key -sp -d app

    Database Settings

     DATABASE_NAME=db_name
     DATABASE_USER=root
     DATABASE_PASSWORD=
     DATABASE_HOST=localhost
    

    EMAIL Setting

    EMAIL_HOST_USER = '***@gmail.com' EMAIL_HOST_PASSWORD = ''.

    SMS Getway Setting

    'url': 'http://sms.abc.com/sendSMS', 'apikey': '**********************', 'username': '', 'sendername': '', 'smstype': '********'.

  2. now open terminal and path set to your current project and run

        python manage.py makemigrations
        python manage.py migrate
  3. now create super user

    ```bash
         python manage.py createsuperuser
    ```
    

    and follow the steps.

  4. now Run

        python manage.py runserver

#Testing

img.png

Open the browser with given runserver IP for ex: http://127.0.0.1:8000/ Here you get all the listed API Docs

django_rest's People

Contributors

dependabot[bot] avatar harryanand060 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

django_rest's Issues

custom gateway and option to login with either email or phone number

Great work with this project.

I have a few questions; how i go about sending the generated otp in the register class to the mobile number via a custom sms gateway (a snippet would help) like the doc included below and secondly, i can see there is an option if user verified otp with email, the user can only use email to login afterwards, can that be made to allow any of them after otp verification.
MultiTexter_HTTP_SMS_API 2.0.pdf

reset password

I commend your effort in this project and noticed there is no reset password serializer and view for the account app. What will be your thought process in implementing this feature. @harryanand060

otp invalid

I kept getting "invalid otp" despite entering the correct otp sent to my mail
[
{
"status": false,
"data": null,
"message": "invalid otp",
"status_code": 401
},
401
]

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.