A modern, full-featured Django web application for user profile management with beautiful UI, secure authentication, and comprehensive profile customization.
- Secure Registration: User signup with email validation
- Login/Logout: Complete authentication flow
- Password Management: Built-in Django auth system
- CSRF Protection: All forms protected against cross-site request forgery
- Session Management: Secure user sessions
- Bio Section: Rich text bio with 500 character limit
- Photo Upload: Profile picture upload with validation
- Real-time Updates: Instant profile updates with success feedback
- Data Validation: Server-side validation for all inputs
- Responsive Design: Works perfectly on desktop and mobile
- Beautiful Interface: Modern gradient backgrounds and card layouts
- Interactive Elements: Smooth animations and hover effects
- Accessibility: Proper contrast ratios and keyboard navigation
- Professional Styling: Clean, modern design with consistent branding
- File Upload Limits: 2MB maximum file size
- Image Format Support: PNG, JPG, JPEG only
- Character Limits: Bio text limited to 500 characters
- Email Validation: Proper email format checking
- Password Security: Django's built-in password validation
- Backend: Django 4.2+
- Database: SQLite (development) / PostgreSQL (production)
- Frontend: HTML5, CSS3, JavaScript
- Styling: Custom CSS with modern design principles
- Authentication: Django's built-in auth system
- File Handling: Django's file upload system with Pillow
Before running this project, make sure you have:
- Python 3.8 or higher
- pip (Python package installer)
- Git (for cloning the repository)
git clone https://github.com/imSai-py/django.git
cd django# Windows
python -m venv venv
venv\Scripts\activate
# macOS/Linux
python -m venv venv
source venv/bin/activatepip install django pillowpython manage.py makemigrations
python manage.py migratepython manage.py createsuperuserpython manage.py runserverVisit http://127.0.0.1:8000/ in your browser!
- Navigate to
/register/ - Fill in username, email, password, and optional bio
- Upload a profile photo (optional)
- Click "Register" to create your account
- After registration/login, you'll be redirected to
/profile/ - View your current profile information
- Update your bio (max 500 characters)
- Upload or change your profile photo
- Click "Update Profile" to save changes
- Access
/admin/(requires superuser account) - Manage users and profiles
- View uploaded media files
django/
βββ project/ # Main Django project
β βββ settings.py # Django settings
β βββ urls.py # Main URL configuration
β βββ wsgi.py # WSGI configuration
β βββ asgi.py # ASGI configuration
βββ application/ # Main Django app
β βββ models.py # Database models
β βββ views.py # View functions
β βββ forms.py # Form classes
β βββ urls.py # App URL configuration
β βββ admin.py # Admin interface
β βββ templates/ # HTML templates
β βββ application/
β βββ register.html
β βββ profile.html
βββ templates/
β βββ registration/ # Auth templates
β βββ login.html
β βββ logged_out.html
β βββ password_reset_form.html
βββ media/ # User uploaded files
β βββ uploads/ # Profile photos and other media
βββ static/ # Static files (CSS, JS, images)
βββ db.sqlite3 # SQLite database
βββ manage.py # Django management script
βββ README.md # This file
- Validation: Only PNG, JPG, JPEG files allowed
- Size Limit: Maximum 2MB per file
- Storage: Files stored in
media/profile_photos/ - Display: Automatic thumbnail generation with rounded corners
- Character Limit: 500 characters maximum
- Real-time Counter: JavaScript prevents exceeding limit
- Rich Text: Multi-line textarea for better UX
- Default Display: Shows "No bio yet." when empty
- CSRF Protection: All forms include CSRF tokens
- Authentication Required: Profile updates require login
- File Type Validation: Prevents malicious file uploads
- Secure Passwords: Django's password hashing
The app is configured to serve media files during development:
# settings.py
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')# settings.py
LOGIN_REDIRECT_URL = '/profile/'
LOGOUT_REDIRECT_URL = '/accounts/login/'- User registration with valid data
- User registration with invalid data (validation errors)
- Login with correct credentials
- Login with incorrect credentials
- Profile update with bio only
- Profile update with photo only
- Profile update with both bio and photo
- File upload validation (wrong format, too large)
- Logout functionality
- Admin panel access
python manage.py test- Change
DEBUG = Falsein settings.py - Set up production database (PostgreSQL recommended)
- Configure static files serving
- Set up proper domain and SSL
- Configure email backend for password reset
- Set secure SECRET_KEY
- Configure ALLOWED_HOSTS
Create a .env file for sensitive settings:
SECRET_KEY=your-secret-key-here
DEBUG=False
DATABASE_URL=postgresql://user:password@localhost/dbname
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and test thoroughly
- Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature-name - Submit a pull request
- Follow PEP 8 style guidelines
- Write descriptive commit messages
- Add tests for new features
- Update documentation as needed
- Ensure responsive design works on all devices
If you have any questions or need help:
- π Website: Django User Profile Manager
- π§ Email: imSai-py@github.com
- π Issues: GitHub Issues
- π Documentation: Django Docs
- Password reset functionality
- Email verification
- Social media login (Google, Facebook)
- Profile privacy settings
- User search and following system
- API endpoints for mobile app
- Dark mode toggle
- Multi-language support
- Profile analytics dashboard
Made with β€οΈ using Django