Get Up and Running Fast
This guide will get you from zero to a running Maths Society Platform in minimal steps. Perfect for trying out the platform or starting local development.Prerequisites
Before you begin, ensure you have:Python 3.8+
Check with
python --version or python3 --versionpip
Python package installer (usually included with Python)
Git
For cloning the repository
PostgreSQL (Optional)
SQLite works for quick testing, PostgreSQL recommended for development
Quick Setup
Create Virtual Environment
Create and activate a Python virtual environment:You should see
(venv) in your terminal prompt when the environment is activated.Install Dependencies
Install all required Python packages:This installs:
- Flask 2.1.0 and extensions
- SQLAlchemy 1.4.31
- PostgreSQL driver (psycopg2)
- CKEditor, WTForms, and other dependencies
Installation may take 1-2 minutes depending on your connection speed.
Configure Environment
Create a
.env file in the project root with basic configuration:.env
Using PostgreSQL Instead (Recommended)
Using PostgreSQL Instead (Recommended)
If you prefer PostgreSQL (recommended for closer-to-production development):Make sure PostgreSQL is running and the database exists:
.env
Initialize the Database
Set up the database schema and create a default admin user:The
init_db.py script:- Creates all database tables
- Creates a default admin user
- Seeds initial data for testing
Default admin credentials:
- Username:
admin - Password:
admin123
Run the Application
Start the Flask development server:You should see output like:
Your Maths Society Platform is now running! Open http://127.0.0.1:5000 in your browser.
Verify Installation
Test that everything is working correctly:Access the Homepage
Navigate to http://127.0.0.1:5000 - you should see the Maths Society homepage
Application Structure
Here’s what you’ve just set up:run.py
app/__init__.py:
app/__init__.py (simplified)
Next Steps
Explore Features
- Create challenges
- Set up a competition
- Write articles and newsletters
- Customize the platform
Development Tips
- Run tests with
pytest - Enable debug mode for development
- Use Flask-Migrate for schema changes
- Check logs in
app.log
Configuration
- Review
config.pyfor settings - Configure email notifications
- Set up rate limiting
- Customize CSP policies
Production Deployment
- Read the Installation Guide
- Set up PostgreSQL
- Configure Gunicorn
- Deploy with proper secrets
Common Issues
Port 5000 Already in Use
Port 5000 Already in Use
If port 5000 is occupied, you can change it in Or set the
run.py:run.py
FLASK_RUN_PORT environment variable.Database Connection Error
Database Connection Error
If using PostgreSQL and seeing connection errors:
- Verify PostgreSQL is running:
pg_isready - Check database exists:
psql -l | grep mathsoc - Verify credentials in
.envfile - Try SQLite instead by setting
DATABASE_TYPE=sqlite
Import Errors or Missing Modules
Import Errors or Missing Modules
If you see
ModuleNotFoundError:- Ensure virtual environment is activated (look for
(venv)in prompt) - Reinstall dependencies:
pip install -r requirements.txt - Try upgrading pip:
pip install --upgrade pip
Template or Static Files Not Loading
Template or Static Files Not Loading
If CSS/images aren’t loading:
- Check Flask is serving from the correct directory
- Verify
app/staticdirectory exists - Clear browser cache
- Check browser console for CSP errors
Development Workflow
For ongoing development:Getting Help
Need assistance?- Check the Installation Guide for detailed configuration
- Review the Configuration Reference for all available settings
- Explore the API Documentation for integration details
- Visit the GitHub repository for issue tracking and community support
Congratulations! You now have a working Maths Society Platform. Start exploring the admin panel to create challenges and customize your platform.