Student Information System running on django framework
This project uses pip-tools for dependency management to ensure reproducible builds and better dependency resolution.
requirements/base.in- High-level dependencies (what you want)requirements/base.txt- Compiled dependencies with exact versions (what you get)
pip install pip-toolspip install -r requirements/base.txt- Add the package to
requirements/base.in - Compile the requirements:
pip-compile requirements/base.in
- Install the updated requirements:
pip install -r requirements/base.txt
To update all dependencies to their latest compatible versions:
pip-compile --upgrade requirements/base.in
pip install -r requirements/base.txtTo update a specific package:
pip-compile --upgrade-package django requirements/base.in
pip install -r requirements/base.txt# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements/base.txtThis project uses django-environ for environment variable management. You need to set up environment variables before running the application.
-
Create a
.envfile in theninefruitsdirectory:cd ninefruits touch .env # On Windows: echo. > .env
-
Add the following content to
.env:DJANGO_SECRET_KEY=your-secret-key-here DEBUG=True -
Generate a secure secret key:
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
# On Windows PowerShell:
$env:DJANGO_SECRET_KEY="your-secret-key-here"
$env:DEBUG="True"
# On Windows Command Prompt:
set DJANGO_SECRET_KEY=your-secret-key-here
set DEBUG=True
# On macOS/Linux:
export DJANGO_SECRET_KEY="your-secret-key-here"
export DEBUG="True"This project uses Django with Svelte frontend. The Svelte app is located in the django_svelte directory.
-
Navigate to the Svelte app directory:
cd django_svelte -
Install Node.js dependencies:
npm install
-
Build the Svelte app for production:
npm run build
-
For development with hot reload (optional - for standalone Svelte development):
npm run dev
Note: In this Django-Svelte setup, you typically only need
npm run build. The Django server serves the built Svelte components.
ninefruits-django/
├── ninefruits/ # Django project
│ ├── manage.py
│ └── ninefruits/
│ └── settings.py
├── django_svelte/ # Svelte frontend
│ ├── src/
│ ├── public/
│ │ └── build/ # Built files (generated)
│ └── package.json
└── requirements/ # Python dependencies
- Clone the repository
- Create and activate virtual environment
- Install dependencies:
pip install -r requirements/base.txt - Build Svelte frontend (see above)
- Navigate to Django project:
cd ninefruits - Set up environment variables (see above)
- Run migrations:
python manage.py migrate - Create superuser (optional):
# Interactive creation (recommended): python manage.py createsuperuser # Non-interactive creation (for scripts): python manage.py createsuperuser --username admin --email admin@example.com --noinput python manage.py changepassword admin # Linux Command Prompt: DJANGO_SUPERUSER_PASSWORD=your_password python manage.py createsuperuser --username admin --email admin@example.com --noinput # Windows Command Prompt: set DJANGO_SUPERUSER_PASSWORD=your_password && python manage.py createsuperuser --username admin --email admin@example.com --noinput # Windows Power Shell: $env:DJANGO_SUPERUSER_PASSWORD="your_password"; python manage.py createsuperuser --username admin --email admin@example.com --noinput
- Start development server:
python manage.py runserver