This guide explains how to deploy a Django-based chat application on an AWS EC2 instance using Nginx.
Before you start, ensure you have the following:
- AWS EC2 instance with Ubuntu or a similar Linux distribution.
- SSH access to your EC2 instance.
- Python 3.x,
virtualenv
,pip
installed. - Nginx installed (for production server setup).
- Gunicorn installed (to serve the Django app).
- Clone the Repository:
git clone https://github.com/Vaishnav88sk/MingleChat-django-web.git
cd MingleChat-django-web
- Create a Virtual Environment:
python3 -m venv venv
source venv/bin/activate
- Install Dependencies:
pip install -r requirements.txt
- Setup Database:
python manage.py migrate
- Create a Superuser:
python manage.py createsuperuser
- Update Settings for Production:
ALLOWED_HOSTS = ['your-ec2-public-ip', 'your-domain.com','localhost']
- Collect Static Files:
python manage.py collectstatic
python manage.py runserver 0.0.0.0:8000
- Django Static Files:
python manage.py collectstatic
- Database Issues:
python manage.py migrate
Visit the website: https://minglechat.duckdns.org