Skip to content

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-commerce Website using Django

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).

Overview

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.

Technologies Used

  • Backend:

    • Python
    • Django Framework
    • (Likely) SQLite (for development) or PostgreSQL/MySQL (for production)
  • Frontend:

    • HTML
    • CSS
    • JavaScript (likely minimal, potentially with jQuery)

Setup Instructions

  1. Clone the Repository:

    git clone https://github.com/HariKrishnan-Ramesh/Ecommerce-Website-using-Django.git
    cd Ecommerce-Website-using-Django
  2. Create a Virtual Environment (Recommended):

    python -m venv venv
    source venv/bin/activate  # On Linux/macOS
    venv\Scripts\activate  # On Windows
  3. Install Dependencies:

    pip install -r requirements.txt

    (This assumes there's a requirements.txt file in the repository. If not, you'll need to install Django manually: pip install Django)

  4. 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 DATABASES setting in settings.py with your database connection details (name, user, password, host, port).
  5. Run Migrations:

    python manage.py migrate
  6. Create a Superuser (Admin Account):

    python manage.py createsuperuser

    Follow the prompts to create an admin username and password.

  7. Run the Development Server:

    python manage.py runserver
  8. 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.

Key Files and Structure

  • 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.

Important Considerations

  • 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.

Contributing

If you'd like to contribute to this project, please feel free to fork the repository, make your changes, and submit a pull request.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages