├── .gitignore ├── LICENSE ├── README.md ├── ecom ├── __init__.py ├── admin.py ├── apps.py ├── forms.py ├── migrations │ ├── 0001_initial.py │ ├── 0002_product.py │ ├── 0003_orders.py │ ├── 0004_feedback.py │ ├── 0005_feedback_date.py │ └── __init__.py ├── models.py ├── tests.py └── views.py ├── ecommerce ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-37.pyc │ └── settings.cpython-37.pyc ├── asgi.py ├── settings.py ├── urls.py └── wsgi.py ├── manage.py ├── requirement.txt ├── static ├── images │ ├── logout_img.png │ └── success.png └── screenshots │ ├── adminHomepage.png │ ├── cart.png │ ├── customerhomepage.png │ └── orderspage.png └── templates └── ecom ├── aboutus.html ├── admin_add_products.html ├── admin_base.html ├── admin_dashboard.html ├── admin_dashboard_cards.html ├── admin_products.html ├── admin_update_customer.html ├── admin_update_product.html ├── admin_view_booking.html ├── adminlogin.html ├── cart.html ├── contactus.html ├── contactussuccess.html ├── customer_address.html ├── customer_base.html ├── customer_home.html ├── customer_navbar.html ├── customerlogin.html ├── customersignup.html ├── download_invoice.html ├── edit_profile.html ├── feedback_sent.html ├── footer.html ├── homebase.html ├── index.html ├── logout.html ├── my_order.html ├── my_profile.html ├── navbar.html ├── payment.html ├── payment_success.html ├── send_feedback.html ├── update_order.html ├── view_customer.html └── view_feedback.html /.gitignore: -------------------------------------------------------------------------------- 1 | # Django # 2 | *.log 3 | *.pot 4 | *.pyc 5 | __pycache__ 6 | db.sqlite3 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 sumit kumar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ECOMMERCE 2 | --- 3 | ## screenshots 4 | ### Admin Dashboard 5 | ![dashboard snap](https://github.com/Tigercoder0218/Ecommerce) 6 | ### Customer Homepage 7 | ![homepage snap](https://github.com/Tigercoder0218/Ecommerce) 8 | ### Cart 9 | ![cart snap](https://github.com/Tigercoder0218/Ecommerce) 10 | ### Track Orders 11 | ![orders snap](https://github.com/Tigercoder0218/Ecommerce) 12 | --- 13 | ## FUNCTIONS 14 | ## Customer 15 | - Customer can view/search products without login. 16 | - Customer can also add/remove product to cart without login (if customer try to add same product in cart. It will add only one) 17 | - When customer try to purchase product, then he/she must login to system. 18 | - After creating account and login to system, he/she can place order. 19 | - There is a payment page also (just for demo, DONT FILL YOUR CARD DETAILS THERE ,By the way, website do not save that details) 20 | - If customer click on pay button, then their payment will be successful and their order will be placed. 21 | - Customer can check their ordered details by clicking on orders button. 22 | - Customer can see the order status (Pending, Confirmed, Delivered) for each order 23 | - Customer can Download their order invoice for each order 24 | - Customer can send feedback to admin (without login) 25 | --- 26 | ### Admin 27 | - First admin will login ( for username/password run following command in cmd ) 28 | ``` 29 | py manage.py createsuperuser 30 | ``` 31 | - Give username, email, password and your admin account will be created. 32 | - After login, there is a dashboard (attached in screenshot) where admin can see how many customer is registered, how many products are there for sale, how many orders placed. 33 | - Admin can add/delete/view/edit the products. 34 | - Admin can view/edit/delete customer details. 35 | - Admin can view/delete orders. 36 | - Admin can change status of order (order is pending, confirmed, out for delivery, delivered) 37 | - Admin can view the feedbacks sent by customers. 38 | --- 39 | ### Other Features 40 | - customer places order and admin deleted that user(fraud detection), then their orders will automatically deleted 41 | 42 | - suppose 1 customer places 4 products order and admin deleted 2 product from website, then that 2 product order will 43 | also be deleted and other 2 will be their 44 | - If user click on purchase button without having products in their cart, then website will ask to add product in cart first. 45 | 46 | 47 | 48 | ## HOW TO RUN THIS PROJECT 49 | - Install Python(3.7.6) (Dont Forget to Tick Add to Path while installing Python) 50 | - Open Terminal and Execute Following Commands : 51 | ``` 52 | pip install django==3.0.5 53 | pip install django-widget-tweaks 54 | pip install xhtml2pdf 55 | 56 | ``` 57 | - Download This Project Zip Folder and Extract it 58 | - Move to project folder in Terminal. Then run following Commands : 59 | ``` 60 | py manage.py makemigrations 61 | py manage.py migrate 62 | py manage.py runserver 63 | ``` 64 | - Now enter following URL in Your Browser Installed On Your Pc 65 | ``` 66 | http://127.0.0.1:8000/ 67 | ``` 68 | 69 | ## CHANGES REQUIRED FOR CONTACT US PAGE 70 | - In settins.py file, You have to give your email and password 71 | ``` 72 | EMAIL_HOST_USER = 'youremail@gmail.com' 73 | EMAIL_HOST_PASSWORD = 'your email password' 74 | EMAIL_RECEIVING_USER = 'youremail@gmail.com' 75 | ``` 76 | - Login to gmail through host email id in your browser and open following link and turn it ON 77 | ``` 78 | https://myaccount.google.com/lesssecureapps 79 | ``` 80 | ## Drawbacks/LoopHoles 81 | - When user edit their profile then he/she must login again because their username/password is updated in db. 82 | - Popup of product is added to cart is shown when click on Ecommerce logo (soon i will fix it) 83 | 84 | ## Disclaimer 85 | This project is developed for demo purpose and it's not supposed to be used in real application. 86 | 87 | ## Contributor 88 | - [Tigercoder](https://github.com/Tigercoder0218/Ecommerce) 89 | -------------------------------------------------------------------------------- /ecom/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tigercoder0218/Ecommerce/a2d4a918ae843d2ac66fbb89a3f0e6d60df47b4a/ecom/__init__.py -------------------------------------------------------------------------------- /ecom/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import Customer,Product,Orders,Feedback 3 | # Register your models here. 4 | class CustomerAdmin(admin.ModelAdmin): 5 | pass 6 | admin.site.register(Customer, CustomerAdmin) 7 | 8 | class ProductAdmin(admin.ModelAdmin): 9 | pass 10 | admin.site.register(Product, ProductAdmin) 11 | 12 | class OrderAdmin(admin.ModelAdmin): 13 | pass 14 | admin.site.register(Orders, OrderAdmin) 15 | 16 | class FeedbackAdmin(admin.ModelAdmin): 17 | pass 18 | admin.site.register(Feedback, FeedbackAdmin) 19 | # Register your models here. 20 | -------------------------------------------------------------------------------- /ecom/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class EcomConfig(AppConfig): 5 | name = 'ecom' 6 | -------------------------------------------------------------------------------- /ecom/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from django.contrib.auth.models import User 3 | from . import models 4 | 5 | 6 | class CustomerUserForm(forms.ModelForm): 7 | class Meta: 8 | model=User 9 | fields=['first_name','last_name','username','password'] 10 | widgets = { 11 | 'password': forms.PasswordInput() 12 | } 13 | 14 | class CustomerForm(forms.ModelForm): 15 | class Meta: 16 | model=models.Customer 17 | fields=['address','mobile','profile_pic'] 18 | 19 | class ProductForm(forms.ModelForm): 20 | class Meta: 21 | model=models.Product 22 | fields=['name','price','description','product_image'] 23 | 24 | #address of shipment 25 | class AddressForm(forms.Form): 26 | Email = forms.EmailField() 27 | Mobile= forms.IntegerField() 28 | Address = forms.CharField(max_length=500) 29 | 30 | class FeedbackForm(forms.ModelForm): 31 | class Meta: 32 | model=models.Feedback 33 | fields=['name','feedback'] 34 | 35 | #for updating status of order 36 | class OrderForm(forms.ModelForm): 37 | class Meta: 38 | model=models.Orders 39 | fields=['status'] 40 | 41 | #for contact us page 42 | class ContactusForm(forms.Form): 43 | Name = forms.CharField(max_length=30) 44 | Email = forms.EmailField() 45 | Message = forms.CharField(max_length=500,widget=forms.Textarea(attrs={'rows': 3, 'cols': 30})) 46 | -------------------------------------------------------------------------------- /ecom/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.5 on 2020-07-30 05:31 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | import django.db.models.deletion 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | initial = True 11 | 12 | dependencies = [ 13 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 14 | ] 15 | 16 | operations = [ 17 | migrations.CreateModel( 18 | name='Customer', 19 | fields=[ 20 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 21 | ('profile_pic', models.ImageField(blank=True, null=True, upload_to='profile_pic/CustomerProfilePic/')), 22 | ('address', models.CharField(max_length=40)), 23 | ('mobile', models.CharField(max_length=20)), 24 | ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), 25 | ], 26 | ), 27 | ] 28 | -------------------------------------------------------------------------------- /ecom/migrations/0002_product.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.5 on 2020-08-25 15:19 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('ecom', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.CreateModel( 14 | name='Product', 15 | fields=[ 16 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 17 | ('name', models.CharField(max_length=40)), 18 | ('product_image', models.ImageField(blank=True, null=True, upload_to='product_image/')), 19 | ('price', models.PositiveIntegerField()), 20 | ('description', models.CharField(max_length=40)), 21 | ], 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /ecom/migrations/0003_orders.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.5 on 2020-08-28 12:29 2 | 3 | from django.db import migrations, models 4 | import django.db.models.deletion 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('ecom', '0002_product'), 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='Orders', 16 | fields=[ 17 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('email', models.CharField(max_length=50, null=True)), 19 | ('address', models.CharField(max_length=500, null=True)), 20 | ('mobile', models.CharField(max_length=20, null=True)), 21 | ('order_date', models.DateField(auto_now_add=True, null=True)), 22 | ('status', models.CharField(choices=[('Pending', 'Pending'), ('Order Confirmed', 'Order Confirmed'), ('Out for Delivery', 'Out for Delivery'), ('Delivered', 'Delivered')], max_length=50, null=True)), 23 | ('customer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='ecom.Customer')), 24 | ('product', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='ecom.Product')), 25 | ], 26 | ), 27 | ] 28 | -------------------------------------------------------------------------------- /ecom/migrations/0004_feedback.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.5 on 2020-08-29 09:28 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('ecom', '0003_orders'), 10 | ] 11 | 12 | operations = [ 13 | migrations.CreateModel( 14 | name='Feedback', 15 | fields=[ 16 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 17 | ('name', models.CharField(max_length=40)), 18 | ('feedback', models.CharField(max_length=500)), 19 | ], 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /ecom/migrations/0005_feedback_date.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.5 on 2020-08-29 12:47 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('ecom', '0004_feedback'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='feedback', 15 | name='date', 16 | field=models.DateField(auto_now_add=True, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /ecom/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tigercoder0218/Ecommerce/a2d4a918ae843d2ac66fbb89a3f0e6d60df47b4a/ecom/migrations/__init__.py -------------------------------------------------------------------------------- /ecom/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.contrib.auth.models import User 3 | # Create your models here. 4 | class Customer(models.Model): 5 | user=models.OneToOneField(User,on_delete=models.CASCADE) 6 | profile_pic= models.ImageField(upload_to='profile_pic/CustomerProfilePic/',null=True,blank=True) 7 | address = models.CharField(max_length=40) 8 | mobile = models.CharField(max_length=20,null=False) 9 | @property 10 | def get_name(self): 11 | return self.user.first_name+" "+self.user.last_name 12 | @property 13 | def get_id(self): 14 | return self.user.id 15 | def __str__(self): 16 | return self.user.first_name 17 | 18 | 19 | class Product(models.Model): 20 | name=models.CharField(max_length=40) 21 | product_image= models.ImageField(upload_to='product_image/',null=True,blank=True) 22 | price = models.PositiveIntegerField() 23 | description=models.CharField(max_length=40) 24 | def __str__(self): 25 | return self.name 26 | 27 | 28 | class Orders(models.Model): 29 | STATUS =( 30 | ('Pending','Pending'), 31 | ('Order Confirmed','Order Confirmed'), 32 | ('Out for Delivery','Out for Delivery'), 33 | ('Delivered','Delivered'), 34 | ) 35 | customer=models.ForeignKey('Customer', on_delete=models.CASCADE,null=True) 36 | product=models.ForeignKey('Product',on_delete=models.CASCADE,null=True) 37 | email = models.CharField(max_length=50,null=True) 38 | address = models.CharField(max_length=500,null=True) 39 | mobile = models.CharField(max_length=20,null=True) 40 | order_date= models.DateField(auto_now_add=True,null=True) 41 | status=models.CharField(max_length=50,null=True,choices=STATUS) 42 | 43 | 44 | class Feedback(models.Model): 45 | name=models.CharField(max_length=40) 46 | feedback=models.CharField(max_length=500) 47 | date= models.DateField(auto_now_add=True,null=True) 48 | def __str__(self): 49 | return self.name 50 | -------------------------------------------------------------------------------- /ecom/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /ecom/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render,redirect,reverse 2 | from . import forms,models 3 | from django.http import HttpResponseRedirect,HttpResponse 4 | from django.core.mail import send_mail 5 | from django.contrib.auth.models import Group 6 | from django.contrib.auth.decorators import login_required,user_passes_test 7 | from django.contrib import messages 8 | from django.conf import settings 9 | 10 | def home_view(request): 11 | products=models.Product.objects.all() 12 | if 'product_ids' in request.COOKIES: 13 | product_ids = request.COOKIES['product_ids'] 14 | counter=product_ids.split('|') 15 | product_count_in_cart=len(set(counter)) 16 | else: 17 | product_count_in_cart=0 18 | if request.user.is_authenticated: 19 | return HttpResponseRedirect('afterlogin') 20 | return render(request,'ecom/index.html',{'products':products,'product_count_in_cart':product_count_in_cart}) 21 | 22 | 23 | #for showing login button for admin(by sumit) 24 | def adminclick_view(request): 25 | if request.user.is_authenticated: 26 | return HttpResponseRedirect('afterlogin') 27 | return HttpResponseRedirect('adminlogin') 28 | 29 | 30 | def customer_signup_view(request): 31 | userForm=forms.CustomerUserForm() 32 | customerForm=forms.CustomerForm() 33 | mydict={'userForm':userForm,'customerForm':customerForm} 34 | if request.method=='POST': 35 | userForm=forms.CustomerUserForm(request.POST) 36 | customerForm=forms.CustomerForm(request.POST,request.FILES) 37 | if userForm.is_valid() and customerForm.is_valid(): 38 | user=userForm.save() 39 | user.set_password(user.password) 40 | user.save() 41 | customer=customerForm.save(commit=False) 42 | customer.user=user 43 | customer.save() 44 | my_customer_group = Group.objects.get_or_create(name='CUSTOMER') 45 | my_customer_group[0].user_set.add(user) 46 | return HttpResponseRedirect('customerlogin') 47 | return render(request,'ecom/customersignup.html',context=mydict) 48 | 49 | #-----------for checking user iscustomer 50 | def is_customer(user): 51 | return user.groups.filter(name='CUSTOMER').exists() 52 | 53 | 54 | 55 | #---------AFTER ENTERING CREDENTIALS WE CHECK WHETHER USERNAME AND PASSWORD IS OF ADMIN,CUSTOMER 56 | def afterlogin_view(request): 57 | if is_customer(request.user): 58 | return redirect('customer-home') 59 | else: 60 | return redirect('admin-dashboard') 61 | 62 | #--------------------------------------------------------------------------------- 63 | #------------------------ ADMIN RELATED VIEWS START ------------------------------ 64 | #--------------------------------------------------------------------------------- 65 | @login_required(login_url='adminlogin') 66 | def admin_dashboard_view(request): 67 | # for cards on dashboard 68 | customercount=models.Customer.objects.all().count() 69 | productcount=models.Product.objects.all().count() 70 | ordercount=models.Orders.objects.all().count() 71 | 72 | # for recent order tables 73 | orders=models.Orders.objects.all() 74 | ordered_products=[] 75 | ordered_bys=[] 76 | for order in orders: 77 | ordered_product=models.Product.objects.all().filter(id=order.product.id) 78 | ordered_by=models.Customer.objects.all().filter(id = order.customer.id) 79 | ordered_products.append(ordered_product) 80 | ordered_bys.append(ordered_by) 81 | 82 | mydict={ 83 | 'customercount':customercount, 84 | 'productcount':productcount, 85 | 'ordercount':ordercount, 86 | 'data':zip(ordered_products,ordered_bys,orders), 87 | } 88 | return render(request,'ecom/admin_dashboard.html',context=mydict) 89 | 90 | 91 | # admin view customer table 92 | @login_required(login_url='adminlogin') 93 | def view_customer_view(request): 94 | customers=models.Customer.objects.all() 95 | return render(request,'ecom/view_customer.html',{'customers':customers}) 96 | 97 | # admin delete customer 98 | @login_required(login_url='adminlogin') 99 | def delete_customer_view(request,pk): 100 | customer=models.Customer.objects.get(id=pk) 101 | user=models.User.objects.get(id=customer.user_id) 102 | user.delete() 103 | customer.delete() 104 | return redirect('view-customer') 105 | 106 | 107 | @login_required(login_url='adminlogin') 108 | def update_customer_view(request,pk): 109 | customer=models.Customer.objects.get(id=pk) 110 | user=models.User.objects.get(id=customer.user_id) 111 | userForm=forms.CustomerUserForm(instance=user) 112 | customerForm=forms.CustomerForm(request.FILES,instance=customer) 113 | mydict={'userForm':userForm,'customerForm':customerForm} 114 | if request.method=='POST': 115 | userForm=forms.CustomerUserForm(request.POST,instance=user) 116 | customerForm=forms.CustomerForm(request.POST,instance=customer) 117 | if userForm.is_valid() and customerForm.is_valid(): 118 | user=userForm.save() 119 | user.set_password(user.password) 120 | user.save() 121 | customerForm.save() 122 | return redirect('view-customer') 123 | return render(request,'ecom/admin_update_customer.html',context=mydict) 124 | 125 | # admin view the product 126 | @login_required(login_url='adminlogin') 127 | def admin_products_view(request): 128 | products=models.Product.objects.all() 129 | return render(request,'ecom/admin_products.html',{'products':products}) 130 | 131 | 132 | # admin add product by clicking on floating button 133 | @login_required(login_url='adminlogin') 134 | def admin_add_product_view(request): 135 | productForm=forms.ProductForm() 136 | if request.method=='POST': 137 | productForm=forms.ProductForm(request.POST, request.FILES) 138 | if productForm.is_valid(): 139 | productForm.save() 140 | return HttpResponseRedirect('admin-products') 141 | return render(request,'ecom/admin_add_products.html',{'productForm':productForm}) 142 | 143 | 144 | @login_required(login_url='adminlogin') 145 | def delete_product_view(request,pk): 146 | product=models.Product.objects.get(id=pk) 147 | product.delete() 148 | return redirect('admin-products') 149 | 150 | 151 | @login_required(login_url='adminlogin') 152 | def update_product_view(request,pk): 153 | product=models.Product.objects.get(id=pk) 154 | productForm=forms.ProductForm(instance=product) 155 | if request.method=='POST': 156 | productForm=forms.ProductForm(request.POST,request.FILES,instance=product) 157 | if productForm.is_valid(): 158 | productForm.save() 159 | return redirect('admin-products') 160 | return render(request,'ecom/admin_update_product.html',{'productForm':productForm}) 161 | 162 | 163 | @login_required(login_url='adminlogin') 164 | def admin_view_booking_view(request): 165 | orders=models.Orders.objects.all() 166 | ordered_products=[] 167 | ordered_bys=[] 168 | for order in orders: 169 | ordered_product=models.Product.objects.all().filter(id=order.product.id) 170 | ordered_by=models.Customer.objects.all().filter(id = order.customer.id) 171 | ordered_products.append(ordered_product) 172 | ordered_bys.append(ordered_by) 173 | return render(request,'ecom/admin_view_booking.html',{'data':zip(ordered_products,ordered_bys,orders)}) 174 | 175 | 176 | @login_required(login_url='adminlogin') 177 | def delete_order_view(request,pk): 178 | order=models.Orders.objects.get(id=pk) 179 | order.delete() 180 | return redirect('admin-view-booking') 181 | 182 | # for changing status of order (pending,delivered...) 183 | @login_required(login_url='adminlogin') 184 | def update_order_view(request,pk): 185 | order=models.Orders.objects.get(id=pk) 186 | orderForm=forms.OrderForm(instance=order) 187 | if request.method=='POST': 188 | orderForm=forms.OrderForm(request.POST,instance=order) 189 | if orderForm.is_valid(): 190 | orderForm.save() 191 | return redirect('admin-view-booking') 192 | return render(request,'ecom/update_order.html',{'orderForm':orderForm}) 193 | 194 | 195 | # admin view the feedback 196 | @login_required(login_url='adminlogin') 197 | def view_feedback_view(request): 198 | feedbacks=models.Feedback.objects.all().order_by('-id') 199 | return render(request,'ecom/view_feedback.html',{'feedbacks':feedbacks}) 200 | 201 | 202 | 203 | #--------------------------------------------------------------------------------- 204 | #------------------------ PUBLIC CUSTOMER RELATED VIEWS START --------------------- 205 | #--------------------------------------------------------------------------------- 206 | def search_view(request): 207 | # whatever user write in search box we get in query 208 | query = request.GET['query'] 209 | products=models.Product.objects.all().filter(name__icontains=query) 210 | if 'product_ids' in request.COOKIES: 211 | product_ids = request.COOKIES['product_ids'] 212 | counter=product_ids.split('|') 213 | product_count_in_cart=len(set(counter)) 214 | else: 215 | product_count_in_cart=0 216 | 217 | # word variable will be shown in html when user click on search button 218 | word="Searched Result :" 219 | 220 | if request.user.is_authenticated: 221 | return render(request,'ecom/customer_home.html',{'products':products,'word':word,'product_count_in_cart':product_count_in_cart}) 222 | return render(request,'ecom/index.html',{'products':products,'word':word,'product_count_in_cart':product_count_in_cart}) 223 | 224 | 225 | # any one can add product to cart, no need of signin 226 | def add_to_cart_view(request,pk): 227 | products=models.Product.objects.all() 228 | 229 | #for cart counter, fetching products ids added by customer from cookies 230 | if 'product_ids' in request.COOKIES: 231 | product_ids = request.COOKIES['product_ids'] 232 | counter=product_ids.split('|') 233 | product_count_in_cart=len(set(counter)) 234 | else: 235 | product_count_in_cart=1 236 | 237 | response = render(request, 'ecom/index.html',{'products':products,'product_count_in_cart':product_count_in_cart}) 238 | 239 | #adding product id to cookies 240 | if 'product_ids' in request.COOKIES: 241 | product_ids = request.COOKIES['product_ids'] 242 | if product_ids=="": 243 | product_ids=str(pk) 244 | else: 245 | product_ids=product_ids+"|"+str(pk) 246 | response.set_cookie('product_ids', product_ids) 247 | else: 248 | response.set_cookie('product_ids', pk) 249 | 250 | product=models.Product.objects.get(id=pk) 251 | messages.info(request, product.name + ' added to cart successfully!') 252 | 253 | return response 254 | 255 | 256 | 257 | # for checkout of cart 258 | def cart_view(request): 259 | #for cart counter 260 | if 'product_ids' in request.COOKIES: 261 | product_ids = request.COOKIES['product_ids'] 262 | counter=product_ids.split('|') 263 | product_count_in_cart=len(set(counter)) 264 | else: 265 | product_count_in_cart=0 266 | 267 | # fetching product details from db whose id is present in cookie 268 | products=None 269 | total=0 270 | if 'product_ids' in request.COOKIES: 271 | product_ids = request.COOKIES['product_ids'] 272 | if product_ids != "": 273 | product_id_in_cart=product_ids.split('|') 274 | products=models.Product.objects.all().filter(id__in = product_id_in_cart) 275 | 276 | #for total price shown in cart 277 | for p in products: 278 | total=total+p.price 279 | return render(request,'ecom/cart.html',{'products':products,'total':total,'product_count_in_cart':product_count_in_cart}) 280 | 281 | 282 | def remove_from_cart_view(request,pk): 283 | #for counter in cart 284 | if 'product_ids' in request.COOKIES: 285 | product_ids = request.COOKIES['product_ids'] 286 | counter=product_ids.split('|') 287 | product_count_in_cart=len(set(counter)) 288 | else: 289 | product_count_in_cart=0 290 | 291 | # removing product id from cookie 292 | total=0 293 | if 'product_ids' in request.COOKIES: 294 | product_ids = request.COOKIES['product_ids'] 295 | product_id_in_cart=product_ids.split('|') 296 | product_id_in_cart=list(set(product_id_in_cart)) 297 | product_id_in_cart.remove(str(pk)) 298 | products=models.Product.objects.all().filter(id__in = product_id_in_cart) 299 | #for total price shown in cart after removing product 300 | for p in products: 301 | total=total+p.price 302 | 303 | # for update coookie value after removing product id in cart 304 | value="" 305 | for i in range(len(product_id_in_cart)): 306 | if i==0: 307 | value=value+product_id_in_cart[0] 308 | else: 309 | value=value+"|"+product_id_in_cart[i] 310 | response = render(request, 'ecom/cart.html',{'products':products,'total':total,'product_count_in_cart':product_count_in_cart}) 311 | if value=="": 312 | response.delete_cookie('product_ids') 313 | response.set_cookie('product_ids',value) 314 | return response 315 | 316 | 317 | def send_feedback_view(request): 318 | feedbackForm=forms.FeedbackForm() 319 | if request.method == 'POST': 320 | feedbackForm = forms.FeedbackForm(request.POST) 321 | if feedbackForm.is_valid(): 322 | feedbackForm.save() 323 | return render(request, 'ecom/feedback_sent.html') 324 | return render(request, 'ecom/send_feedback.html', {'feedbackForm':feedbackForm}) 325 | 326 | 327 | #--------------------------------------------------------------------------------- 328 | #------------------------ CUSTOMER RELATED VIEWS START ------------------------------ 329 | #--------------------------------------------------------------------------------- 330 | @login_required(login_url='customerlogin') 331 | @user_passes_test(is_customer) 332 | def customer_home_view(request): 333 | products=models.Product.objects.all() 334 | if 'product_ids' in request.COOKIES: 335 | product_ids = request.COOKIES['product_ids'] 336 | counter=product_ids.split('|') 337 | product_count_in_cart=len(set(counter)) 338 | else: 339 | product_count_in_cart=0 340 | return render(request,'ecom/customer_home.html',{'products':products,'product_count_in_cart':product_count_in_cart}) 341 | 342 | 343 | 344 | # shipment address before placing order 345 | @login_required(login_url='customerlogin') 346 | def customer_address_view(request): 347 | # this is for checking whether product is present in cart or not 348 | # if there is no product in cart we will not show address form 349 | product_in_cart=False 350 | if 'product_ids' in request.COOKIES: 351 | product_ids = request.COOKIES['product_ids'] 352 | if product_ids != "": 353 | product_in_cart=True 354 | #for counter in cart 355 | if 'product_ids' in request.COOKIES: 356 | product_ids = request.COOKIES['product_ids'] 357 | counter=product_ids.split('|') 358 | product_count_in_cart=len(set(counter)) 359 | else: 360 | product_count_in_cart=0 361 | 362 | addressForm = forms.AddressForm() 363 | if request.method == 'POST': 364 | addressForm = forms.AddressForm(request.POST) 365 | if addressForm.is_valid(): 366 | # here we are taking address, email, mobile at time of order placement 367 | # we are not taking it from customer account table because 368 | # these thing can be changes 369 | email = addressForm.cleaned_data['Email'] 370 | mobile=addressForm.cleaned_data['Mobile'] 371 | address = addressForm.cleaned_data['Address'] 372 | #for showing total price on payment page.....accessing id from cookies then fetching price of product from db 373 | total=0 374 | if 'product_ids' in request.COOKIES: 375 | product_ids = request.COOKIES['product_ids'] 376 | if product_ids != "": 377 | product_id_in_cart=product_ids.split('|') 378 | products=models.Product.objects.all().filter(id__in = product_id_in_cart) 379 | for p in products: 380 | total=total+p.price 381 | 382 | response = render(request, 'ecom/payment.html',{'total':total}) 383 | response.set_cookie('email',email) 384 | response.set_cookie('mobile',mobile) 385 | response.set_cookie('address',address) 386 | return response 387 | return render(request,'ecom/customer_address.html',{'addressForm':addressForm,'product_in_cart':product_in_cart,'product_count_in_cart':product_count_in_cart}) 388 | 389 | 390 | 391 | 392 | # here we are just directing to this view...actually we have to check whther payment is successful or not 393 | #then only this view should be accessed 394 | @login_required(login_url='customerlogin') 395 | def payment_success_view(request): 396 | # Here we will place order | after successful payment 397 | # we will fetch customer mobile, address, Email 398 | # we will fetch product id from cookies then respective details from db 399 | # then we will create order objects and store in db 400 | # after that we will delete cookies because after order placed...cart should be empty 401 | customer=models.Customer.objects.get(user_id=request.user.id) 402 | products=None 403 | email=None 404 | mobile=None 405 | address=None 406 | if 'product_ids' in request.COOKIES: 407 | product_ids = request.COOKIES['product_ids'] 408 | if product_ids != "": 409 | product_id_in_cart=product_ids.split('|') 410 | products=models.Product.objects.all().filter(id__in = product_id_in_cart) 411 | # Here we get products list that will be ordered by one customer at a time 412 | 413 | # these things can be change so accessing at the time of order... 414 | if 'email' in request.COOKIES: 415 | email=request.COOKIES['email'] 416 | if 'mobile' in request.COOKIES: 417 | mobile=request.COOKIES['mobile'] 418 | if 'address' in request.COOKIES: 419 | address=request.COOKIES['address'] 420 | 421 | # here we are placing number of orders as much there is a products 422 | # suppose if we have 5 items in cart and we place order....so 5 rows will be created in orders table 423 | # there will be lot of redundant data in orders table...but its become more complicated if we normalize it 424 | for product in products: 425 | models.Orders.objects.get_or_create(customer=customer,product=product,status='Pending',email=email,mobile=mobile,address=address) 426 | 427 | # after order placed cookies should be deleted 428 | response = render(request,'ecom/payment_success.html') 429 | response.delete_cookie('product_ids') 430 | response.delete_cookie('email') 431 | response.delete_cookie('mobile') 432 | response.delete_cookie('address') 433 | return response 434 | 435 | 436 | 437 | 438 | @login_required(login_url='customerlogin') 439 | @user_passes_test(is_customer) 440 | def my_order_view(request): 441 | customer=models.Customer.objects.get(user_id=request.user.id) 442 | orders=models.Orders.objects.all().filter(customer_id = customer) 443 | ordered_products=[] 444 | for order in orders: 445 | ordered_product=models.Product.objects.all().filter(id=order.product.id) 446 | ordered_products.append(ordered_product) 447 | 448 | return render(request,'ecom/my_order.html',{'data':zip(ordered_products,orders)}) 449 | 450 | 451 | 452 | 453 | #--------------for discharge patient bill (pdf) download and printing 454 | import io 455 | from xhtml2pdf import pisa 456 | from django.template.loader import get_template 457 | from django.template import Context 458 | from django.http import HttpResponse 459 | 460 | 461 | def render_to_pdf(template_src, context_dict): 462 | template = get_template(template_src) 463 | html = template.render(context_dict) 464 | result = io.BytesIO() 465 | pdf = pisa.pisaDocument(io.BytesIO(html.encode("ISO-8859-1")), result) 466 | if not pdf.err: 467 | return HttpResponse(result.getvalue(), content_type='application/pdf') 468 | return 469 | 470 | @login_required(login_url='customerlogin') 471 | @user_passes_test(is_customer) 472 | def download_invoice_view(request,orderID,productID): 473 | order=models.Orders.objects.get(id=orderID) 474 | product=models.Product.objects.get(id=productID) 475 | mydict={ 476 | 'orderDate':order.order_date, 477 | 'customerName':request.user, 478 | 'customerEmail':order.email, 479 | 'customerMobile':order.mobile, 480 | 'shipmentAddress':order.address, 481 | 'orderStatus':order.status, 482 | 483 | 'productName':product.name, 484 | 'productImage':product.product_image, 485 | 'productPrice':product.price, 486 | 'productDescription':product.description, 487 | 488 | 489 | } 490 | return render_to_pdf('ecom/download_invoice.html',mydict) 491 | 492 | 493 | 494 | 495 | 496 | 497 | @login_required(login_url='customerlogin') 498 | @user_passes_test(is_customer) 499 | def my_profile_view(request): 500 | customer=models.Customer.objects.get(user_id=request.user.id) 501 | return render(request,'ecom/my_profile.html',{'customer':customer}) 502 | 503 | 504 | @login_required(login_url='customerlogin') 505 | @user_passes_test(is_customer) 506 | def edit_profile_view(request): 507 | customer=models.Customer.objects.get(user_id=request.user.id) 508 | user=models.User.objects.get(id=customer.user_id) 509 | userForm=forms.CustomerUserForm(instance=user) 510 | customerForm=forms.CustomerForm(request.FILES,instance=customer) 511 | mydict={'userForm':userForm,'customerForm':customerForm} 512 | if request.method=='POST': 513 | userForm=forms.CustomerUserForm(request.POST,instance=user) 514 | customerForm=forms.CustomerForm(request.POST,instance=customer) 515 | if userForm.is_valid() and customerForm.is_valid(): 516 | user=userForm.save() 517 | user.set_password(user.password) 518 | user.save() 519 | customerForm.save() 520 | return HttpResponseRedirect('my-profile') 521 | return render(request,'ecom/edit_profile.html',context=mydict) 522 | 523 | 524 | 525 | #--------------------------------------------------------------------------------- 526 | #------------------------ ABOUT US AND CONTACT US VIEWS START -------------------- 527 | #--------------------------------------------------------------------------------- 528 | def aboutus_view(request): 529 | return render(request,'ecom/aboutus.html') 530 | 531 | def contactus_view(request): 532 | sub = forms.ContactusForm() 533 | if request.method == 'POST': 534 | sub = forms.ContactusForm(request.POST) 535 | if sub.is_valid(): 536 | email = sub.cleaned_data['Email'] 537 | name=sub.cleaned_data['Name'] 538 | message = sub.cleaned_data['Message'] 539 | send_mail(str(name)+' || '+str(email),message, settings.EMAIL_HOST_USER, settings.EMAIL_RECEIVING_USER, fail_silently = False) 540 | return render(request, 'ecom/contactussuccess.html') 541 | return render(request, 'ecom/contactus.html', {'form':sub}) 542 | -------------------------------------------------------------------------------- /ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tigercoder0218/Ecommerce/a2d4a918ae843d2ac66fbb89a3f0e6d60df47b4a/ecommerce/__init__.py -------------------------------------------------------------------------------- /ecommerce/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tigercoder0218/Ecommerce/a2d4a918ae843d2ac66fbb89a3f0e6d60df47b4a/ecommerce/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /ecommerce/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tigercoder0218/Ecommerce/a2d4a918ae843d2ac66fbb89a3f0e6d60df47b4a/ecommerce/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /ecommerce/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for ecommerce project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ecommerce.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /ecommerce/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for ecommerce project. 3 | 4 | Generated by 'django-admin startproject' using Django 3.0.5. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/3.0/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | TEMPLATE_DIR = os.path.join(BASE_DIR,'templates') 18 | STATIC_DIR=os.path.join(BASE_DIR,'static') 19 | 20 | 21 | # Quick-start development settings - unsuitable for production 22 | # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ 23 | 24 | # SECURITY WARNING: keep the secret key used in production secret! 25 | SECRET_KEY = '#vw(03o=(9kbvg!&2d5i!2$_58x@_-3l4wujpow6(ym37jxnza' 26 | 27 | # SECURITY WARNING: don't run with debug turned on in production! 28 | DEBUG = True 29 | 30 | ALLOWED_HOSTS = [] 31 | 32 | 33 | # Application definition 34 | 35 | INSTALLED_APPS = [ 36 | 'django.contrib.admin', 37 | 'django.contrib.auth', 38 | 'django.contrib.contenttypes', 39 | 'django.contrib.sessions', 40 | 'django.contrib.messages', 41 | 'django.contrib.staticfiles', 42 | 'ecom', 43 | 'widget_tweaks', 44 | 45 | ] 46 | 47 | MIDDLEWARE = [ 48 | 'django.middleware.security.SecurityMiddleware', 49 | 'django.contrib.sessions.middleware.SessionMiddleware', 50 | 'django.middleware.common.CommonMiddleware', 51 | 'django.middleware.csrf.CsrfViewMiddleware', 52 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 53 | 'django.contrib.messages.middleware.MessageMiddleware', 54 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 55 | 56 | ] 57 | 58 | ROOT_URLCONF = 'ecommerce.urls' 59 | 60 | TEMPLATES = [ 61 | { 62 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 63 | 'DIRS': [TEMPLATE_DIR,], 64 | 'APP_DIRS': True, 65 | 'OPTIONS': { 66 | 'context_processors': [ 67 | 'django.template.context_processors.debug', 68 | 'django.template.context_processors.request', 69 | 'django.contrib.auth.context_processors.auth', 70 | 'django.contrib.messages.context_processors.messages', 71 | ], 72 | }, 73 | }, 74 | ] 75 | 76 | WSGI_APPLICATION = 'ecommerce.wsgi.application' 77 | 78 | 79 | # Database 80 | # https://docs.djangoproject.com/en/3.0/ref/settings/#databases 81 | 82 | DATABASES = { 83 | 'default': { 84 | 'ENGINE': 'django.db.backends.sqlite3', 85 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 86 | } 87 | } 88 | 89 | 90 | # Password validation 91 | # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators 92 | 93 | AUTH_PASSWORD_VALIDATORS = [ 94 | { 95 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 96 | }, 97 | { 98 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 99 | }, 100 | { 101 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 102 | }, 103 | { 104 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 105 | }, 106 | ] 107 | 108 | 109 | # Internationalization 110 | # https://docs.djangoproject.com/en/3.0/topics/i18n/ 111 | 112 | LANGUAGE_CODE = 'en-us' 113 | 114 | TIME_ZONE = 'UTC' 115 | 116 | USE_I18N = True 117 | 118 | USE_L10N = True 119 | 120 | USE_TZ = True 121 | 122 | 123 | # Static files (CSS, JavaScript, Images) 124 | # https://docs.djangoproject.com/en/3.0/howto/static-files/ 125 | 126 | STATIC_URL = '/static/' 127 | 128 | STATICFILES_DIRS=[STATIC_DIR,] 129 | 130 | MEDIA_ROOT=os.path.join(BASE_DIR,'static') 131 | 132 | 133 | 134 | LOGIN_REDIRECT_URL='/afterlogin' 135 | 136 | #for contact us give your gmail id and password 137 | EMAIL_BACKEND ='django.core.mail.backends.smtp.EmailBackend' 138 | EMAIL_HOST = 'smtp.gmail.com' 139 | EMAIL_USE_TLS = True 140 | EMAIL_PORT = 587 141 | EMAIL_HOST_USER = 'from@gmail.com' # this email will be used to send emails 142 | EMAIL_HOST_PASSWORD = 'xyz' # host email password required 143 | # now sign in with your host gmail account in your browser 144 | # open following link and turn it ON 145 | # https://myaccount.google.com/lesssecureapps 146 | # otherwise you will get SMTPAuthenticationError at /contactus 147 | # this process is required because google blocks apps authentication by default 148 | EMAIL_RECEIVING_USER = ['to@gmail.com'] # email on which you will receive messages sent from website 149 | -------------------------------------------------------------------------------- /ecommerce/urls.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | Developed By : sumit kumar 4 | facebook : fb.com/sumit.luv 5 | Youtube :youtube.com/lazycoders 6 | 7 | 8 | """ 9 | from django.contrib import admin 10 | from django.urls import path 11 | from ecom import views 12 | from django.contrib.auth.views import LoginView,LogoutView 13 | urlpatterns = [ 14 | path('admin/', admin.site.urls), 15 | path('',views.home_view,name=''), 16 | path('afterlogin', views.afterlogin_view,name='afterlogin'), 17 | path('logout', LogoutView.as_view(template_name='ecom/logout.html'),name='logout'), 18 | path('aboutus', views.aboutus_view), 19 | path('contactus', views.contactus_view,name='contactus'), 20 | path('search', views.search_view,name='search'), 21 | path('send-feedback', views.send_feedback_view,name='send-feedback'), 22 | path('view-feedback', views.view_feedback_view,name='view-feedback'), 23 | 24 | path('adminclick', views.adminclick_view), 25 | path('adminlogin', LoginView.as_view(template_name='ecom/adminlogin.html'),name='adminlogin'), 26 | path('admin-dashboard', views.admin_dashboard_view,name='admin-dashboard'), 27 | 28 | path('view-customer', views.view_customer_view,name='view-customer'), 29 | path('delete-customer/', views.delete_customer_view,name='delete-customer'), 30 | path('update-customer/', views.update_customer_view,name='update-customer'), 31 | 32 | path('admin-products', views.admin_products_view,name='admin-products'), 33 | path('admin-add-product', views.admin_add_product_view,name='admin-add-product'), 34 | path('delete-product/', views.delete_product_view,name='delete-product'), 35 | path('update-product/', views.update_product_view,name='update-product'), 36 | 37 | path('admin-view-booking', views.admin_view_booking_view,name='admin-view-booking'), 38 | path('delete-order/', views.delete_order_view,name='delete-order'), 39 | path('update-order/', views.update_order_view,name='update-order'), 40 | 41 | 42 | path('customersignup', views.customer_signup_view), 43 | path('customerlogin', LoginView.as_view(template_name='ecom/customerlogin.html'),name='customerlogin'), 44 | path('customer-home', views.customer_home_view,name='customer-home'), 45 | path('my-order', views.my_order_view,name='my-order'), 46 | path('my-profile', views.my_profile_view,name='my-profile'), 47 | path('edit-profile', views.edit_profile_view,name='edit-profile'), 48 | path('download-invoice//', views.download_invoice_view,name='download-invoice'), 49 | 50 | 51 | path('add-to-cart/', views.add_to_cart_view,name='add-to-cart'), 52 | path('cart', views.cart_view,name='cart'), 53 | path('remove-from-cart/', views.remove_from_cart_view,name='remove-from-cart'), 54 | path('customer-address', views.customer_address_view,name='customer-address'), 55 | path('payment-success', views.payment_success_view,name='payment-success'), 56 | 57 | 58 | ] 59 | -------------------------------------------------------------------------------- /ecommerce/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for ecommerce project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ecommerce.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ecommerce.settings') 9 | try: 10 | from django.core.management import execute_from_command_line 11 | except ImportError as exc: 12 | raise ImportError( 13 | "Couldn't import Django. Are you sure it's installed and " 14 | "available on your PYTHONPATH environment variable? Did you " 15 | "forget to activate a virtual environment?" 16 | ) from exc 17 | execute_from_command_line(sys.argv) 18 | 19 | 20 | if __name__ == '__main__': 21 | main() 22 | -------------------------------------------------------------------------------- /requirement.txt: -------------------------------------------------------------------------------- 1 | Django==3.0.5 2 | django-widget-tweaks==1.4.8 3 | sqlparse==0.3.1 4 | -------------------------------------------------------------------------------- /static/images/logout_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tigercoder0218/Ecommerce/a2d4a918ae843d2ac66fbb89a3f0e6d60df47b4a/static/images/logout_img.png -------------------------------------------------------------------------------- /static/images/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tigercoder0218/Ecommerce/a2d4a918ae843d2ac66fbb89a3f0e6d60df47b4a/static/images/success.png -------------------------------------------------------------------------------- /static/screenshots/adminHomepage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tigercoder0218/Ecommerce/a2d4a918ae843d2ac66fbb89a3f0e6d60df47b4a/static/screenshots/adminHomepage.png -------------------------------------------------------------------------------- /static/screenshots/cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tigercoder0218/Ecommerce/a2d4a918ae843d2ac66fbb89a3f0e6d60df47b4a/static/screenshots/cart.png -------------------------------------------------------------------------------- /static/screenshots/customerhomepage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tigercoder0218/Ecommerce/a2d4a918ae843d2ac66fbb89a3f0e6d60df47b4a/static/screenshots/customerhomepage.png -------------------------------------------------------------------------------- /static/screenshots/orderspage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tigercoder0218/Ecommerce/a2d4a918ae843d2ac66fbb89a3f0e6d60df47b4a/static/screenshots/orderspage.png -------------------------------------------------------------------------------- /templates/ecom/aboutus.html: -------------------------------------------------------------------------------- 1 | 2 | {% load static %} 3 | 4 | 5 | 6 | 7 | 8 | LazyCoder || sumit 9 | 10 | sumit 11 | 16 | 17 | 18 | 19 | {%if request.user.is_authenticated%} 20 | {% include "ecom/customer_navbar.html" %} 21 | {%else%} 22 | {% include "ecom/navbar.html" %} 23 | {%endif%} 24 |


