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.
- 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
andmodel-bakery
for fast, expressive tests.
Demo GIF goes here
-
Clone the repository:
git clone https://github.com/erfanghorbanee/Django-Shop.git cd Django-Shop
-
Install the Python dependencies:
pip install -r requirements/local.txt
-
Apply migrations:
cd Django-Shop python manage.py makemigrations python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
-
Open your browser and go to
http://127.0.0.1:8000
.
To enable users to log in or register using their Google account, follow these steps:
- 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.
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': ''
}
}
}
- 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, ...)
This project is licensed under the GNU General Public License v3.0. See the full text in the LICENSE file.