For Windows, other systems may differ.
- After cloning the repo (eg. git clone REPOHTTPS), cd into the repo using your terminal.
- Create a new python environment in the terminal with: virtualenv env
- Activate the new environment with: source env/Scripts/activate
- Install dependencies automatically from the requirements file: pip install -r requirements.txt
- Create a file called .env inside /GitDjango/GitDjango/
- Copy and paste the following code into the file:
DEBUG=True TEMPLATE_DEBUG=True SECRET_KEY= SOCIAL_AUTH_GITHUB_KEY= SOCIAL_AUTH_GITHUB_SECRET=
- 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())'
- For the GITHUB KEY and SECRET, log into www.github.com and go to: https://github.com/settings/developers
- Click 'OAuth Apps' on the left and then the 'New OAuth App' button on the right
- 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/
- Create it, then on the next page click 'Generate a new client secret'
- After SOCIAL_AUTH_GITHUB_KEY= insert your Client ID, and after SOCIAL_AUTH_GITHUB_SECRET= insert your newly generated Client secret, without any spaces
- In the terminal, with the local python env running, cd into GitDjango/ (where manage.py is)
- Run: python manage.py migrate
- Run: python manage.py runserver
- In your browser go to: http://localhost:8000/
- And finally follow the on-screen login flow! (remember to delete the OAuth app at https://github.com/settings/developers when you are done)