Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Readme
Features:
pip install drf-shop-api
Add to installed apps
INSTALLED_APPS = [
...
'drf_shop_api'
]
Add api path to you root urls.py
urlpatterns = [
...
path("shop/", include("drf_shop_api.urls")),
]
create_shop_profile
decorator on create_user method of your UserManagerfrom django.contrib.auth.base_user import BaseUserManager
from drf_shop_api.decorators import create_shop_profile
class UserManager(BaseUserManager):
@create_shop_profile
def create_user(self, email, password=None):
if not email:
raise ValueError("Enter the email")
user = self.model(email=self.normalize_email(email))
user.set_password(password)
user.save(using=self._db)
return user
Setup AUTH_USER_MODEL
in settings.py
Run python manage.py makemigrations
and python manage.py migrate
(Due to optional Payment model from root project)
Optional settings:
DRF_SHOP_PAGE_SIZE
on will be default 10DRF_SHOP_PAYMENT_MODEL
= "projects.payments.models.Payment"DRF_SHOP_PAYMENT_STATUS_CHOICES
= "project.payments.choices.PaymentStatus"DRF_SHOP_BONUS_RATE
= percentage value for each order that will go to bonus walletdjango
drf
drf-yasg 1.21.5
rest_framework_simplejwt
mixer
django-filter
FAQs
Standalone shop app, that you can add to your project
We found that drf-shop-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.