This commit is contained in:
2024-12-13 08:31:39 +07:00
parent 1ead9da097
commit 5bdf96851e
3554 changed files with 400518 additions and 83328 deletions

View File

@@ -1,7 +1,7 @@
from settings.models import *
from accounts.models import UserProfile
from menus.models import *
from home.models import serviceSection, projectSection
from home.models import serviceSection, projectSection, productSection
from django.conf import settings
# Website Setting Context
@@ -43,6 +43,13 @@ def service_context(request):
'fservices': services,
}
# Product Context Processor
def product_context(request):
products = productSection.objects.all()
return {
'fproducts': products,
}
# Project Context Processor
def project_context(request):
projects = projectSection.objects.all().order_by('?')

View File

@@ -19,7 +19,7 @@ load_env()
SECRET_KEY = 'django-insecure-x=qe5@^3%@t1fk)pk@uyv&r!z^#9==^*-&aiqfau3@9x@+j%nm'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
DEBUG = True
#True if os.getenv('DEBUG') == 'True' else False
ALLOWED_HOSTS = os.getenv('ALLOWED_HOSTS').split(',')
@@ -37,6 +37,7 @@ INSTALLED_APPS = [
'about',
'contact',
'service',
'product',
'project',
'settings',
'menus',
@@ -81,6 +82,7 @@ TEMPLATES = [
'core.context_processors.menu_data',
'core.context_processors.user_profile_context',
'core.context_processors.service_context',
'core.context_processors.product_context',
'core.context_processors.project_context',
'core.context_processors.demo_mode_enabled',
],

View File

@@ -7,6 +7,7 @@ def generate_sitemap(request):
'home',
'about',
'service',
'product',
'project',
'contact',
]
@@ -37,6 +38,13 @@ def generate_sitemap(request):
service_url = f'/service/details/{slug}/'
urls.append(service_url)
# URLs for the Product model
product_slugs = productSection.objects.values_list('slug', flat=True)
if product_slugs:
for slug in product_slugs:
product_url = f'/product/details/{slug}/'
urls.append(product_url)
# URLs for the Project model
project_slugs = projectSection.objects.values_list('slug', flat=True)
if project_slugs:

View File

@@ -15,6 +15,7 @@ urlpatterns = [
path('', include('about.urls')),
path('', include('contact.urls')),
path('', include('service.urls')),
path('', include('product.urls')),
path('', include('project.urls')),
path('', include('custompage.urls')),
]
@@ -23,6 +24,7 @@ handler404 = 'accounts.views.error_404'
handler404 = 'adminapp.views.error_404'
handler404 = 'home.views.error_404'
handler404 = 'service.views.error_404'
handler404 = 'product.views.error_404'
handler404 = 'project.views.error_404'
handler404 = 'contact.views.error_404'
handler404 = 'about.views.error_404'