rimichaeru / gitdjango

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitDjango

Setup

For Windows, other systems may differ.


Create the virtual environment & install dependencies

  1. After cloning the repo (eg. git clone REPOHTTPS), cd into the repo using your terminal.
  2. Create a new python environment in the terminal with: virtualenv env
  3. Activate the new environment with: source env/Scripts/activate
  4. Install dependencies automatically from the requirements file: pip install -r requirements.txt

Set up environment variables (SECRETS)

  1. Create a file called .env inside /GitDjango/GitDjango/
  2. Copy and paste the following code into the file:
    DEBUG=True
    TEMPLATE_DEBUG=True
    SECRET_KEY=
    SOCIAL_AUTH_GITHUB_KEY=
    SOCIAL_AUTH_GITHUB_SECRET=
    
  3. In terminal (with the python environment running) run the following and paste the result after SECRET_KEY= without spaces:
python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'
  1. For the GITHUB KEY and SECRET, log into www.github.com and go to: https://github.com/settings/developers
  2. Click 'OAuth Apps' on the left and then the 'New OAuth App' button on the right
  3. Enter the following:
Application name: Can be anything, eg. Test Git Django App
Homepage URL: http://localhost:8000/
Application description: Anything or blank, eg. Lee-Michael Git Django Test
Authorization callback URL: http://localhost:8000/
  1. Create it, then on the next page click 'Generate a new client secret'
  2. After SOCIAL_AUTH_GITHUB_KEY= insert your Client ID, and after SOCIAL_AUTH_GITHUB_SECRET= insert your newly generated Client secret, without any spaces

Running the server

  1. In the terminal, with the local python env running, cd into GitDjango/ (where manage.py is)
  2. Run: python manage.py migrate
  3. Run: python manage.py runserver
  4. In your browser go to: http://localhost:8000/
  5. And finally follow the on-screen login flow! (remember to delete the OAuth app at https://github.com/settings/developers when you are done)

About


Languages

Language:Python 83.5%Language:HTML 16.5%