Prerequisites
Before setting up the SASCOP BME SubTec project, ensure you have the following installed:PostgreSQL 12+
Install PostgreSQL database server. The project uses PostgreSQL as its primary database.
Installation Steps
Install Dependencies
Install all required Python packages from requirements.txt:
This will install Django 4.2.7 and all other dependencies including PostgreSQL drivers, PDF generation libraries, and data processing tools.
Configure Environment Variables
Create a Add the following environment variables (see Environment Variables for complete list):
.env file in the project root directory:.env
Create Superuser
Create an admin user to access the Django admin panel:Follow the prompts to set username, email, and password.
Verify Installation
Run the development server to verify everything is set up correctly:http://localhost:8000 in your browser. You should see the SASCOP application.
The default port is 8000. To use a different port, specify it:
python manage.py runserver 8080Key Dependencies
The project uses the following major dependencies:| Package | Version | Purpose |
|---|---|---|
| Django | 4.2.7 | Web framework |
| psycopg2-binary | 2.9.7 | PostgreSQL adapter |
| gunicorn | 21.2.0 | WSGI HTTP server |
| whitenoise | 6.4.0 | Static file serving |
| reportlab | 4.0.4 | PDF generation |
| pandas | 2.3.3 | Data analysis |
| matplotlib | 3.10.8 | Chart generation |
| openpyxl | 3.1.5 | Excel file handling |
| django-anymail | 14.0 | Email backend |
requirements.txt.
Troubleshooting
PostgreSQL Connection Issues
If you encounter database connection errors:-
Verify PostgreSQL is running:
-
Check your database credentials in
.env -
Ensure the database exists:
Permission Errors
If you get permission errors during installation:Port Already in Use
If port 8000 is already in use:Next Steps
Database Configuration
Learn about database settings and configuration options
Running Locally
Start developing with the local development server