This is a fully functional car sales website that facilitates car listings for users, allowing them to filter cars by brand, create an account, login, logout, and buy cars. The platform consists of various features, including user-facing functionalities and backend operations.
- Navbar: Authenticated users will see options like home, profile, and logout, while unauthenticated users will see home, signup, login.
- Home Page: Initial display of text and an image. Users can browse car listings with images, prices, and filter cars by brand name.
- Models: Two models - Car Model and Brand Model with a relationship between them (A brand has multiple cars, but a car has only one brand).
- Car Details Page: Displays car image, name, description, quantity, price, brand name, and a "Buy Now" button for authenticated users.
- Comments: Users can comment on cars with their name and comment.
- User Registration: Users can sign up with their details.
- Login System: Users can log in to their accounts.
- Profile Editing: Users can edit their profile details.
- Authentication Check: Only authenticated users can buy cars.
- Buy Now Button: Appears only for authenticated users. Clicking it purchases the car, reducing the total quantity by one.
- Profile Page: Users can view their bought cars list.
-
Car Model
- Image
- Title
- Description
- Quantity
- Price
- Brand (Foreign Key to Brand Model)
-
Brand Model
- Name
- Home View: Display initial content and car listings.
- Car Details View: Display detailed information about a selected car.
- Profile View: Display user profile details and order history.
- User Registration View: Allows users to register.
- Login View: Allows users to log in.
- Logout View: Logs users out.
- Clone the repository:
git clone https://github.com/coderboy-raiyan/carwow
cd carwow
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
# For Windows
venv\Scripts\activate
# For macOS/Linux
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Apply database migrations:
python manage.py makemigrations
python manage.py migrate
- Run the development server:
python manage.py runserver
Visit http://localhost:8000/ in your web browser to access the car sales website.
Feel free to customize and extend the project based on your specific requirements.