diff --git a/.DS_Store b/.DS_Store index d889586..478c685 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index db770b9..0541970 100644 --- a/.gitignore +++ b/.gitignore @@ -161,4 +161,6 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ -.DS_Store \ No newline at end of file +.DS_Store + +.idea/ \ No newline at end of file diff --git a/.idea/GreenCart.iml b/.idea/GreenCart.iml index b8425b5..c0ac56c 100644 --- a/.idea/GreenCart.iml +++ b/.idea/GreenCart.iml @@ -16,7 +16,7 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index f8317f1..5d08675 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Auth/.DS_Store b/Auth/.DS_Store index dae8f3e..f8495f4 100644 Binary files a/Auth/.DS_Store and b/Auth/.DS_Store differ diff --git a/Contact/__init__.py b/Contact/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Contact/admin.py b/Contact/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/Contact/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/Contact/apps.py b/Contact/apps.py new file mode 100644 index 0000000..5515301 --- /dev/null +++ b/Contact/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class ContactConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'Contact' diff --git a/Contact/migrations/__init__.py b/Contact/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Contact/models.py b/Contact/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/Contact/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/Contact/tests.py b/Contact/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/Contact/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/Contact/views.py b/Contact/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/Contact/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/GreenCart/settings.py b/GreenCart/settings.py index 354571e..ca97a11 100644 --- a/GreenCart/settings.py +++ b/GreenCart/settings.py @@ -42,7 +42,9 @@ "Auth.apps.AuthConfig", "Shop.apps.ShopConfig", "add_to_cart.apps.AddToCartConfig", - "userprofile.apps.UserprofileConfig" + 'payments.apps.PaymentsConfig', + "userprofile.apps.UserprofileConfig", + "Support" ] MIDDLEWARE = [ @@ -145,3 +147,23 @@ # https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + +EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' +EMAIL_HOST = 'smtp.example.com' +EMAIL_PORT = 587 +EMAIL_USE_TLS = True +EMAIL_HOST_USER = 'support@greencart.com' +EMAIL_HOST_PASSWORD = 'admin' +DEFAULT_FROM_EMAIL = 'support@greencart.com' +# myproject/settings.py + +import os +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + +# Add these lines at the end of your settings.py file +MEDIA_ROOT = os.path.join(BASE_DIR, 'media') +MEDIA_URL = '/media/' + +STRIPE_SECRET_KEY = 'sk_test_51PaOOhRtHtPlgcaiSwH19QRY2pMB1G3HYzLZhI5HnX7GwYt4XBxCJ1U9mE3yyFaVPlYobaM4nF1Qn6wzOC1INrjz00c3EnnK05' +STRIPE_PUBLISHABLE_KEY = 'pk_test_51PaOOhRtHtPlgcaiDlSzoNrhdvbuxI0pjDgLiFgH53Nbch8hjwCNiFIinLLZUUKSA9IhA7dnGyKnBl4qWEI2miDy00H3IE7lGy' \ No newline at end of file diff --git a/GreenCart/urls.py b/GreenCart/urls.py index f3e1e8e..5206cf6 100644 --- a/GreenCart/urls.py +++ b/GreenCart/urls.py @@ -1,20 +1,25 @@ from django.contrib import admin +from django.conf import settings +from django.conf.urls.static import static from django.urls import path, include from django.conf import settings from django.conf.urls.static import static +from payments.views import payment_view, payment_success # Admin site configuration admin.site.index_title = "Welcome to GreenCart Admin Portal" -admin.site.site_title = "GreenCart Admin Portal" -admin.site.site_header = "GreenCart Admin Portal" +admin.site.site_header="GreenCart Admin" +admin.site.site_title ="GreenCart Admin Portal" urlpatterns = [ path('admin/', admin.site.urls), path('', include('GreenCartEcom.urls', 'GreenCartEcom'), name='GreenCartEcom'), path('cart/', include('add_to_cart.urls', 'AddToCart'), name='AddToCart'), - path('auth/', include('Auth.urls', 'Auth'), name='Auth'), - path('shop/', include('Shop.urls', 'Shop'), name='Shop'), - path('profile/', include('userprofile.urls', 'Profile'), name='Profile'), + path('auth/', include('Auth.urls','Auth'), name='Auth'), + path('shop/', include('Shop.urls','Shop'), name='Shop'), + path('profile/', include('userprofile.urls','Profile'), name='Profile'), + path('pay/', include(('payments.urls', 'payments'), namespace='payments')), + path('support/', include('Support.urls'), name='Support') ] if settings.DEBUG: diff --git a/GreenCartEcom/templates/Dashboard/index.html b/GreenCartEcom/templates/Dashboard/index.html index 214ce2c..700e8b6 100644 --- a/GreenCartEcom/templates/Dashboard/index.html +++ b/GreenCartEcom/templates/Dashboard/index.html @@ -5,7 +5,7 @@ - + @@ -51,6 +51,8 @@ function showSlide(index) { slides.forEach((slide, i) => { slide.classList.toggle('hidden', i !== index); + slide.classList.toggle('opacity-100', i === index); + slide.classList.toggle('opacity-0', i !== index); }); } @@ -71,20 +73,34 @@ // Initialize the slider showSlide(currentSlide); + + // Automatically move to the next slide every 5 seconds + setInterval(moveToNextSlide, 5000); - - {% for product in products %} - - - - {{ product.name }} - {{ product.price }} - Add to Cart + + Featured Products + + {% for product in products %} + + {% if product.image.url %} + + + + {% endif %} + + + {{ product.name }} + ${{ product.price }} + + + Add to Cart + + + {% endfor %} - {% endfor %} {% endblock %} diff --git a/GreenCartEcom/templates/Dashboard/navbar.html b/GreenCartEcom/templates/Dashboard/navbar.html index 7a73a36..b8f218d 100644 --- a/GreenCartEcom/templates/Dashboard/navbar.html +++ b/GreenCartEcom/templates/Dashboard/navbar.html @@ -1,78 +1,91 @@ {% load static %} + + {% block title %}{% endblock %} + - - {% include 'alert.html' %} - - - - - - - GreenCart - - - - - Search - - - - - - - Home - Contact - SignIn -{# Cart#} - - + + + {% include 'alert.html' %} + + + + + + + + + + + + Search + + + + + + + + + SignIn + + + - - - {% for category in navCategories %} - {{ category.title }} - {% endfor %} + + + {% for category in navCategories %} + {{ category.title }} + {% endfor %} + - - + - + + {% block content %} {% endblock %} - + - - + +
{{ product.price }}