abase
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: Updates the database schema to match the migration definitions
python manage.py seed Seeds the database with mock data
python manage.py env ENV_NAME ENV_NAME must be either ”prod” or ”dev”.It reads in the environment definition from .env.prod or .env.dev respectively, and makes it the active environment
python manage.py runserver: Spawns a webserver on http://localhost:9000 running the application with hot-reload
python manage.py runsslserver: Spawns a HTTPS compatible server on https://localhost:9000 running the application with hot-reload
7.2.4 Production Configuration
Typically, a RiPPLE server in development mode will be running on the loopback address of the machine through the use of a stable webserver (e.g., gunicorn), but with an external web server (e.g., nginx) proxying the request into the loopback adrress.
You will need to initialize your .env.prod environment file to production values, which should be kept secret. An example .env file is provided in the repository (.env.example), but python manage.py env ENV_NAME will also create an .env.current file if none exists.
Ensure that ./src/ripple/settings.py has ALLOW_UNAUTHENTICATED set to False if you are deploying to a live system
To initialise your production environment, you have two options: (1) run python manage.py prod - which will prompt to create a .production.env if none exists amd (2) run cp .env.example .env.prod - 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 production development is sudo -E ./deploy.sh .env.prod, which will deploy your application and run it as a service. Running the application as a service is the best way to ensure it continues to run after an SSH disconnect
RiPPLE is an open-source system - and always will be. Collaboration, improvements, suggestions and pull requests are always welcome. In order to streamline the development process; the following guide exists