A Django REST Framework backend for the Laango project.
- Twilio is set up. Need to accept incoming text messages and update job assignment and status.
- Live demo is available here. Use sample_user and sample_password as the login credentials, which should grant you read-only access to view functionality.
- Django 5.2.8
- Django REST Framework for API development
- CORS headers support for frontend integration
- Environment-based configuration using python-decouple
- SQLite database (easily configurable to PostgreSQL/MySQL)
- Python 3.11 or higher
- pip (Python package manager)
git clone <repository-url>
cd laango_backendpython3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtCopy the example environment file and update it with your settings:
cp .env.example .envEdit .env and update the following variables:
SECRET_KEY: Django secret key (generate a new one for production)DEBUG: Set toFalsein productionALLOWED_HOSTS: Add your domain namesCORS_ALLOWED_ORIGINS: Add your frontend URLs
python manage.py migratepython manage.py createsuperuserpython manage.py runserverThe API will be available at http://localhost:8000/
-
URL:
/api/health/ -
Method:
GET -
Description: Check if the API is running
-
Response:
{ "status": "ok", "message": "Laango API is running" }
- URL:
/admin/ - Description: Django admin interface
laango_backend/
├── api/ # Main API application
│ ├── views.py # API views
│ ├── urls.py # API URL routing
│ ├── models.py # Database models
│ └── serializers.py # DRF serializers
├── laango/ # Django project settings
│ ├── settings.py # Project settings
│ ├── urls.py # Main URL configuration
│ └── wsgi.py # WSGI configuration
├── manage.py # Django management script
├── requirements.txt # Python dependencies
├── .env # Environment variables (not in git)
└── .env.example # Example environment file
python manage.py startapp app_nameDon't forget to add it to INSTALLED_APPS in laango/settings.py
python manage.py makemigrations
python manage.py migratepython manage.py test| Variable | Description | Default |
|---|---|---|
SECRET_KEY |
Django secret key | Auto-generated |
DEBUG |
Debug mode | True |
ALLOWED_HOSTS |
Allowed host names | localhost,127.0.0.1 |
CORS_ALLOWED_ORIGINS |
CORS allowed origins | http://localhost:3000,http://localhost:5173 |
For production deployment:
- Set
DEBUG=Falsein.env - Update
SECRET_KEYwith a strong secret key - Configure
ALLOWED_HOSTSwith your domain - Set up a production database (PostgreSQL recommended)
- Configure static files serving
- Use a production WSGI server (gunicorn, uWSGI)
- Set up HTTPS
See LICENSE file for details.