Skip to content

Latest commit

 

History

History
69 lines (49 loc) · 2.07 KB

README.md

File metadata and controls

69 lines (49 loc) · 2.07 KB

Django

This is a boilerplae for create a django project using rest framework. Currently uses local user login, but is setup to support 3rd party sso.

Quick Links

Technologies used

Setup

  1. Create a .env in the root backend folder with the following content:

    DJANGO_SECRET_KEY="super-secret-value-here"
    DATABASE_URL="postgresql://USER:PASS@HOST:5432/DB_NAME"
  2. Setup the virtual environment

    Poetry docs: https://python-poetry.org/docs/

    # Install packages and enter venv
    poetry shell
    poetry install
  3. Prepare the server

    # Run migrations
    python manage.py migrate
    
    # Create a superuser
    python manage.py createsuperuser
    
    # Run the server
    python manage.py runserver
  4. Access the admin at http://127.0.0.1:8000/admin/

    1. On the main "Dashboard", under "Django OAuth Toolkit", click "Applications"
    2. Create a new application by clicking the plus in the top right
    3. Copy the client id & secret, they will get used when setting up the frontend app
    4. Fill in the form with the following values:
      • Client type: Confidential
      • Authorization grant type: Resource owner password-based
      • Name: anything you want
    5. Save the application
  5. Setup the frontend at frontend/README.md