25 |

“I don’t create companies for the sake of creating companies, but to get things done.”

26 |

















27 | {% include "ecom/footer.html" %} 28 | 29 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /templates/ecom/admin_add_products.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/admin_base.html' %} 2 | {% load widget_tweaks %} 3 | {% block content %} 4 | 5 | 6 | 44 | 45 | 46 | 47 | 48 | 49 |





50 | 51 |
52 | {% csrf_token %} 53 |
54 |
55 |
56 |

ADD PRODUCTS

57 |
58 |
59 |
60 |
61 |
62 | {% render_field productForm.name class="form-control" placeholder="Product Name" %} 63 |
64 |
65 | {% render_field productForm.description class="form-control" placeholder="Description" %} 66 |
67 | 68 |
69 |
70 |
71 | {% render_field productForm.price class="form-control" placeholder="Price" %} 72 |
73 |
74 | {% render_field productForm.product_image class="form-control" placeholder="product_image" %} 75 |
76 | 77 | 78 |
79 |
80 | 81 |
82 |
83 |
84 |
85 | 90 | 91 | {% endblock content %} 92 | -------------------------------------------------------------------------------- /templates/ecom/admin_base.html: -------------------------------------------------------------------------------- 1 | 2 | {% load static %} 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 78 | 79 | 80 | 81 | 82 | 83 | 84 |
85 | 105 |
106 | 107 | 108 | {% block content %} 109 | 110 | {% endblock content %} 111 | 112 |







