A comprehensive Django-based car rental platform that connects car owners (renters) with customers (passengers) in a peer-to-peer marketplace. The application supports Persian/Farsi language and includes features for car listing, booking, reviews, and administrative management.
- Browse Cars: View available cars with detailed information
- Advanced Search & Filtering: Filter by price, location, capacity, and driver availability
- Car Details: View multiple images, specifications, and reviews
- Booking System: Reserve cars with date selection and passenger count
- Review System: Rate and review cars after rental
- Order Management: View booking history and cancel reservations
- User Profile: Manage personal information and view rental history
- Car Management: Add, edit, and manage car listings
- Booking Requests: Receive and manage rental requests
- Order Confirmation: Approve or reject booking requests
- Earnings Tracking: Monitor rental income and booking status
- Car Status: Activate/deactivate car listings
- Dashboard: Overview of users, cars, and orders
- User Management: Manage user accounts and roles
- Car Moderation: Review and approve car listings
- Order Monitoring: Track all rental transactions
- Renter Approval: Approve car owner applications
- System Analytics: View platform statistics and recent activities
- Backend: Django 4.x
- Database: SQLite (development) / PostgreSQL (production ready)
- Frontend: HTML5, CSS3, JavaScript, Bootstrap 5
- Image Processing: Pillow (PIL)
- Date Handling: django-jalali, jdatetime (Persian calendar support)
- Forms: django-crispy-forms
- Authentication: Django's built-in authentication system
Car-Rental/
βββ admin_app/ # Admin panel and management
βββ car/ # Car listing and management
βββ core/ # Django settings and configuration
βββ reservations/ # Booking and order management
βββ users/ # User authentication and profiles
βββ static/ # CSS, JS, images, and fonts
βββ templates/ # HTML templates
βββ media/ # User-uploaded files
βββ requirements.txt # Python dependencies
- Python 3.8 or higher
- pip (Python package installer)
git clone <repository-url>
cd Car-Rentalpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtpython manage.py makemigrations
python manage.py migratepython manage.py createsuperuserpython manage.py runserverThe application will be available at http://127.0.0.1:8000/
- Browse and search cars
- Make reservations
- Write reviews
- Manage profile
- List cars for rent
- Manage bookings
- Approve/reject requests
- Track earnings
- Full system access
- User management
- Content moderation
- System analytics
Create a .env file in the project root:
SECRET_KEY=your-secret-key-here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
DATABASE_URL=sqlite:///db.sqlite3The application uses SQLite by default. For production, update settings.py:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'your_db_name',
'USER': 'your_db_user',
'PASSWORD': 'your_db_password',
'HOST': 'localhost',
'PORT': '5432',
}
}- Multiple Images: Up to 5 images per car with automatic resizing
- Detailed Information: Name, city, capacity, price per day, driver availability
- Status Management: Active/inactive car listings
- Owner Association: Each car is linked to its owner
- Date Validation: Prevents double bookings
- Capacity Check: Ensures passenger count doesn't exceed car capacity
- Price Calculation: Automatic calculation based on days and driver option
- Status Tracking: Pending, confirmed, cancelled, completed
- Rating System: 1-5 star ratings
- Comment Support: Text reviews for detailed feedback
- One Review Per User: Prevents spam and duplicate reviews
- Average Rating Display: Shows overall car rating
- Dashboard: Real-time statistics and recent activities
- User Management: View, edit, and manage user accounts
- Content Moderation: Approve/reject cars and manage listings
- Order Monitoring: Track all rental transactions
GET /- Home page with login/signupPOST /login/- User loginPOST /signup/- User registrationGET /logout/- User logout
GET /cars/- List all cars with filtersGET /cars/<id>/- Car detail pagePOST /cars/<id>/review/- Add/edit reviewGET /cars/add/- Add new car (renters only)POST /cars/add/- Create new car listing
GET /reservations/- User's order historyPOST /reservations/<car_id>/- Create new reservationPOST /reservations/cancel/<order_id>/- Cancel reservationGET /reservations/host/- Host's booking requests
GET /admin-panel/- Admin dashboardPOST /admin-panel/- Admin actions (user management, etc.)
- Right-to-left (RTL) layout
- Persian date picker (Jalali calendar)
- Arabic numerals support
- Persian text throughout the interface
- Mobile-first approach
- Bootstrap 5 framework
- Cross-browser compatibility
- Touch-friendly interface
- Preloader animations
- Toast notifications
- Modal dialogs
- Image galleries
- Form validation
- CSRF protection
- SQL injection prevention
- XSS protection
- Secure file uploads
- Authentication required for sensitive operations
- Role-based access control
- Username, email, password
- Role (Admin/Renter/Passenger)
- Phone number, address
- Role change requests
- Name, images, city, capacity
- Price per day, driver availability
- Owner reference, active status
- Car and user references
- Pickup/return dates
- Passenger count, total price
- Status tracking
- Car and user references
- Rating (1-5), comment
- Creation timestamp
- Set
DEBUG = Falsein settings - Configure production database
- Set up static file serving
- Configure media file storage
- Set up HTTPS
- Configure logging
- Set up backup system
- Heroku: Easy deployment with PostgreSQL
- DigitalOcean: VPS with Django deployment
- AWS: Scalable cloud hosting
- PythonAnywhere: Django-specific hosting
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Contact the development team
- Check the documentation
- v1.0.0: Initial release with core features
- Basic car rental functionality
- User authentication and roles
- Booking system
- Admin panel
Note: This application is designed for the Persian market with full RTL support and Persian language integration. The system supports both English and Persian interfaces.