A Django-based social networking application where users can share posts, upload images, interact through likes and comments, and manage personalized profiles.
Tweetly is a Twitter-inspired social media platform that demonstrates core social networking features. Users can create accounts, publish posts with text and images, engage through likes and comments, and customize their profiles. The application is deployed on Render using Supabase PostgreSQL and Cloudinary for media storage.
User Management
- Secure registration and authentication system
- Automatic profile creation with bio and profile picture support
- User-specific tweet timelines
Content Creation
- Create, edit, and delete tweets with text and images
- Image upload and hosting via Cloudinary
- Ownership-based permissions for content management
Social Interactions
- Like and unlike tweets with real-time count updates
- Comment on tweets with nested reply support
- Threaded discussion system
User Interface
- Responsive design using Bootstrap 5
- Home feed displaying recent tweets
- Individual profile and tweet detail pages
Backend
- Django 5.2 with Python 3.x
- PostgreSQL (Supabase) for production
- SQLite for local development
- Django ORM for database operations
Media Storage
- Cloudinary for image hosting
Deployment
- Render platform
- Gunicorn WSGI server
- WhiteNoise for static files
Frontend
- Django Templates with Bootstrap 5
- Custom CSS
- Python 3.8 or higher
- pip package manager
- Git
- Cloudinary account
- Supabase account (for production)
Clone the repository
git clone https://github.com/AbhijithX001/tweetly.git
cd tweetlyCreate and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activateInstall dependencies
pip install -r requirements.txtConfigure environment variables
Create a .env file:
DJANGO_SECRET_KEY=your_django_secret_key
DEBUG=True
CLOUDINARY_URL=cloudinary://api_key:api_secret@cloud_nameRun migrations and create superuser
python manage.py migrate
python manage.py createsuperuserStart development server
python manage.py runserverVisit http://127.0.0.1:8000/
- Sign up at Cloudinary
- Get credentials from Dashboard
- Add
CLOUDINARY_URLto.envfile
Development: Uses SQLite by default
Production:
Configure PostgreSQL connection string in DATABASE_URL environment variable:
DATABASE_URL=postgresql://user:password@host:port/databaseUser Model
- Django's built-in User model with authentication
Profile Model
- One-to-one with User
- Fields: bio, profile_image, created_at
- Auto-created on user registration
Tweet Model
- Fields: user, text, photo, created_at, updated_at, likes
- Many-to-Many relationship for likes
Comment Model
- Fields: user, tweet, text, parent, created_at
- Self-referential foreign key for nested replies
Prepare for production
pip install gunicorn dj-database-url psycopg2-binary whitenoise
pip freeze > requirements.txtCreate Procfile
web: gunicorn tweetly_project.wsgi:application
Configure production settings
- Set
DEBUG=False - Configure
ALLOWED_HOSTSto include.onrender.com - Set up Supabase PostgreSQL database URL
- Add Cloudinary credentials as environment variables
Deploy
- Create a Supabase PostgreSQL database (free tier: 500MB)
- Push code to GitHub
- Connect repository to Render
- Set environment variables in Render dashboard:
DJANGO_SECRET_KEYDATABASE_URL(from Supabase)CLOUDINARY_URLDEBUG=False
- Render automatically deploys the application
Implemented measures:
- Password hashing using Django's authentication system
- CSRF protection on all forms
- Login required decorators for protected views
- Ownership validation for edit/delete operations
- Environment variables for sensitive data
- XSS and SQL injection protection via Django defaults
- Real-time notifications for interactions
- Direct messaging system
- Follow/follower functionality
- Hashtag and trending topics
- User mentions with @ functionality
- Tweet bookmarks and retweets
- Email verification and password reset
- Advanced search and filtering
- Mobile application
- Content moderation tools
Contributions are welcome! Please fork the repository, create a feature branch, commit your changes, and open a Pull Request with a detailed description.
This project is licensed under the MIT License. See the LICENSE file for details.
Author: Abhijith P
GitHub: https://github.com/AbhijithX001
Email: abhijith26p@gmail.com
LinkedIn: https://www.linkedin.com/in/abhijith-p11/
- Django Framework documentation
- Cloudinary for media storage
- Supabase for PostgreSQL database
- Render for deployment platform
- Bootstrap 5 for UI components
- Open-source community
Live Demo: https://tweetly-adhi.onrender.com
If you find this project useful, please give it a star on GitHub!