113 |
114 |

115 | 116 | 117 | 118 | 119 |

120 | 121 |
122 |
123 |
124 |
125 | 129 |
130 |
131 |
132 |
133 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /templates/ecom/admin_dashboard.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/admin_base.html' %} 2 | {% load static %} 3 | {% block content %} 4 |
5 | {%include 'ecom/admin_dashboard_cards.html'%} 6 |




7 | 8 |

9 |
10 | 11 |
12 |
13 |
Recent Booking
14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | {% for product,customer,order in data %} 28 | 29 | {% for c in customer %} 30 | 31 | 32 | 33 | 34 | {% endfor %} 35 | {% for p in product %} 36 | 37 | 38 | 39 | {% if order.status == 'Pending'%} 40 | 41 | {% elif order.status == 'Delivered' %} 42 | 43 | {% elif order.status == 'Out for Delivery' %} 44 | 45 | {%else%} 46 | 47 | {%endif%} 48 | {% endfor %} 49 | 50 | {% endfor %} 51 | 52 | 53 | 54 | 55 | 56 |
Customer NameCustomer MobileShipment AddressProduct NameProduct PictureStatus
{{c.get_name}}{{c.mobile}}{{order.address}} {{p.name}} Profile Pic {{order.status}} {{order.status}} {{order.status}} {{order.status}}
57 | 58 |
59 |
60 | 61 | 62 | {% endblock content %} 63 | -------------------------------------------------------------------------------- /templates/ecom/admin_dashboard_cards.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 |
140 |
141 |
142 |
143 |

