A full-featured social media platform built with Django that allows users to bookmark images, follow other users, and interact through likes and social authentication.
- Custom User Registration with email verification
- Social Authentication (Google & Twitter OAuth)
- Password Reset functionality via email
- User Profiles with photo uploads (Cloudinary integration)
- Follow/Unfollow system between users
- Image Upload from external URLs
- Image Browsing with infinite scroll pagination
- Like/Unlike functionality for images
- Image Views tracking
- Bookmarklet for easy image saving from any website
- Activity Feed showing actions from followed users
- Real-time Interactions with AJAX
- User Discovery with people listing
- Activity Tracking (likes, follows, bookmarks)
- Dark/Light Mode toggle
- Responsive Design
- Live Reload during development
- Custom CSS with modern styling
- Backend: Django 5.1.2
- Database: PostgreSQL (production) / SQLite (development)
- Media Storage: Cloudinary
- Authentication: Django Allauth
- Frontend: HTML, CSS, JavaScript (Vanilla)
- Deployment: Render/Railway compatible
- Email: SMTP (Gmail)
django>=5.1.2
django-allauth[socialaccount]>=65.8.0
cloudinary>=1.44.0
django-cloudinary-storage>=0.3.0
dj-database-url>=2.3.0
python-decouple>=3.8
psycopg2-binary>=2.9.10
gunicorn>=23.0.0
whitenoise>=6.9.0django-livereload-server>=0.5.1
django-extensions>=4.1
ipython>=9.2.0git clone https://github.com/FEMADOX/django-social-website.git
cd Social_WebsiteCreate a .env file with the following variables:
# Django
SECRET_KEY="your-secret-key"
DEBUG=True
ALLOWED_HOSTS="127.0.0.1,localhost"
LOCAL_DATABASE=True
# Database (for production)
DATABASE_URL="postgresql://username:password@host:port/database"
# Social Authentication
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY="your-google-client-id"
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET="your-google-client-secret"
SOCIAL_AUTH_TWITTER_KEY="your-twitter-api-key"
SOCIAL_AUTH_TWITTER_SECRET="your-twitter-api-secret"
# Cloudinary
CLOUD_NAME="your-cloudinary-name"
CLOUD_API_KEY="your-cloudinary-api-key"
CLOUD_API_SECRET="your-cloudinary-api-secret"
# Email
EMAIL_HOST_USER="your-email@gmail.com"
EMAIL_HOST_PASSWORD="your-app-password"# Using uv (recommended)
uv sync
# Or using pip
pip install -r requirements.txtpython manage.py makemigrations
python manage.py migrate
python manage.py createsuperuserpython manage.py runserverSocial_Website/
βββ accounts/ # User management app
β βββ models.py # User profiles, contacts
β βββ views.py # Authentication, user management
β βββ forms.py # Registration, profile forms
β βββ emails.py # Email verification
βββ images/ # Image bookmarking app
β βββ models.py # Image model
β βββ views.py # Image CRUD, likes
β βββ forms.py # Image upload forms
βββ action/ # Activity tracking app
β βββ models.py # User actions
β βββ utils.py # Action creation utilities
βββ templates/ # HTML templates
β βββ account/ # User templates
β βββ images/ # Image templates
β βββ registration/ # Auth templates
βββ static/ # Static files
β βββ css/ # Stylesheets
β βββ js/ # JavaScript files
βββ Bookmarks/ # Main project settings
βββ settings.py # Django configuration
βββ urls.py # URL routing
- Go to Google Developers Console
- Create a new project or select existing
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add redirect URI:
http://127.0.0.1:8000/accounts/google/login/callback/
- Go to Twitter Developer Portal
- Create a new app
- Generate API keys and tokens
- Add callback URL:
http://127.0.0.1:8000/accounts/twitter/login/callback/
- Enable 2-factor authentication on Gmail
- Generate an App Password
- Use the App Password in
EMAIL_HOST_PASSWORD
DEBUG=False
ALLOWED_HOSTS="your-domain.com"
LOCAL_DATABASE=False
DATABASE_URL="your-production-database-url"python manage.py collectstaticgunicorn Bookmarks.wsgi:application- User fills registration form
- Email verification link sent
- User clicks link to activate account
- Profile creation page displayed
- User can start using the platform
- Drag the "Bookmark it" button to browser bookmarks
- Navigate to any webpage with images
- Click the bookmarklet
- Select an image to bookmark
- Add title and description
- Like/Unlike: Click heart button on images
- View Details: Click on image for full view
- Infinite Scroll: Scroll down to load more images
GET /- DashboardPOST /register/- User registrationGET /edit/- Edit profileGET /users/- User listingPOST /users/follow/- Follow/unfollow users
GET /images/- Image listingPOST /images/create/- Create image bookmarkGET /images/detail/<id>/<slug>/- Image detailsPOST /images/like/- Like/unlike image
- Toggle between light and dark themes
- Preference saved in localStorage
- CSS custom properties for theme switching
- Shows actions from followed users
- Prevents duplicate actions within 60 seconds
- Excludes admin user actions
- Custom token generation
- Secure activation links
- Resend email functionality
- Check Gmail App Password is correct
- Verify 2FA is enabled on Gmail
- Check firewall settings for SMTP
- Verify redirect URIs match exactly
- Check API keys are correct
- Ensure OAuth consent screen is configured
- Verify Cloudinary credentials
- Check file size limits
- Ensure valid image extensions
- Database Indexing on frequently queried fields
- Query Optimization with select_related and prefetch_related
- Static File Compression with WhiteNoise
- CDN Integration with Cloudinary
- Pagination for large datasets
- CSRF Protection on all forms
- Email Verification for new accounts
- Secure Token Generation for activation links
- Input Validation on all forms
- SQL Injection Protection via Django ORM
This project is open source and available under the MIT License.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
For support and questions:
- Create an issue on GitHub
- Check the Django documentation
- Review the django-allauth documentation