This project is a basic e-commerce website built using the Django framework. It allows users to browse products, add them to a cart, and (potentially) simulate the checkout process (depending on the completeness of the repository).
The website provides the following core functionalities:
- Product Listing: Displays a catalog of products with details such as name, description, price, and image.
- Product Details: Allows users to view detailed information about a specific product.
- Shopping Cart: Enables users to add products to a virtual shopping cart.
- (Potentially) Checkout Process: Depending on the implementation, might include a basic checkout process (e.g., form for address, simulated payment).
- User Authentication: User registration and login system.
- (Potentially) Admin Panel: A Django admin interface to manage products, categories, users, and orders.
-
Backend:
- Python
- Django Framework
- (Likely) SQLite (for development) or PostgreSQL/MySQL (for production)
-
Frontend:
- HTML
- CSS
- JavaScript (likely minimal, potentially with jQuery)
-
Clone the Repository:
git clone https://github.com/HariKrishnan-Ramesh/Ecommerce-Website-using-Django.git cd Ecommerce-Website-using-Django -
Create a Virtual Environment (Recommended):
python -m venv venv source venv/bin/activate # On Linux/macOS venv\Scripts\activate # On Windows
-
Install Dependencies:
pip install -r requirements.txt
(This assumes there's a
requirements.txtfile in the repository. If not, you'll need to install Django manually:pip install Django) -
Database Setup:
- If using SQLite (default for Django): Django will create the database file (
db.sqlite3) automatically when you run migrations. - If using PostgreSQL/MySQL:
- Create a database in your PostgreSQL/MySQL server.
- Update the
DATABASESsetting insettings.pywith your database connection details (name, user, password, host, port).
- If using SQLite (default for Django): Django will create the database file (
-
Run Migrations:
python manage.py migrate
-
Create a Superuser (Admin Account):
python manage.py createsuperuser
Follow the prompts to create an admin username and password.
-
Run the Development Server:
python manage.py runserver
-
Access the Website:
- Open your web browser and navigate to
http://127.0.0.1:8000/(or the address shown in the terminal). - Access the admin panel at
http://127.0.0.1:8000/admin/and log in with the superuser account you created.
- Open your web browser and navigate to
manage.py: Django's command-line utility for administrative tasks.settings.py: Project settings file (database configuration, installed apps, etc.).urls.py: URL routing configuration for the project.models.py: Defines the data models (e.g., Product, Category, Cart). Located inside each app directory.views.py: Handles the logic for displaying data and processing user requests. Located inside each app directory.templates/(directory): Contains HTML templates for the website.
- Security: This project is likely a basic example and may not have comprehensive security features. Do not use this code in a production environment without addressing security vulnerabilities such as CSRF, XSS, and SQL injection.
- Payment Gateway: A real e-commerce site requires integration with a payment gateway (e.g., Stripe, PayPal) to process payments securely. This is likely not implemented in the provided repository.
- Error Handling: Implement robust error handling to gracefully handle invalid input, database errors, and other unexpected situations.
- Scalability: The project may not be optimized for scalability. Consider using caching, database optimization, and a production-ready web server (e.g., Gunicorn, uWSGI) for a large number of users.
- Testing: Implement unit tests and integration tests to ensure the code is working correctly and to prevent regressions.
- Frontend Design: The frontend design may be basic. Consider using a CSS framework (e.g., Bootstrap, Tailwind CSS) to improve the visual appearance and responsiveness of the website.
If you'd like to contribute to this project, please feel free to fork the repository, make your changes, and submit a pull request.