{{customercount}}

144 |

Total Customer

145 | 146 |
147 |
148 | 149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |

{{productcount}}

157 |

Total Product

158 | 159 |
160 |
161 | 162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |

{{ordercount}}

170 |

Total Orders

171 | 172 |
173 |
174 | 175 |
176 |
177 |
178 |
179 | 180 |
181 |

182 | 183 | 188 | 189 | 190 | -------------------------------------------------------------------------------- /templates/ecom/admin_products.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/admin_base.html' %} 2 | {% load static %} 3 | {% block content %} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 41 | 42 | 46 | 47 | 48 |
49 |
50 |
51 |
Total Product List
52 |
53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | {% for p in products %} 65 | {% if p %} 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | {%else%} 77 |


78 |

no products

79 | {% endif %} 80 | {% endfor %} 81 |
NameImagePriceDescriptionUpdateDelete
{{p.name}} Profile Pic{{p.price}}{{p.description}}
82 |
83 |
84 | 85 | 86 | 87 | 88 | 93 | {% endblock content %} 94 | -------------------------------------------------------------------------------- /templates/ecom/admin_update_customer.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/admin_base.html' %} 2 | {% load widget_tweaks %} 3 | {% block content %} 4 | 5 | 6 | 44 | 45 | 46 | 47 | 48 | 49 |





