Welcome to the Guide! It provides step-by-step instructions on how to set up, configure, and run this application.
-
Create a project directory to hold the codebase:
mkdir glider_web_app #Just for your reference, you can name it anything you want. cd glider_web_app
-
Download (Clone) the application code from GitHub:
git clone https://github.com/OSUGliders/gliderweb.git
-
Install Python tools required to create an isolated "Virtual Environment". A virtual environment keeps our app's dependencies organized and prevents conflicts with other system software.
sudo apt update sudo apt install python3.13-venv
-
Create and activate the virtual environment:
python3 -m venv "v_env" #Just for your reference, you can name it anything you want. source v_env/bin/activate
(You should now see
(v_env)at the beginning of your terminal prompt). -
Navigate into the project folder and install all necessary software packages:
cd TrackMultipleGliders pip install --upgrade pip #Upgrade the current version of pip to the latest stable version pip install -r requirements.txt #To install all the required packages. pip install psycopg #To install the PostgreSQL adapter for Python.
-
Install PostgreSQL:
sudo apt update #Update the package list sudo apt install postgresql postgresql-contrib -
Verify Installation: Confirm the installation was successful:
dpkg -l | grep postgresql -
Manage the Database Service: Start the service and check its status to ensure it is actively running:
sudo systemctl start postgresql sudo systemctl status postgresql
-
Initialize Database and User Credentials: Enter the PostgreSQL interactive terminal:
sudo -u postgres psql
At the
postgres=#prompt, run the following SQL commands to securely provision your application's database. *CREATE USER "username" WITH PASSWORD "password"; CREATE DATABASE "database_name"; GRANT ALL PRIVILEGES ON DATABASE "database_name" TO "username";
-
Verify the Database Connection: Test accessing the database using our newly created credentials:
psql -U "username" -d "database_name"
Type
\l(backslash + lowercase L) to list all databases and verify the database is present. -
Troubleshooting Database Access: Only if the database connection fails, manually reset the schema ownership:
sudo -u postgres psql -d "database_name"Drop and recreate the public schema:
DROP SCHEMA public CASCADE; CREATE SCHEMA public AUTHORIZATION "username";
Use .env.example as a template (which is present inside the gliderweb repo) and store actual values in a new .env file.
(You can also use the copyable template provided in Step 2 below).
- Copy template to active file:
cp .env.example .env nano .env
- Add your server configuration variables (replace placeholder values with your actual values):
SECRET_KEY="your_django_secret_key" # Use True for local development; set False in production DEBUG=True DB_NAME="database_name" DB_USER="username" DB_PASSWORD="password" # Database host DB_HOST="localhost" # Example for production domain GLIDER_HOST_DOMAIN="glider.example.com" # Default PostgreSQL port DB_PORT="5432"
- Save the file and exit (Ctrl + O, Enter, then Ctrl + X).