This project is the API for the Learning Platform. It is a Django project using the Django REST Framework application. It integrates with the Github OAuth platform to create accounts and perform authorizations.
Your instructor needs to create a Github Organization and add you as an owner. You will then need the URL to that organization. If that hasn't been done yet, ask your instructor for the URL.
🧨 You must accept the invitation to this organization before continuing.
- Log into your Github account
- Go to your Settings
- Click on the last item on the left navigation labeled Developer Settings
- Click Peronal access tokens
- Click Tokens (classic)
- Click Generate new token dropdown
- Choose Generate new token (classic)
- In the Note field, enter
Learning Platform Token - Set expiration to 90 days
- Choose the following permissions
admin:orgadmin:org_hookrepo
- Click Generate Token button at the bottom and don't close the window as you will need the generated token below
- Make sure you are in the
learningplatformdirectory - Clone this repository
cd learn-ops-api- Copy the environment variable template:
cp .env.template .env
- Open the project in VS Code and open the
.envfile - Set the values of the following environment variables. Do not change the values of the others.
| Key | Value |
|---|---|
| LEARN_OPS_CLIENT_ID | Your instructor will share this value with you |
| LEARN_OPS_SECRET_KEY | Your instructor will share this value with you |
| LEARN_OPS_DJANGO_SECRET_KEY | Create a random string of 20-30 alphanumerical characters (no special characters such as $%@-) |
| LEARN_OPS_SUPERUSER_NAME | Create a simple username (e.g. admin) |
| LEARN_OPS_SUPERUSER_PASSWORD | Create a simple password (e.g. password123) |
| SLACK_TOKEN | Your instructor will share this value with you |
| GITHUB_TOKEN | Your Personal Access Token generated in the previous step |
🧨 Do not continue with these instructions until you have cloned and followed the instructions for the Learning Platform Client and Learning Platform Infrastructure projects. Once those are complete, and the monolith container is running, you can come back here and continue.
- Visit http://localhost:8000/admin
- Authenticate with the superuser credentials you specified in your environment variables above.
- Open a new browser tab
- Visit http://localhost:8000/auth/github/url?cohort=13&v=1
- Authorize with Github
- Go back to the Django Admin browser tab
- Click on Users in the left navigation
- Search for your Github handle
- Click on your user account
- Toggle Staff status to be on
- In the Group sections, double click Instructor so that it moves to the Chosen groups list
- Close the browser tab that is running the Learning Platform
- Open a new tab and visit http://localhost:3000 again
- You should now see the instructor interface