Django E-commerce is a unique marketplace focused on enabling users to buy/sell products directly or request/send quotes without any complicated or exhaustive process. This is the open-source version of a larger project.
- Features
- Installation
- Run Development Server
- First Run and Initial Data
- Order Process
- Credits
- Screenshots
-
User Panel
- User Management
- Sign Up
- Log In
- Email Password Reset
- Email Verification
- Dashboard
- Item
- Search (Category / Name)
- Buy Item
- Request Quote
- Orders
- Placed By User
- Placed By Customer
- Quote
- Placed By User
- Placed By Customer
- Upload Pdf
- By Customer
- Purchase Order
- By User/Seller
- Quote
- Invoice
- Delivery Receipt
- By Customer
- Email Notifications: Enabled when
EMAIL_SEND = True
insettings.py
- SMS Notifications: Enabled when
SMS_SEND = True
insettings.py
. Pingsms API - Multiple Addresses: User addresses. One address can be set as default.
- Multiple Inventories: Each inventory must have an address.
- Item Listing: Each item is listed by against an inventory with visibility Public/Private.
- Shopping Cart
- Checkout
- TODO: Payment
- TODO: Chats and Notifications
- User Management
-
Admin Panel
- Item Types
- Items
- Weight Groups
- Addresses
- Inventories
- Listings
- Orders
- Quotes
- Shopping Carts
git clone https://github.com/sa1if3/django_ecommerce
or
Create a Virtual Environment
virtualenv venv
Activate Virtual Environment
source venv/bin/activate
Download Prerequisites using requirements.txt
pip install -r requirements.txt
Deactivate Virtual Environment
deactivate
Create a .env
file in project folder django_ecommerce
and provide values for the following variables. In case you are not using Email or SMS. Those fields can be left empty.
SECRET_KEY=django-insecure-+_vcui795ns-2bl-$n)43ttpt6)s5s^2=t+8z*pv6%cqc*s)0i5
DB_NAME=
DB_USER=
DB_PASSWORD=
EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD=
PINGSMS_API_KEY=
PINGMS_SINGLE_SMS_TEMPLATE=
PINGMS_SENDER_ID=
Install Redis in Ubuntu 20.04 by following this tutorial
In settings.py
set the following variables. Change according to your use case.
BROKER_URL = 'redis://localhost:6379'
CELERY_RESULT_BACKEND = 'redis://localhost:6379'
CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TIMEZONE = 'Asia/Kolkata'
Activate Virtual Environment
source venv/bin/activate
Run Celery worker
celery -A django_ecommerce worker -l info
[Note: In production, this command can be put in Supervisor]
If you are interested in using the debug toolbar make sure to change your settings.py
file with the appropriate IP.
DEBUG = True
INTERNAL_IPS = [
# ...
'127.0.0.1',
# ...
]
The project uses PostgreSQL. Make sure your settings.py
is set to correct credential.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'farmersmarket',
'USER': 'farmersmarketuser',
'PASSWORD': 'fkfQbfu6gnhGt',
'HOST': 'localhost',
'PORT': '',
}
}
Section A of my tutorial covers the setting up of a server part for Django development.
Run
python manage.py makemigrations
Followed by
python manage.py migrate
A superuser is required to access the admin panel located at /accounts
python manage.py createsuperuser
In case static files don't run properly simply run
python manage.py collectstatic
To start the project simply run the server with this command inside the activated virtual environment.
python manage.py runserver
Go to http://yourdomain.com/accounts
and log in as a superuser. The admin needs to set up some initial data which restricts the user to sell items from the given category only. Enter data in the following order
- Create Item Types: Type of item being sold
- Create Items: Each Item has an item type
- Create Weight Groups: Used during the listing, quote request and orders
A seller also needs to set up some initial data to list their items.
-
Create Address: Used for Inventory and invoices
-
Create Inventory: Used for Listing items. The name is shown to the buyer too.
-
Create Listing: List items for personal use view status as
Private
or public to view and purchase by setting the view status asPublic
. If all the items of a listing were sold off; the listing becomes automatically private and the seller is notified via email. The seller cannot search for their listings.
- Search
- Add to Cart
- Check Out
- View Order Invoice
- Search
- Request Quote
- Seller Uploads Quote
- Buyer Uploads Purchase Order
- Seller Uploads Invoice and Delivery Receipt
Sign Up | Email Verification |
Dashboard | |
Search | |
Log In | Address |
Checkout | Inventory |