Skip to content

erfanghorbanee/Django-Shop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Shop

Logo

Django Shop is a modern, responsive e-commerce platform built with Django and Bootstrap. It allows users to browse, search for products, manage shopping carts, and make purchases. The platform uses Django Allauth for authentication and supports social login.

Table of Contents

Features

  • User Authentication, Registration, Account management, and Social login (via Django Allauth)
  • Phone number validation (via Django-PhoneNumberField)
  • Validating uploaded Files
  • Responsive design using Bootstrap
  • Clean UI with light/dark mode switcher
  • Product listing and details
  • Product Rating and Reviews
  • Discounts/Promotions
  • Order management
  • User wishlist functionality
  • Customer support page
  • Career application page
  • Advanced address management:
    • Multiple addresses per user with exactly one primary (DB-enforced partial unique constraint)
    • First address auto-set as primary
    • Safe primary switching (atomic demotion of previous primary)
    • Cannot unset the only primary address (form validation)
    • Cannot delete the only remaining address (domain exception)
    • Automatic promotion of a new primary (most recent address) after deleting the current one
  • Use pytest + pytest-django and model-bakery for fast, expressive tests.

Demo

Demo GIF goes here

Installation

  1. Clone the repository:

    git clone https://github.com/erfanghorbanee/Django-Shop.git
    cd Django-Shop
  2. Install the Python dependencies:

    pip install -r requirements/local.txt

Running the Project

  1. Apply migrations:

    cd Django-Shop
    python manage.py makemigrations
    python manage.py migrate
  2. Create a superuser:

    python manage.py createsuperuser
  3. Run the development server:

    python manage.py runserver
  4. Open your browser and go to http://127.0.0.1:8000.

Google OAuth Setup (Login with Google)

To enable users to log in or register using their Google account, follow these steps:

1. Register your app with Google

  • Go to the Google Cloud Console.
  • Create a new project (or select an existing one).
  • Navigate to APIs & Services > Credentials.
  • Click Create Credentials > OAuth client ID.
  • Set the application type to Web application.
  • Add the following to Authorized redirect URIs:
    • http://127.0.0.1:8000/accounts/google/login/callback/
    • This is for when we run the app locally.
  • Save and copy the Client ID and Client Secret.

2. Configure Django settings

In Django-Shop/config/settings.py, update the SOCIALACCOUNT_PROVIDERS section:

SOCIALACCOUNT_PROVIDERS = {
    'google': {
        'APP': {
            'client_id': 'YOUR_GOOGLE_CLIENT_ID',
            'secret': 'YOUR_GOOGLE_CLIENT_SECRET',
            'key': ''
        }
    }
}

To-Do List

  • Add payment integration
  • Implement cart
  • Improve overall speed
  • Customize dashboard for admins
  • process and optimize pictures(static and media)
  • Optimize for SEO
  • Optimize caching
  • Improve security (2fa, ...)
  • Add tests for core functionalities
  • stress-test server and database under heavy load with concurrent requests
  • Support other languages (French, German, ...)

License

This project is licensed under the GNU General Public License v3.0. See the full text in the LICENSE file.

About

Django Shop is a modern, responsive e-commerce platform built with Django and Bootstrap.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published