50 | 51 |
52 | {% csrf_token %} 53 |
54 |
55 |
56 |

Update Customer Details

57 |
58 |
59 |
60 |
61 |
62 | {% render_field userForm.first_name class="form-control" placeholder="First Name" %} 63 |
64 |
65 | {% render_field userForm.username class="form-control" placeholder="Username" %} 66 |
67 |
68 | {% render_field customerForm.mobile class="form-control" placeholder="Mobile" %} 69 |
70 |
71 | {% render_field customerForm.profile_pic class="form-control" placeholder="Profile Picture" %} 72 |
73 |
74 |
75 |
76 | {% render_field userForm.last_name class="form-control" placeholder="Last Name" %} 77 |
78 |
79 | {% render_field userForm.password class="form-control" placeholder="Password" %} 80 |
81 |
82 | {% render_field customerForm.address class="form-control" placeholder="Address" %} 83 |
84 | 85 |
86 |
87 | 88 |
89 |
90 |
91 |
92 | 97 | 98 | {% endblock content %} 99 | -------------------------------------------------------------------------------- /templates/ecom/admin_update_product.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/admin_base.html' %} 2 | {% load widget_tweaks %} 3 | {% block content %} 4 | 5 | 6 | 44 | 45 | 46 | 47 | 48 | 49 |





