Open Source E-commerce API System with Django Rest Framework.
Use the git clone to install drf-ecommerce.
git clone https://github.com/scistone/drf-ecommerce.git
cd drf-ecommerce
pip install -r requirements.txt
cd ecommerce
python manage.py makemigrations
python manage.py migrate
python manage.py runserver
We used SendGrid for the mail system. SendGrid Django Documantation
### EMAIL SETTINGS FOR SENDGRID
from dotenv import load_dotenv
import os
load_dotenv()
SENDGRID_API_KEY = os.getenv('SENDGRID_API_KEY')
FROM_EMAIL = os.getenv('DEFAULT_FROM_EMAIL')
EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_HOST_USER = 'apikey' # this is exactly the value 'apikey'
EMAIL_HOST_PASSWORD = SENDGRID_API_KEY
EMAIL_PORT = 587
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = FROM_EMAIL
In order to use:
- Create '.env' file in root folder
- Create variables SENDGRID_API_KEY and DEFAULT_FROM_EMAIL
- and ready to use!
-
api/auth/register/ (POST)
- first_name
- last_name
- password
Returns User object and Token key
-
api/auth/login/ (POST)
- password
Returns User object and Token key
-
api/auth/logout/ (POST)
-
api/auth/logoutall/ (POST)
-
api/auth/user/ (GET)
- id
- first_name
- last_name
-
api/auth/change_password/ (POST)
- old_password
- password
- password2
-
api/auth/user/update/ (POST)
- first_name
- last_name
-
api/auth/request-reset-email/ (POST)
-
api/auth/password-reset/uidb64/token/ (GET)
This api check the uidb64 and token.
-
api/auth/password-reset-complete/ (POST)
- password
- token
- uidb64
These APIs' permissions classes are "IsAdminUser"
-
api/sellercentral/menu/add/ (POST)
- title
- category
- menu_type
- priority
-
api/sellercentral/menu/element/add/ (POST)
- title
- category
- priority
- parent
-
api/sellercentral/collection/add/ (POST)
- name
- description
- meta_description
-
api/sellercentral/collection/update/< slug>/ (GET,POST)
- name
- description
- meta_description
-
api/sellercentral/collection/delete/< slug>/ (DELETE)
-
api/sellercentral/product/add/ (POST)
- title
- barcode
- collections
- image
- color
- size
- model_code
- description
- meta_description
- price
-
api/sellercentral/product/update/< slug> (GET,POST)
- title
- barcode
- collections
- image
- color
- size
- model_code
- description
- meta_description
- price