- Install Postman
- Open Postman app
- Click Import from the navbar
- The
LearnOps.postman_collection.jsonfile contains the links - You should be prompted to import LearnOps Collection.
- Click the Import button to complete the process.
- Fork this repo to your own Github account.
- Clone it.
cdinto the project directory.- Run
pipenv shellto create a virtual environment.
- Go to your Github account settings
- Open Developer Settings
- Open OAuth Apps
- Click New OAuth App button
- Application name should be Learning Platform
- Homepage URL should be
http://localhost:3000 - Enter a description if you like
- Authorization callback should be
http://localhost:8000/auth/github/callback - Leave Enable Device Flow unchecked
- Create the app and do not close the screen that appears
- Go to Github and click the Generate a new client secret button
- DO NOT CLOSE TAB. CLIENT AND SECRET NEEDED BELOW.
You will need a Django secret key environment variable. Run the following command in your terminal to generate one and save it for later.
python3 -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"Set up the following environment variables anywhere in your shell initialization file (i.e. .bashrc or .zshrc).
export LEARN_OPS_DB=learnopsdev
export LEARN_OPS_USER=learnopsdev
export LEARN_OPS_PASSWORD=DatabasePasswordOfYourChoice
export LEARN_OPS_HOST=127.0.0.1
export LEARN_OPS_PORT=5432
export LEARN_OPS_CLIENT_ID=GithubOAuthAppClientId
export LEARN_OPS_SECRET_KEY=GithubOAuthAppSecret
export LEARN_OPS_DJANGO_SECRET_KEY="GeneratedDjangoSecretKey"
export LEARN_OPS_ALLOWED_HOSTS="127.0.0.1,localhost"
export LEARN_OPS_SUPERUSER_NAME=AdminUsernameOfYourChoice
export LEARN_OPS_SUPERUSER_PASSWORD=AdminPasswordOfYourChoiceThen reload your bash session with source ~/.zshrc if you are using zshell or source ~/.bashrc if you have the default bash environment.
In your Ubuntu terminal run the following command to initiate the installation and configuration of the Learning Platform. It will install the correct version of Python, PostgreSQL and then run migrations to create tables, and finally load fixtures to seed the database with sample data.
If you are on PC:
./linuxInstall-dev.sh -d=$LEARN_OPS_DB \
-u=$LEARN_OPS_USER \
-p=$LEARN_OPS_PASSWORD \
-r=$LEARN_OPS_SUPERUSER_NAME \
-j=$LEARN_OPS_SUPERUSER_PASSWORD \
-c=$LEARN_OPS_CLIENT_ID \
-s=$LEARN_OPS_SECRET_KEYWhen prompted to "remove write-protected regular file './LearningAPI/fixtures/superuser.json'?" type y
If you are on mac:
./macInstall-dev.sh -d=$LEARN_OPS_DB \
-u=$LEARN_OPS_USER \
-p=$LEARN_OPS_PASSWORD \
-r=$LEARN_OPS_SUPERUSER_NAME \
-j=$LEARN_OPS_SUPERUSER_PASSWORD \
-c=$LEARN_OPS_CLIENT_ID \
-s=$LEARN_OPS_SECRET_KEY- Start the API in debug mode in Visual Studio Code.
- Visit http://localhost:8000/admin
- Authenticate with the superuser credentials you created previously and then you can view all kinds of data that is in your database.
- Start the React client application.
- Authorize the client with Github.
- Visit http://localhost:8000/admin and authenticate with your superuser credentials.
- Click on Users in the left navigation.
- Find the account that was just created for your Github authorization by searching for your Github username.
- 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 and authenticate.
- You should now see the instructor interface.