50 | 51 |
52 | {% csrf_token %} 53 |
54 |
55 |
56 |

Update Product Details

57 |
58 |
59 |
60 |
61 |
62 | {% render_field productForm.name class="form-control" placeholder="Product Name" %} 63 |
64 |
65 | {% render_field productForm.description class="form-control" placeholder="Description" %} 66 |
67 |
68 |
69 |
70 | {% render_field productForm.price class="form-control" placeholder="Price" %} 71 |
72 |
73 | {% render_field productForm.product_image class="form-control" placeholder="product_image" %} 74 |
75 | 76 | 77 |
78 |
79 | 80 |
81 |
82 |
83 |
84 | 89 | 90 | {% endblock content %} 91 | -------------------------------------------------------------------------------- /templates/ecom/admin_view_booking.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/admin_base.html' %} 2 | {% load static %} 3 | {% block content %} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 | 29 |
30 |
31 |
32 |
Total Orders
33 |
34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | {% for product,customer,order in data %} 49 | 50 | {% for c in customer %} 51 | 52 | 53 | 54 | 55 | {% endfor %} 56 | {% for p in product %} 57 | 58 | 59 | 60 | 61 | 62 | 63 | {% endfor %} 64 | 65 | 66 | 67 | 68 | {% endfor %} 69 |
Customer NameCustomer MobileShipment AddressProduct NameProduct PictureStatusUpdate StatusDelete
{{c.get_name}}{{c.mobile}}{{order.address}} {{p.name}} Profile Pic{{order.status}}
70 |
71 |
72 | 77 | {% endblock content %} 78 | -------------------------------------------------------------------------------- /templates/ecom/adminlogin.html: -------------------------------------------------------------------------------- 1 | 2 | {% load widget_tweaks %} 3 | 4 | 5 | 6 | 7 | 77 | 78 | 79 | {% include "ecom/navbar.html" %} 80 |
81 |
82 |
83 |
84 |
85 | {% csrf_token %} 86 |

Admin Login

87 |

Please enter your login and password!

88 | 89 | {% render_field form.username class="form-control" placeholder="Username" %} 90 | {% render_field form.password class="form-control" placeholder="Password" %} 91 | 92 | 93 | 94 |
95 |
96 |
97 |
98 |
99 |








100 |








101 |








102 | {% include "ecom/footer.html" %} 103 | 104 | 105 | -------------------------------------------------------------------------------- /templates/ecom/cart.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/homebase.html' %} 2 | {% load static %} 3 | {% block content %} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 63 | 64 | 65 | 69 |



