A Django application with user authentication features, deployed on DigitalOcean App Platform.
- User registration and login
- User profile management
- Dashboard functionality
- PostgreSQL database integration
- Production-ready deployment configuration
- Clone the repository:
git clone https://github.com/ric897/tjdemo.git
cd tjdemo- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Create a
.envfile based on.env.example:
cp .env.example .env- Run migrations:
python manage.py migrate- Create a superuser:
python manage.py createsuperuser- Run the development server:
python manage.py runserverThe application is configured for automatic deployment on DigitalOcean App Platform:
- Repository: https://github.com/ric897/tjdemo
- App Platform URL: https://tjdemo-app-fhlfw.ondigitalocean.app
- Auto-deploy: Enabled on push to main branch
The following environment variables are configured in DigitalOcean App Platform:
DEBUG: Set toFalsefor productionSECRET_KEY: Django secret key (generate a secure one)ALLOWED_HOSTS: App domainDATABASE_URL: Automatically provided by managed databaseDB_*: Database connection details (auto-injected from managed database)
The app uses a managed PostgreSQL database on DigitalOcean:
- Engine: PostgreSQL 15
- Environment: Development (can be upgraded to production)
- Framework: Django 5.2.5
- Database: PostgreSQL (production) / SQLite (development)
- Static Files: WhiteNoise
- Web Server: Gunicorn
- Deployment: DigitalOcean App Platform
- CI/CD: GitHub integration with auto-deploy
tjdemo/
├── authentication/ # Authentication app
│ ├── models.py # Custom User model
│ ├── views.py # Authentication views
│ ├── forms.py # User forms
│ └── templates/ # Authentication templates
├── templates/ # Global templates
├── static/ # Static files (CSS, JS)
├── tjdemo/ # Project settings
│ └── settings.py # Django settings
├── requirements.txt # Python dependencies
├── runtime.txt # Python version
├── Procfile # App Platform process config
└── .env.example # Environment variables template