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/activateUpgrade pip to the latest version:
pip install --upgrade pipInstall the required Python packages:
pip install -r requirements.txtInstall 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 postgresqlOpen the PostgreSQL shell:
psql postgresThen, 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 migrateLoad the initial data into the database by executing load_data.sh file:
./load_data.shStart the Django development server:
python manage.py runserverNow, 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 createsuperuserFollow 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