70 | 71 |
72 |
73 |
74 |
My Cart
75 |
76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | {% for p in products %} 88 | {% if p %} 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | {%else%} 100 |


101 |

no products

102 | {% endif %} 103 | {% endfor %} 104 |
NameImagePriceDescriptionRemove From Cart
{{p.name}} Profile Pic{{p.price}}{{p.description}}
105 |
106 |
107 |


108 |
109 | 110 | 111 |
112 | 113 | 114 |




115 | 120 | {% endblock content %} 121 | -------------------------------------------------------------------------------- /templates/ecom/contactus.html: -------------------------------------------------------------------------------- 1 | 2 | {% load static %} 3 | 4 | 5 | 6 | 7 | 8 | LazyCoder || sumit 9 | 10 | 11 | 12 | 13 | 14 | 15 | {%if request.user.is_authenticated%} 16 | {% include "ecom/customer_navbar.html" %} 17 | {%else%} 18 | {% include "ecom/navbar.html" %} 19 | {%endif%} 20 | 21 |
22 |

Send Us Your Valuable Feedback !

23 | 24 |
25 | 26 | {% csrf_token %} 27 |
28 |

29 |

{{ form.as_p }}

30 |

31 |
32 | 33 |
34 |
35 |
36 | {% include "ecom/footer.html" %} 37 | 38 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /templates/ecom/contactussuccess.html: -------------------------------------------------------------------------------- 1 | 2 | {% load static %} 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | LazyCoder || sumit 11 | 20 | 21 | 22 | 23 | 24 | 25 | {% include "ecom/navbar.html" %} 26 |

27 |
28 |

Your message sent successfully !

29 |

We will respond to your feedback soon

30 |
31 |

Check other features of website !

32 |

33 | HOME 34 |

35 |
36 | 37 | {% include "ecom/footer.html" %} 38 | 39 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /templates/ecom/customer_address.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/customer_base.html' %} 2 | {% load static %} 3 | {% load widget_tweaks %} 4 | {% block content %} 5 | 6 | 91 | {%if product_in_cart%} 92 |
93 | {% csrf_token %} 94 |
    95 |
  • 96 | 97 | {% render_field addressForm.Email class="field-long" placeholder="Email" %} 98 | 99 |
  • 100 |
  • 101 | 102 | {% render_field addressForm.Mobile class="field-long" placeholder="Mobile" %} 103 |
  • 104 | 105 |
  • 106 | 107 | {% render_field addressForm.Address id="field5" class="field-long field-textarea" placeholder="Building Number,city, pin" %} 108 | 109 |
  • 110 |
  • 111 | 112 |
  • 113 |
114 |
115 | {%else%} 116 |

117 |

First Add Product In Cart

118 |









119 | {%endif%} 120 | 121 | {% endblock content %} 122 | -------------------------------------------------------------------------------- /templates/ecom/customer_base.html: -------------------------------------------------------------------------------- 1 | 2 | {% load static %} 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 248 | 249 | 250 | 291 | 292 | {% block content %} 293 | 294 | {% endblock content %} 295 | 296 |


297 |
298 |

299 | 300 | 301 | 302 | 303 |

304 | 305 |
306 |
307 |
308 |
309 | 313 |
314 |
315 |
316 |
317 | 334 | 335 | 336 | 337 | -------------------------------------------------------------------------------- /templates/ecom/customer_home.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/customer_base.html' %} 2 | {% load static %} 3 | {% block content %} 4 | 5 | 6 | 7 | 311 | 312 | 313 | 314 | 315 | {%if products%} 316 |

{{word}}

317 |
318 | 319 |
320 | 321 | {% for p in products %} 322 | 323 |
324 |
325 |
326 |
327 |
328 |
329 | product pic 330 |
331 |
332 | {{p.name}} 333 | 334 |
335 |
{{p.description}}
336 |
337 |
338 | 339 | 351 |
352 |
353 |
354 |
355 |
356 | 357 | {% if forloop.counter|divisibleby:"3" %} 358 |
359 |
360 |




361 | {% endif %} 362 | 363 | {% endfor %} 364 |
365 | 366 | 367 | 368 | {%else%} 369 |

No Search Found

370 | {%endif%} 371 | 372 | 379 |


380 |











381 | 382 | 383 | 388 | 389 | 390 | 391 | {% endblock content %} 392 | -------------------------------------------------------------------------------- /templates/ecom/customer_navbar.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 195 | 196 | 197 | 198 | 199 | 200 | 241 | 242 | 243 | 244 | 261 | 262 | 263 | 264 | 265 | 266 | -------------------------------------------------------------------------------- /templates/ecom/customerlogin.html: -------------------------------------------------------------------------------- 1 | 2 | {% load widget_tweaks %} 3 | 4 | 5 | 6 | sumit 7 | 143 | 144 | 145 | {% include "ecom/navbar.html" %} 146 |
147 |
148 |
149 |
150 |
151 | {% csrf_token %} 152 |

Customer Login

153 |

Please enter your login and password!

154 | {% render_field form.username class="form-control" placeholder="Username" %} 155 | {% render_field form.password class="form-control" placeholder="Password" %} 156 | 157 | 158 |
159 |
160 |
161 |
162 |
163 |








164 |








165 |








166 | {% include "ecom/footer.html" %} 167 | 168 | 169 | -------------------------------------------------------------------------------- /templates/ecom/customersignup.html: -------------------------------------------------------------------------------- 1 | 2 | {% load widget_tweaks %} 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 147 | 148 | 149 | {% include "ecom/navbar.html" %} 150 |
151 |
152 |
153 |
154 |
155 | {% csrf_token %} 156 |

CUSTOMER SIGNUP

157 |

Please enter your details to create account !

158 | {% render_field userForm.first_name class="form-control" placeholder="First Name" %} 159 | {% render_field userForm.last_name class="form-control" placeholder="Last Name" %} 160 | {% render_field userForm.username class="form-control" placeholder="Username" %} 161 | {% render_field userForm.password class="form-control" placeholder="Password" %} 162 | {% render_field customerForm.address class="form-control" placeholder="Address" %} 163 | {% render_field customerForm.mobile class="form-control" placeholder="Mobile" %} 164 | {% render_field customerForm.profile_pic class="form-control" placeholder="Profile pic" %} 165 | 166 | 167 | 168 |
169 |
170 |
171 |
172 |
173 |








174 |








175 |








176 |








177 |




178 | {% include "ecom/footer.html" %} 179 | 180 | 181 | -------------------------------------------------------------------------------- /templates/ecom/download_invoice.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% load static %} 4 | 5 | 6 | 7 | 113 | 114 | 115 | 116 | 117 |


118 |
119 | 120 | 121 | 137 | 138 | 139 | 140 | 158 | 159 | 160 | 161 | 162 | 179 | 180 | 181 | 182 | 183 | 184 | 194 | 195 | 196 | 197 | 198 | 199 | 200 |
122 | 123 | 124 | 127 | 128 | 134 | 135 |
125 |
Ecommerce
126 |
129 | 130 | 131 | Order Date: {{orderDate}}
132 | 133 |
136 |
141 | 142 | 143 | 148 | 149 | 155 | 156 |
144 | Customer Name :
{{customerName}}

145 | Customer Email :
{{customerEmail}} 146 | 147 |
150 | Customer Mobile :
151 | {{customerMobile}}

152 | Shipment Addres :
{{shipmentAddress}} 153 | 154 |
157 |
163 | 164 | 165 | 171 | 175 | 176 | 177 |
166 | Product Image :
167 | Profile Pic

168 | Product Price :
169 | {{productPrice}} 170 |
172 | Product Name:
{{productName}}

173 | Product Description:
{{productDescription}} 174 |
178 |
185 | 186 | 187 | 191 | 192 |
188 | Order Status :

189 | {{orderStatus}} 190 |
193 |
201 |
202 | 203 | 208 | 209 | 210 | -------------------------------------------------------------------------------- /templates/ecom/edit_profile.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/customer_base.html' %} 2 | {% load widget_tweaks %} 3 | {% block content %} 4 | 5 | 6 | 47 | 48 | 49 | 50 |





51 | 52 |
53 | {% csrf_token %} 54 |
55 |
56 |
57 |

EDIT PROFILE

58 |
59 |
60 |
61 |
62 |
63 | {% render_field userForm.first_name class="form-control" placeholder="First Name" %} 64 |
65 |
66 | {% render_field userForm.username class="form-control" placeholder="Username" %} 67 |
68 |
69 | {% render_field customerForm.mobile class="form-control" placeholder="Mobile" %} 70 |
71 |
72 | {% render_field customerForm.profile_pic class="form-control" placeholder="Profile Picture" %} 73 |
74 |
75 |
76 |
77 | {% render_field userForm.last_name class="form-control" placeholder="Last Name" %} 78 |
79 |
80 | {% render_field userForm.password class="form-control" placeholder="Password" %} 81 |
82 |
83 | {% render_field customerForm.address class="form-control" placeholder="Address" %} 84 |
85 | 86 |
87 |
88 | 89 |
90 |
91 |
92 |
93 | 98 | 99 | {% endblock content %} 100 | -------------------------------------------------------------------------------- /templates/ecom/feedback_sent.html: -------------------------------------------------------------------------------- 1 | 2 | {% load static %} 3 | {% load widget_tweaks %} 4 | 5 | 6 | 7 | {%if request.user.is_authenticated%} 8 | {% include "ecom/customer_navbar.html" %} 9 | {%else%} 10 | {% include "ecom/navbar.html" %} 11 | {%endif%} 12 |


