MathApp is a Django-based web application that provides math learning materials for high school. It uses a PostgreSQL database for data storage.
mathapp_demo.mp4
Follow these steps to set up and run MathApp locally:
Create a new virtual environment using Python 3.10:
python3.10 -m venv venv/
Activate the newly created virtual environment:
source venv/bin/activate
Upgrade pip to the latest version:
pip install --upgrade pip
Install the required Python packages:
pip install -r requirements.txt
Install and start PostgreSQL version 14 in your operating system.
For Mac:
- Install using Homebrew:
brew install postgresql@14
- Start the PostgreSQL service:
brew services start postgresql
Open the PostgreSQL shell:
psql postgres
Then, create a new role named mathapp
with login privileges and a password of mathapp
:
CREATE ROLE mathapp WITH LOGIN PASSWORD 'mathapp';
Apply the Django migrations to set up your database schema:
python manage.py migrate
Load the initial data into the database by executing load_data.sh
file:
./load_data.sh
Start the Django development server:
python manage.py runserver
Now, you should be able to access the MathApp application by navigating to http://localhost:8000 in your web browser.
To register a new user, navigate to http://localhost:8000 and follow the registration prompts.
To access the Django admin interface, you first need to create a superuser account:
python manage.py createsuperuser
Follow the prompts to enter your desired username, email address, and password. After creating the superuser account, you can access the admin interface by navigating to `http://localhost:8000/admin