GithubHelp home page GithubHelp logo

account_app's Introduction

Account App

Django custom app to handle account functionality in a Django Web Application such as creating users (for Authentication/Authorization) and user-profiles (to stored additional user data and configurations).

Description

This application solves the overhead of having to build a custom django application for account management which uses email/password as authentication factors from scratch, the codebase is constantly updated and improved to fixed known bugs and vulnerability and improve efficiency.

Features

  • ✔ Uses Email for User Authentication
  • ✔ Provides Profile Model which extends the User model to store non-authentication related data
  • ✔ Provides Support Both Vanilla Django (Template system) and Django RestFramework (Rest API)
    • ✔ User authentication and authorization using token-based authentication (Rest API)

Installation and Setup

  1. Clone the repo into a local machine:
    git clone https://github.com/brianobot/account_app.git
    
  2. Rename the repo directory to accounts and move into your Django project base directory (same level as manage.py)
    mv accounts_app accounts
    
  3. Open the Folder (Containing your Django Project) in any IDE of your choice (you can optionally work from Your File Explorer view)
  4. Add the accounts.apps.AccountAppConfig to your list of installed application in your settings.py file
  5. Add the following lines to your project's settings (settings.py)
    AUTH_USER_MODEL = 'accounts.User' 
    
    LOGIN_REDIRECT_URL = "/"
    LOGOUT_REDIRECT_URL = '/' # rethink this process 
    LOGIN_URL = 'accounts:login-account'
  6. Make sure this line is in your accounts __init__.py file
    default_app_config = 'accounts.apps.AccountsConfig'
  7. Make sure this line is in your accounts apps.py file
    class AccountConfig(AppConfig):
        ...
    
        def ready(self):
            import signals
  8. All the following url paths to your project's main url file
    urlpatterns = [
        ...
        path('account/', include('accounts.api.urls'))
        path('account/', include('accounts.page.urls'))
        ...
    ]

Customize as it fits your needs

Api Endpoints

The API has the following endpoints for authentication

  • accounts/api/v1/api-token-auth/: Endpoint for obtaining tokens
  • accounts/api/v1/signup/ : Endpoint for Creating a user instance in the system
  • accounts/api/v1/login/ : Endpoint for Authenicating a user, returns auth token
  • accounts/api/v1/users/ : List all the user currently registered on the system

Contribution

If you come across a piece of code that could benefit from an improvement, document process and reason for improvement, and create a pull request to the original repository

Maintainer

Brian Obot [email protected]

account_app's People

Contributors

brianobot avatar

Stargazers

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