13 |

Your Feedback Sent Succesfully !

14 |
15 |
16 | 17 |
18 | 19 |







20 | {% include "ecom/footer.html" %} 21 | 22 | 27 | -------------------------------------------------------------------------------- /templates/ecom/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 62 | 63 | 64 |
65 | 66 |

67 | 68 | 69 | 70 | 71 |

72 | 73 |
74 |
75 |
76 |
77 | 81 |
82 |
83 |
84 |
85 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /templates/ecom/homebase.html: -------------------------------------------------------------------------------- 1 | {% load static %} 2 | 3 | 4 | 5 | 6 | 7 | LazyCoder || sumit 8 | 9 | 10 | 11 | 12 | {%if request.user.is_authenticated%} 13 | {% include "ecom/customer_navbar.html" %} 14 | {%else%} 15 | {% include "ecom/navbar.html" %} 16 | {%endif%} 17 | 18 | 19 | {%block content%} 20 | 21 | {%endblock content%} 22 | 23 | 24 | {% include "ecom/footer.html" %} 25 | 26 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /templates/ecom/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/homebase.html' %} 2 | {% load static %} 3 | {% block content %} 4 | 5 | 309 | 310 | {%if products%} 311 |

{{word}}

312 |
313 | 314 |
315 | 316 | {% for p in products %} 317 | 318 |
319 |
320 |
321 |
322 |
323 |
324 | product pic 325 |
326 |
327 | {{p.name}} 328 | 329 |
330 |
{{p.description}}
331 |
332 |
333 | 334 | 346 |
347 |
348 |
349 |
350 |
351 | 352 | {% if forloop.counter|divisibleby:"3" %} 353 |
354 | 355 |
356 | 357 |




358 | {% endif %} 359 | {% endfor %} 360 |
361 | 362 | {%else%} 363 |

No Search Found

364 | {%endif%} 365 | 366 | 373 |


374 |











375 | 376 | 377 | 382 | 383 | {% endblock content %} 384 | -------------------------------------------------------------------------------- /templates/ecom/logout.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/homebase.html' %} 2 | {% load static %} 3 | {% block content %} 4 |


5 | 6 | 7 |




8 |




9 |


10 | 11 | 16 | 17 | {% endblock content %} 18 | -------------------------------------------------------------------------------- /templates/ecom/my_order.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/customer_base.html' %} 2 | {% load static %} 3 | 4 | {% block content %} 5 | 162 |
163 |

Thank You For Your Order {{request.user}} !



164 |
165 |
My Orders / Tracking
166 | 167 | {% for products,order in data %} 168 | 169 |
170 |
171 |
    172 |
  • 173 |
    174 | {%for product in products%} 175 |
    176 |
    177 | 178 |

    Name : {{product.name}}
    Description : {{product.description}}

    Price : {{product.price}} 179 | 180 |
    181 | 182 |
    183 |
  • 184 |
  • 185 |
    Shipment Address:
    {{order.address}}
    186 |
  • 187 |
  • 188 |
    Status:
    {{order.status}}

    189 |

    Download Invoice

    190 |
  • 191 | {%endfor%} 192 |
193 |
194 | 195 |
196 | {%if order.status == 'Pending' %} 197 |
Order Pending
198 |
Order Confirmed
199 |
On the way
200 |
Delivered
201 | {%elif order.status == 'Order Confirmed' %} 202 |
Order Pending
203 |
Order Confirmed
204 |
On the way
205 |
Delivered
206 | {%elif order.status == 'Out for Delivery'%} 207 |
Order Pending
208 |
Order Confirmed
209 |
On the way
210 |
Delivered
211 | {%else%} 212 |
Order Pending
213 |
Order Confirmed
214 |
On the way
215 |
Delivered
216 | {%endif%} 217 |
218 | 219 |
220 |

221 | {%endfor%} 222 |
223 |




224 | {% endblock content %} 225 | -------------------------------------------------------------------------------- /templates/ecom/my_profile.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/customer_base.html' %} 2 | {% load static %} 3 | {% block content %} 4 | 5 | 6 | 52 |


53 |
54 | 55 |
56 | profile pic 57 |
58 |
59 |
60 |

{{request.user}}

{{customer.address}} 61 |
62 |

{{customer.mobile}} 63 |

64 |
65 | 66 |
67 |
68 |
69 | 70 |
71 |





72 | 77 | 78 | 79 | 80 | {% endblock content %} 81 | -------------------------------------------------------------------------------- /templates/ecom/navbar.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 189 | 190 | 191 | 237 | 238 | 255 | 256 | 257 | 258 | -------------------------------------------------------------------------------- /templates/ecom/payment.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/customer_base.html' %} 2 | {% load static %} 3 | 4 | {% block content %} 5 | 6 | 7 | 8 | 14 |

15 | ITS FAKE PAYMENT PAGE. WE DONOT STORE YOUR DATA 16 | ITS JUST FOR DEMO 17 |

18 |
19 |
20 |
21 |
22 |
23 |

24 | Payment Details 25 |

26 |
27 | 31 |
32 |
33 |
34 |
35 |
36 | 38 |
39 | 41 | 42 |
43 |
44 |
45 |
46 |
47 | 49 |
50 | 51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | 60 | 61 |
62 |
63 |
64 |
65 |
66 |
67 | 71 |
72 | Pay 73 |
74 |
75 |
76 | 77 | 78 | {% endblock content %} 79 | -------------------------------------------------------------------------------- /templates/ecom/payment_success.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/customer_base.html' %} 2 | {% load static %} 3 | 4 | {% block content %} 5 | 42 |
43 | 44 |

Payment Successful !

45 |

We are delighted to inform you that we received your payments

46 | View Orders 47 | Continue Shopping 48 |
49 |



50 |



51 | {% endblock content %} 52 | -------------------------------------------------------------------------------- /templates/ecom/send_feedback.html: -------------------------------------------------------------------------------- 1 | 2 | {% load static %} 3 | {% load widget_tweaks %} 4 | 5 | 6 | 7 | 8 | 9 | LazyCoder || sumit 10 | 95 | 96 | 97 | 98 | 99 | 100 | {%if request.user.is_authenticated%} 101 | {% include "ecom/customer_navbar.html" %} 102 | {%else%} 103 | {% include "ecom/navbar.html" %} 104 | {%endif%} 105 | 106 |
107 |

Send Us Your Valuable Feedback !

108 | 109 | 110 |
111 | {% csrf_token %} 112 |
    113 |
  • 114 | 115 | {% render_field feedbackForm.name class="field-long" %} 116 | 117 |
  • 118 | 119 |
  • 120 | 121 | {% render_field feedbackForm.feedback id="field5" class="field-long field-textarea" %} 122 | 123 |
  • 124 |
  • 125 | 126 |
  • 127 |
128 |
129 | 130 | 131 |
132 | {% include "ecom/footer.html" %} 133 | 134 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /templates/ecom/update_order.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/admin_base.html' %} 2 | {% load widget_tweaks %} 3 | {% block content %} 4 | 5 | 6 | 45 | 46 | 47 | 48 | 49 | 50 |





51 | 52 |
53 | {% csrf_token %} 54 |
55 |
56 |
57 |

Update Status Of Order

58 |
59 |
60 | 61 | {% render_field orderForm.status class="form-control" placeholder="Address" %} 62 |
63 | 64 |
65 |
66 | 67 | 68 |
69 | 74 | 75 | {% endblock content %} 76 | -------------------------------------------------------------------------------- /templates/ecom/view_customer.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/admin_base.html' %} 2 | {% load static %} 3 | {% block content %} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 | 29 |
30 |
31 |
32 |
Total Customer List
33 |
34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | {% for c in customers %} 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | {% endfor %} 56 |
NameProfile PictureMobileAddressUpdateDelete
{{c.get_name}} Profile Pic{{c.mobile}}{{c.address}}
57 |
58 |
59 | 64 | {% endblock content %} 65 | -------------------------------------------------------------------------------- /templates/ecom/view_feedback.html: -------------------------------------------------------------------------------- 1 | {% extends 'ecom/admin_base.html' %} 2 | {% load static %} 3 | {% block content %} 4 | 5 | 6 | 7 | 35 | 36 | 37 | 38 | 42 | 43 |



44 |

Feedbacks By User

45 |
46 | {%for f in feedbacks%} 47 |
48 | × 49 | {{f.date}} ||By : {{f.name}}
{{f.feedback}} 50 |
51 | {%endfor%} 52 | 57 | {% endblock content %} 58 | --------------------------------------------------------------------------------