ments.txt file and install everything it requires. Generally you only need to do this once, but if new dependencies are added you will need to re-run pip install -r requirements.txt.
7.2.2 General Configuration
The RiPPLE server will read its configuration from what is called an environment variable. These variables are injected into the application at runtime by replacing reading from os.getenv(). These predefined variables are things such as debug mode and application secrets. Since environment variables can sometimes be sensitive (such as database passwords), it is best practice to keep them out of source control.
RiPPLE reads its environment variables from environment files, which are named .env.dev, and .env.prod for development and production respectively.
In a fresh install, the .env.dev, and .env.prod files will not exist (since they are not in source control). Instead, an .env.example file is provided which has all of the possible environment variable names, and example values for them. If you make your own .env.dev, or .env.prod files, you can place whatever you like in it, and your git client will automatically ignore anything inside of it. Supported environment values include the following:
API_LOCATION - string: A URI which points to the RiPPLE Server. Should not have a trailing ’/’.
DEVELOPMENT_ENVIRONMENT - string: A string indicating the development environment, e.g., (PRODUCTION or DEVELOPMENT)
DJANGO_KEY - string: The SECRET_KEY environment variable required by django. It should be a large unique string
PROXY_LOCATION - string: The subpath of the proxy_pass location if the application is being run through nginx and is not on the root path.
LTI_SUCCESS_REDIRECT - string: URI to redirect to after a successful LTI validation request
LTI_URL - string: URI to use in LTI validation
LTI_APP_KEY - string: Application key to pass to LTI validation service
DATABASE_TYPE - string: Database type to use (e.g., mysql, sqlite3)
DATABASE_NAME - string: Name of database to use
DATABASE_HOST - string: Host of database
DATABASE_USER - string: Username to use when connecting to database
DATABASE_PASSWORD - string: Password to use authenticate with on database
7.2.3 Development Configuration
Typically, a RiPPLE server in development mode will be running on the loopback address of the machine; this is http://localhost:9000 by default.
To initialise your development environment, you have two options: (1) run python manage.py env dev - which will prompt to create a .env.dev if none exists or (2) run cp .env.example .env.dev - which will copy the example configuration into a development file.
Once your environment file has been created and your dependencies installed you will be able to build and test your application. The key command for active development is python manage.py runserver, which builds your application and enables hot-reload.
From a fresh install, the development workflow is typically:
pip install -r requirements.txt - Install project dependencies
cd src - Change to project working directory
CREATE_SCHEMA - If not using sqlite3, then the schema must manually be created
python manage.py migrate - Creates database schema on machine
python manage.py seed - Populates database with values
python manage.py seedCourse –name courseName –course corseCode –file /path/to/JSONfile –host /host/domain - Populates database with values from file
python manage.py runserver - Starts the server
edit files and make changes
Running in unauthenticated mode
If you wish to run the application without authentication, change the ALLOW_UNAUTHENTICATED parameter in src/ripple/settings.py to True. This will disable token verification on login requests, and instead assign the requester a random user token when the /users/login endpoint is accessed. please note that the unauthenticated mode should never be enabled on a live system with real users.
python manage.py test: Runs the application unit tests
python manage.py makemigrations: Reads in all changes from project models and creates migration files from them
python manage.py migrate: Update