Skip to content

Repository files navigation

TJ Demo - Django Authentication App

A Django application with user authentication features, deployed on DigitalOcean App Platform.

Features

  • User registration and login
  • User profile management
  • Dashboard functionality
  • PostgreSQL database integration
  • Production-ready deployment configuration

Local Development

  1. Clone the repository:
git clone https://github.com/ric897/tjdemo.git
cd tjdemo
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file based on .env.example:
cp .env.example .env
  1. Run migrations:
python manage.py migrate
  1. Create a superuser:
python manage.py createsuperuser
  1. Run the development server:
python manage.py runserver

Deployment

The application is configured for automatic deployment on DigitalOcean App Platform:

Environment Variables

The following environment variables are configured in DigitalOcean App Platform:

  • DEBUG: Set to False for production
  • SECRET_KEY: Django secret key (generate a secure one)
  • ALLOWED_HOSTS: App domain
  • DATABASE_URL: Automatically provided by managed database
  • DB_*: Database connection details (auto-injected from managed database)

Database

The app uses a managed PostgreSQL database on DigitalOcean:

  • Engine: PostgreSQL 15
  • Environment: Development (can be upgraded to production)

Tech Stack

  • 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

Project Structure

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

About

Django authentication demo app for DigitalOcean App Platform deployment

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages