This project is a simple social media application built with Django. It allows users to create an account, post content, and view posts from other users.
- User authentication (sign up, log in, log out)
- Posting content with text and images
- Viewing a feed of posts from all users with infinite scrolling
- Prettify the post with clickable urls and YouTube thumbnails.
- Like, delete posts without refreshing the page.
- Python
- Django
- HTML/CSS
- JavaScript
- Tailwind CSS for styling
- PostgreSQL for the database
- Docker for containerization
To get this project running on your local machine, follow these steps:
- Python 3.8 or higher
- pip
- Docker and Docker Compose
- Clone the repository to your local machine:
git clone https://github.com/<your-username>/django-social-media.git
- Navigate to the project directory:
cd django-social-media
- Create a
.env
file in the project root directory with the following contents:DEBUG=1 SECRET_KEY=your_secret_key DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1] SQL_ENGINE=django.db.backends.postgresql SQL_DATABASE=your_db_name SQL_USER=your_db_user SQL_PASSWORD=your_db_password SQL_HOST=db SQL_PORT=5432 DATABASE=postgres
- Create a
.env.db
file in the project root directory with the following contents:POSTGRES_DB=your_db_name POSTGRES_USER=your_db_user POSTGRES_PASSWORD=your_db_password POSTGRES_HOST=db POSTGRES_PORT=5432
- Build and access the Docker container:
sh run.sh
- Create a superuser for Django admin (optional):
python manage.py createsuperuser
- Run the server:
sh server.sh
- Visit
http://localhost:8000
in your web browser to view the application.
- The database settings can be configured in the
.env.db
file. - Additional Django settings can be configured in the
.env
file.
- Manual Deployment
docker compose -f docker-compose.production.yml up --build
- Continuous Deployment
nohup ./cd.py &
Contributions are welcome! Please feel free to submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.