A return and exchange system to streamline the return and exchange process for ecommerce businesses, providing a seamless experience for customers and reducing operational headaches for the business using Django, Bootstrap
Create forms for login, signup, and submitting return/exchange requests.
"returns_exchanges/forms.py":
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
from .models import ReturnExchangeRequest
class SignUpForm(UserCreationForm):
email = forms.EmailField(max_length=254, required=True, help_text='Required. Enter a valid email address.')
class Meta:
model = User
fields = ('username', 'email', 'password1', 'password2')
class LoginForm(AuthenticationForm):
username = forms.CharField(max_length=254, widget=forms.TextInput(attrs={'class': 'form-control'}))
password = forms.CharField(widget=forms.PasswordInput(attrs={'class': 'form-control'}))
class ReturnExchangeForm(forms.ModelForm):
class Meta:
model = ReturnExchangeRequest
fields = ['request_type', 'reason']
widgets = {
'request_type': forms.Select(attrs={'class': 'form-control'}),
'reason': forms.Textarea(attrs={'class': 'form-control'}),
}
Create forms for login, signup, and submitting return/exchange requests.
"returns_exchanges/forms.py":