white noise errors in production

I have been facing a terrible issue when i turn Debug= False in production, I have tried all solutions online here is a breakdown of the issue

Am using Shared Hosting using CPANEL

((company:3.8)) [rango@das107 company]$ python --version
Python 3.8.18
((company:3.8)) [rango@das107 company]$ pip show django
Name: Django
Version: 4.2.16

Above is the Hosting details

Below is my settings.py

import os
from pathlib import Path
import pymysql
import environ

# Define BASE_DIR before using it

BASE_DIR = Path(**file**).resolve().parent.parent

# Initialize environment variables from the .env file

env = environ.Env()
environ.Env.read_env(os.path.join(BASE_DIR, ‘.env’))

# Custom error handlers

handler403 = ‘website.views.forbidden’
handler404 = ‘website.views.error’

# Quick-start development settings - unsuitable for production

# See [Deployment checklist | Django documentation | Django](https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/)

# SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = env(‘DJANGO_SECRET_KEY’)

# SECURITY WARNING: don’t run with debug turned on in production!

DEBUG = env.bool(‘DEBUG’, default=True)

# Session settings

SESSION_ENGINE = ‘django.contrib.sessions.backends.db’ # Default session engine (use database)
SESSION_COOKIE_NAME = ‘sessionid’ # Session cookie name
SESSION_COOKIE_AGE = 1209600 # Session age in seconds (default: 2 weeks)
SESSION_EXPIRE_AT_BROWSER_CLOSE = False # Keep session open even after browser close
SESSION_SAVE_EVERY_REQUEST = False # Save session every request
SESSION_COOKIE_SECURE = True # Use secure cookies
SESSION_COOKIE_SAMESITE = ‘Lax’ # Cross-site cookie handling

LOGGING = {
‘version’: 1,
‘disable_existing_loggers’: False,
‘handlers’: {
‘console’: {
‘level’: ‘DEBUG’,
‘class’: ‘logging.StreamHandler’,
},
},
‘loggers’: {
‘django.contrib.sessions’: {
‘handlers’: [‘console’],
‘level’: ‘DEBUG’,
‘propagate’: True,
},
},
}

ALLOWED_HOSTS = env.list(‘ALLOWED_HOSTS’, default=[‘127.0.0.1’])

CSRF_TRUSTED_ORIGINS = env.list(‘CSRF_TRUSTED_ORIGINS’, default=[‘[https://company.example.com](https://company.example.com/)’])
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True

# Application definition

INSTALLED_APPS = [
‘jazzmin’,
‘compressor’,
‘django.contrib.admin’,
‘machineLearning’,
‘website’,
‘django.contrib.auth’,
‘django.contrib.contenttypes’,
‘django.contrib.sessions’,
‘django.contrib.messages’,
‘django.contrib.staticfiles’,
‘easyaudit’,
]

MIDDLEWARE = [
‘django.middleware.security.SecurityMiddleware’,
‘whitenoise.middleware.WhiteNoiseMiddleware’,
‘django.contrib.sessions.middleware.SessionMiddleware’,
‘django.middleware.common.CommonMiddleware’,
‘django.middleware.csrf.CsrfViewMiddleware’,
‘django.contrib.auth.middleware.AuthenticationMiddleware’,
‘django.contrib.messages.middleware.MessageMiddleware’,
‘django.middleware.clickjacking.XFrameOptionsMiddleware’,
‘easyaudit.middleware.easyaudit.EasyAuditMiddleware’,
]

ROOT_URLCONF = ‘Company.urls’

TEMPLATES = [
{
‘BACKEND’: ‘django.template.backends.django.DjangoTemplates’,
‘DIRS’: [os.path.join(BASE_DIR, ‘templates’)],
‘APP_DIRS’: True,
‘OPTIONS’: {
‘context_processors’: [
‘django.template.context_processors.debug’,
‘django.template.context_processors.request’,
‘django.contrib.auth.context_processors.auth’,
‘django.contrib.messages.context_processors.messages’,
],
},
},
]

WSGI_APPLICATION = ‘Company.wsgi.application’

# Database

DATABASES = {
‘default’: {
‘ENGINE’: ‘mysql.connector.django’,
‘NAME’: env(‘DB_NAME’),
‘USER’: env(‘DB_USER’),
‘PASSWORD’: env(‘DB_PASSWORD’),
‘HOST’: env(‘DB_HOST’, default=‘localhost’),
‘PORT’: env(‘DB_PORT’, default=‘3306’),
‘OPTIONS’: {
‘sql_mode’: ‘STRICT_ALL_TABLES’,
},
}
}

# Email Configuration

EMAIL_BACKEND = ‘django.core.mail.backends.smtp.EmailBackend’
EMAIL_HOST = ‘[smtp.gmail.com](http://smtp.gmail.com/)’ # Replace with your email provider’s SMTP server
EMAIL_PORT = 587 # Use 465 for SSL
EMAIL_USE_TLS = True # Use TLS for secure connection
EMAIL_HOST_USER = env(‘EMAIL_HOST_USER’)
EMAIL_HOST_PASSWORD = env(‘EMAIL_HOST_PASSWORD’)
DEFAULT_FROM_EMAIL = env(‘DEFAULT_FROM_EMAIL’)

# Site URL

SITE_URL = env(‘SITE_URL’)

# Authentication settings

AUTH_PASSWORD_VALIDATORS = [
{
‘NAME’: ‘django.contrib.auth.password_validation.UserAttributeSimilarityValidator’,
},
{
‘NAME’: ‘django.contrib.auth.password_validation.MinimumLengthValidator’,
},
{
‘NAME’: ‘django.contrib.auth.password_validation.CommonPasswordValidator’,
},
{
‘NAME’: ‘django.contrib.auth.password_validation.NumericPasswordValidator’,
},
]

# Internationalization

LANGUAGE_CODE = ‘en-us’
TIME_ZONE = ‘UTC’

USE_I18N = True
USE_TZ = True

# Set the custom login URL for all views that require authentication

LOGIN_URL = ‘/account/signin/’ # Use your custom login page URL

# Optional: You can also set the page to redirect to after login

LOGIN_REDIRECT_URL = ‘/account/profile/’

# Static files (CSS, JavaScript, Images)

STATIC_URL = ‘/static/’
STATICFILES_DIRS = [os.path.join(BASE_DIR, ‘static’)]
STATIC_ROOT = os.path.join(BASE_DIR, ‘assets’)

# Enable gzip compression and caching

STATICFILES_STORAGE = ‘whitenoise.storage.CompressedManifestStaticFilesStorage’

# Media files

MEDIA_URL = ‘/media/’
MEDIA_ROOT = os.path.join(BASE_DIR, ‘media’)

# Default primary key field type

DEFAULT_AUTO_FIELD = ‘django.db.models.BigAutoField’

Below are my URLs.py for the app

from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path
from . import views
from website.views import send_email_view, secure_email_read
from django.shortcuts import render
from django.urls import path, include
from django.contrib.auth import views as auth_views

from website import views

# Custom error handlers

def custom_error_403(request, exception):
return render(request, ‘account/403.html’, status=403)

def custom_error_404(request, exception=None):
return render(request, ‘account/404.html’, status=404)

def custom_error_500(request):
return render(request, ‘account/500.html’, status=500)

# Assign custom error handlers

handler403 = custom_error_403
handler404 = custom_error_404
handler500 = custom_error_500

urlpatterns = [
path(‘’, views.index, name=‘index’),
path(‘account/signup/’, views.signup, name=‘signup’),
path(‘account/signin/’, views.signin, name=‘signin’),
path(‘account/forgot/’, views.forgot, name=‘forgot’),
path(‘account/dashboard/’, views.dashboard, name=‘dashboard’),
path(‘account/profile/’, views.profile_view, name=‘profile’),
path(‘account/notification/’, views.notifications, name=‘notification’),
path(‘signout/’, views.signout, name=‘signout’),
path(‘send-email/’, send_email_view, name=‘send_email’),
# Email tracking URL
path(‘secure-email-read/int:email_id/’, secure_email_read, name=‘secure_email_read’),
# Password reset URLs
path(‘account/password_reset/’, auth_views.PasswordResetView.as_view(template_name=‘account/forgot.html’), name=‘password_reset’),
path(‘account/password_reset/done/’, auth_views.PasswordResetDoneView.as_view(template_name=‘account/password_reset_done.html’), name=‘password_reset_done’),
path(‘account/reset///’, auth_views.PasswordResetConfirmView.as_view(template_name=‘account/password_reset_confirm.html’), name=‘password_reset_confirm’),
path(‘account/reset/done/’, auth_views.PasswordResetCompleteView.as_view(template_name=‘account/password_reset_complete.html’), name=‘password_reset_complete’),

]

if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

SO WHAT SOLUTIONS DID I TRY?

BELOW ARE THE SOLUTIONS I TRIED WHEN DEBUG=FALSE AND I GOT ERRORS 'CASE1: MEDIA NOT FOUND, CASE2: ERROR 500 ’

Changing STATICFILES_STORAGE in settings.py from:
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
to:
STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage'
Source Django Whitenoise 500 server error in non debug mode - Stack Overflow
WhiteNoise 6.8.2 documentation
WhiteNoise configuration is incompatible with WhiteNoise v4.0 : Forums : PythonAnywhere
I tried all the above solutions with no success

looking forward for a solution

Side Note: When posting code, templates, error message, or other preformatted text here, enclose the code between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep your code properly formatted. (I have taken the liberty of correcting your original posts. Please remember to do this in the future.)

Please post the complete errors with the tracebacks from the server console.

Additionally, even though I’ve corrected the quoting, the code isn’t correct. I suggest you re-copy/paste your settings file here.

Okay, thankyou for this insight and updating the code. here is the full settings.py

import os
from pathlib import Path
import pymysql
import environ

# Define BASE_DIR before using it
BASE_DIR = Path(__file__).resolve().parent.parent

# Initialize environment variables from the .env file
env = environ.Env()
environ.Env.read_env(os.path.join(BASE_DIR, '.env'))

# Custom error handlers
handler403 = 'website.views.forbidden'
handler404 = 'website.views.error'

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = env('DJANGO_SECRET_KEY')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = env.bool('DEBUG', default=True)

# Session settings
SESSION_ENGINE = 'django.contrib.sessions.backends.db'  # Default session engine (use database)
SESSION_COOKIE_NAME = 'sessionid'  # Session cookie name
SESSION_COOKIE_AGE = 1209600  # Session age in seconds (default: 2 weeks)
SESSION_EXPIRE_AT_BROWSER_CLOSE = False  # Keep session open even after browser close
SESSION_SAVE_EVERY_REQUEST = False  # Save session every request
SESSION_COOKIE_SECURE = True  # Use secure cookies
SESSION_COOKIE_SAMESITE = 'Lax'  # Cross-site cookie handling

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
        },
    },
    'loggers': {
        'django.contrib.sessions': {
            'handlers': ['console'],
            'level': 'DEBUG',
            'propagate': True,
        },
    },
}

ALLOWED_HOSTS = env.list('ALLOWED_HOSTS', default=['127.0.0.1'])

CSRF_TRUSTED_ORIGINS = env.list('CSRF_TRUSTED_ORIGINS', default=['https://company.example.com'])
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
# Application definition
INSTALLED_APPS = [
    'jazzmin',
    'compressor',
    'django.contrib.admin',
    'machineLearning',
    'website',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'easyaudit',
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'whitenoise.middleware.WhiteNoiseMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'easyaudit.middleware.easyaudit.EasyAuditMiddleware',
]

ROOT_URLCONF = 'Company.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'templates')],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'Company.wsgi.application'

# Database
DATABASES = {
    'default': {
        'ENGINE': 'mysql.connector.django',
        'NAME': env('DB_NAME'),
        'USER': env('DB_USER'),
        'PASSWORD': env('DB_PASSWORD'),
        'HOST': env('DB_HOST', default='localhost'),
        'PORT': env('DB_PORT', default='3306'),
        'OPTIONS': {
            'sql_mode': 'STRICT_ALL_TABLES',
        },
    }
}

# Email Configuration
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'  # Replace with your email provider's SMTP server
EMAIL_PORT = 587  # Use 465 for SSL
EMAIL_USE_TLS = True  # Use TLS for secure connection
EMAIL_HOST_USER = env('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = env('EMAIL_HOST_PASSWORD')
DEFAULT_FROM_EMAIL = env('DEFAULT_FROM_EMAIL')

# Site URL
SITE_URL = env('SITE_URL')

# Authentication settings
AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]

# Internationalization
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'

USE_I18N = True
USE_TZ = True

# Set the custom login URL for all views that require authentication
LOGIN_URL = '/account/signin/'  # Use your custom login page URL

# Optional: You can also set the page to redirect to after login
LOGIN_REDIRECT_URL = '/account/profile/'

# Static files (CSS, JavaScript, Images)
STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
STATIC_ROOT = os.path.join(BASE_DIR, 'assets')

# Enable gzip compression and caching
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
# Media files
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

# Default primary key field type
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

Here are the screenshots of the settings.py


Screenshot 2

Screenshot 3

Screenshot 4

Screenshot 5

Screenshot 6

Errors from where the Django files are the stderr.log

[UID:1759][1982764] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
[UID:1759][2032676] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN.
Not Found: /robots.txt

Errors in the same folder from django_errors.log

This has no errors

Screenshot of the Django location

Screenshot of the domain responsible for displaying the Django application

Below is the URLS.PY

"""
URL configuration for website project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/5.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path
from . import views 
from website.views import send_email_view, secure_email_read
from django.shortcuts import render
from django.urls import path, include
from django.contrib.auth import views as auth_views

from website import views

# Custom error handlers
def custom_error_403(request, exception):
    return render(request, 'account/403.html', status=403)

def custom_error_404(request, exception=None):
    return render(request, 'account/404.html', status=404)

def custom_error_500(request):
    return render(request, 'account/500.html', status=500)

# Assign custom error handlers
handler403 = custom_error_403
handler404 = custom_error_404
handler500 = custom_error_500

urlpatterns = [
    path('', views.index, name='index'),
    path('account/signup/', views.signup, name='signup'),
    path('account/signin/', views.signin, name='signin'), 
    path('account/forgot/', views.forgot, name='forgot'),
    path('account/dashboard/', views.dashboard, name='dashboard'),
    path('account/profile/', views.profile_view, name='profile'), 
    path('account/notification/', views.notifications, name='notification'),
    path('signout/', views.signout, name='signout'),
    path('send-email/', send_email_view, name='send_email'),
    # Email tracking URL
    path('secure-email-read/<int:email_id>/', secure_email_read, name='secure_email_read'),
     # Password reset URLs
    path('account/password_reset/', auth_views.PasswordResetView.as_view(template_name='account/forgot.html'), name='password_reset'),
    path('account/password_reset/done/', auth_views.PasswordResetDoneView.as_view(template_name='account/password_reset_done.html'), name='password_reset_done'),
    path('account/reset/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(template_name='account/password_reset_confirm.html'), name='password_reset_confirm'),
    path('account/reset/done/', auth_views.PasswordResetCompleteView.as_view(template_name='account/password_reset_complete.html'), name='password_reset_complete'),

]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) 

Let me know if any more info is needed

So the error is when Debug is set to false all images becomes not available and are not displayed, If you Try the solutions in the above post sometimes you end up with error 500. To my view the error results in how image are being displayed that is the path specifically any other errors you see from my code help me out.

Additional screenshots when you use
STATICFILES_STORAGE = whitenoise.storage.CompressedManifestStaticFilesStorage

After Doing View Page Source

When you use STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage'

all images become error 404

Subdomain
https://company.example.com/media/images/KNCMAP-LOGO.png

Note all these cases are as a result of Debug=False

Side note: Please do not post screenshots or any images of textual data such as code, error messages, tracebacks, etc. (Besides, you already posted the contents of the settings.py file, there is no value in also posting screenshots of it.)

For the 500 errors, please post the complete error message with the traceback from the server console. (As a general rule, the output from the server console is far more useful than the summary information presented in the browser.)

Some other possible issues:

  • Have you verified that your static files were collected by collectstatic and reside in your STATIC_ROOT directory?

  • Have you tried this locally with DEBUG=False?

  • Have you tried the recommendation at Using WhiteNoise with Django - WhiteNoise 6.8.2 documentation to possibly isolate the issue between WhiteNoise and Django?

  • The 404 you’re showing here is for a media file and not a static file. Quoting directly from the WhiteNoise docs for Serving Media Files:

    WhiteNoise is not suitable for serving user-uploaded “media” files.

Thanks, I tried that documentation Using WhiteNoise with Django - WhiteNoise 6.8.2 documentation nothing seems to work anyone with a solution or better alternative, The core problem of using Django seems to be in this Debug thing why cant it be simple to work with any hosting, whitenoise etc Till now seems to be no clear solution on static file hopefully Django team will do something to improve this.

I understand that you’re frustrated, and it’s tempting to blame “the Django team” but many other people have got this to work.

If you want help to make this work it would help if you addressed Ken’s points. Post the full traceback for the 500 error, and then each of the bullet points in his comment above.

  • Have you verified that your static files were collected by collectstatic and reside in your STATIC_ROOT directory? Answer yes I did
  • Have you tried this locally with DEBUG=False? No I developed the project from CPANEL
  • Have you tried the recommendation at Using WhiteNoise with Django - WhiteNoise 6.8.2 documentation to possibly isolate the issue between WhiteNoise and Django? Yes I did including youtube and stackoverflow

Server log errors


2024-12-04 00:43:55.176896 [INFO] [3609750] [T0] [127.0.0.1:47440#APVH_XXX.com:443] File not found [/home/XXX/public_html/403.shtml] 
2024-12-04 00:43:48.349080 [INFO] [3609750] [T0] [127.0.0.1:49198#APVH_XXX.com:443] File not found [/home/XXX/public_html/403.shtml] 
2024-12-04 00:43:48.411673 [INFO] [3609740] [T0] [127.0.0.1:49212#APVH_XXX.com:443] File not found [/home/XXX/public_html/403.shtml] 
2024-12-04 00:43:46.954728 [INFO] [3609750] [T0] [127.0.0.1:49168#APVH_XXX.com:443] File not found [/home/XXX/public_html/403.shtml] 
2024-12-04 00:43:07.112761 [INFO] [3606704] [T0] [127.0.0.1:38888#APVH_XXX.com:443] File not found [/home/XXX/public_html/403.shtml]         

Raw access errors

102.212.247.90 - - [30/Nov/2024:08:06:15 -0500] "GET /.well-known/acme-challenge/IRLRWA7ZKZN5FIS3FIQ9HJJO32SN9UZ9 HTTP/1.1" 200 64 "-" "Cpanel-HTTP-Client/1.0"
2600:3000:2710:200::88 - - [30/Nov/2024:08:28:13 -0500] "GET /.well-known/acme-challenge/WKHPlG5JlSktREh-sWQJNP8BkctfQYYAOkfYc_P36XM HTTP/1.1" 200 87 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)"
2600:1f14:804:fd02:3acf:ac12:21fc:f4c6 - - [30/Nov/2024:08:28:13 -0500] "GET /.well-known/acme-challenge/WKHPlG5JlSktREh-sWQJNP8BkctfQYYAOkfYc_P36XM HTTP/1.1" 200 87 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)"
2a05:d016:39f:3100:cf1:6f95:a370:879a - - [30/Nov/2024:08:28:13 -0500] "GET /.well-known/acme-challenge/WKHPlG5JlSktREh-sWQJNP8BkctfQYYAOkfYc_P36XM HTTP/1.1" 200 87 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)"
102.212.247.90 - - [30/Nov/2024:08:27:58 -0500] "GET /.well-known/acme-challenge/ARY9WNT10UK9240DZ2QSAVWSMMRK1GTY HTTP/1.1" 200 64 "-" "Cpanel-HTTP-Client/1.0"
2406:da18:85:1402:2892:e24b:cd8e:b8c3 - - [30/Nov/2024:08:28:13 -0500] "GET /.well-known/acme-challenge/WKHPlG5JlSktREh-sWQJNP8BkctfQYYAOkfYc_P36XM HTTP/1.1" 200 87 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)"
2600:1f16:269:da00:7200:f792:26a8:18b9 - - [30/Nov/2024:08:28:23 -0500] "GET /.well-known/acme-challenge/WKHPlG5JlSktREh-sWQJNP8BkctfQYYAOkfYc_P36XM HTTP/1.1" 200 87 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)"
102.212.247.90 - - [30/Nov/2024:10:58:09 -0500] "GET /.well-known/acme-challenge/EPELPU8YZ68T_-IH6VDT8PEWPID5XWXI HTTP/1.1" 200 64 "-" "Cpanel-HTTP-Client/1.0"
102.212.247.90 - - [30/Nov/2024:13:57:23 -0500] "GET /.well-known/acme-challenge/PHUF9-SDR76SJALNZO74_YQM-3COJHYE HTTP/1.1" 200 64 "-" "Cpanel-HTTP-Client/1.0"
102.212.247.90 - - [30/Nov/2024:17:04:01 -0500] "GET /.well-known/acme-challenge/TA6MGS-Y39VSE3J9RRDV7A42Y1D0ULFY HTTP/1.1" 200 64 "-" "Cpanel-HTTP-Client/1.0"
102.212.247.90 - - [30/Nov/2024:20:04:53 -0500] "GET /.well-known/acme-challenge/YA4BOLM2QAQBK852ZQXJF0R5OW-SA3ZR HTTP/1.1" 200 64 "-" "Cpanel-HTTP-Client/1.0"
102.212.247.90 - - [30/Nov/2024:23:04:51 -0500] "GET /.well-known/acme-challenge/SWDZT0HGNH4ASLDADHA0-V6F1348HLQ- HTTP/1.1" 200 64 "-" "Cpanel-HTTP-Client/1.0"
102.212.247.90 - - [01/Dec/2024:01:56:47 -0500] "GET /.well-known/acme-challenge/MBU24KJJAL_2XKX3T0Q9GY51Y_WIOMYO HTTP/1.1" 200 64 "-" "Cpanel-HTTP-Client/1.0"
102.212.247.90 - - [01/Dec/2024:05:03:57 -0500] "GET /.well-known/acme-challenge/AHB9SCXQENEKXY4LM0R-AF8F9KCJKGTA HTTP/1.1" 200 64 "-" "Cpanel-HTTP-Client/1.0"
102.212.247.90 - - [01/Dec/2024:08:02:22 -0500] "GET /.well-known/acme-challenge/AR3-FXCOZDGX04NXS5H8I9-RZQ3IGYVF HTTP/1.1" 200 64 "-" "Cpanel-HTTP-Client/1.0"
102.212.247.90 - - [01/Dec/2024:11:04:34 -0500] "GET /.well-known/acme-challenge/MCBF8OEF5OWZPPZIVGBG57R4VMSO9BCK HTTP/1.1" 200 64 "-" "Cpanel-HTTP-Client/1.0"
102.212.247.90 - - [01/Dec/2024:14:03:35 -0500] "GET /.well-known/acme-challenge/X-LA0LGR19VMR-IB5Q72ULHGT6BX_6SF HTTP/1.1" 200 64 "-" "Cpanel-HTTP-Client/1.0"
102.212.247.90 - - [01/Dec/2024:17:08:35 -0500] "GET /.well-known/acme-challenge/A9JVGBSDN6-XX2FJWUCV7_EAZUXQSDNE HTTP/1.1" 200 64 "-" "Cpanel-HTTP-Client/1.0"
102.212.247.90 - - [01/Dec/2024:19:56:49 -0500] "GET /.well-known/acme-challenge/QPP15TZ4PV62MKG1-I9WWLJQJ3XW60Y5 HTTP/1.1" 200 64 "-" "Cpanel-HTTP-Client/1.0"
102.212.247.90 - - [01/Dec/2024:23:04:50 -0500] "GET /.well-known/acme-challenge/IX-4TB3PUD40LIS55QUG6NUPC6FYDNA9 HTTP/1.1" 200 64 "-" "Cpanel-HTTP-Client/1.0"
102.212.247.90 - - [02/Dec/2024:02:05:31 -0500] "GET /.well-known/acme-challenge/E356C6SS2FEQ1G887WL2F43R94TX9XY_ HTTP/1.1" 200 64 "-" "Cpanel-HTTP-Client/1.0"

There we go this whitenoise issue when debug = false seems to be an issue especially on shared hosting consider looking into this.

just do a simple google search here are the terms

most issue reported about django when debug=false

All of the “raw access logs” you provide indicate successful requests (“200”).

What is the URL of a file that is generating the 500 error?

Please show the full error traceback from the logs when that URL is requested.


Now the part with raw access dosen’t update automatically so the error wont reflect just yet
here

Even in the project folder I mean it simply dosen’t show the errors all you get is this

Server Error (500)

when you access your domain after enabling debug=false

cPanel logo 118.0.18
Above is cpanel version

41.90.180.45 - - [02/Dec/2024:01:18:17 -0500] "GET /static/admin/js/jquery.init.js HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/website/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:18:18 -0500] "GET /static/assets/images/xxx-LOGO.png HTTP/1.1" 404 1132 "https://company.xxx.com/admin/website/website/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:18:16 -0500] "GET /static/admin/js/core.js HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/website/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:21:54 -0500] "GET /account/dashboard/ HTTP/1.1" 200 3355 "https://company.xxx.com/account/signin/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:21:44 -0500] "GET /static/assets/web/assets/company-icons-bold/mobirise-icons-bold.ttf?m1l4yr HTTP/1.1" 304 0 "https://company.xxx.com/static/assets/web/assets/company-icons-bold/company-icons-bold.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:21:47 -0500] "GET /account/signin/ HTTP/1.1" 200 1466 "https://company.xxx.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:21:58 -0500] "GET /send-email/ HTTP/1.1" 200 3121 "https://company.xxx.com/account/dashboard/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:21:45 -0500] "GET /static/assets/web/assets/company-icons2/mobirise2.ttf?f2bix4 HTTP/1.1" 304 0 "https://company.xxx.com/static/assets/web/assets/company-icons2/company2.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:21:42 -0500] "GET / HTTP/1.1" 200 5643 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:21:52 -0500] "POST /account/signin/ HTTP/1.1" 302 0 "https://company.xxx.com/account/signin/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:18:13 -0500] "GET /static/admin/js/prepopulate.js HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/website/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:18:17 -0500] "GET /admin/jsi18n/ HTTP/1.1" 200 974 "https://company.xxx.com/admin/website/website/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:23:41 -0500] "GET /static/lib/tempusdominus/js/moment.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:23:41 -0500] "GET /static/lib/tempusdominus/css/tempusdominus-bootstrap-4.min.css HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:23:41 -0500] "GET /static/lib/easing/easing.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:23:40 -0500] "GET /static/lib/owlcarousel/assets/owl.carousel.min.css HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:23:41 -0500] "GET /static/lib/owlcarousel/owl.carousel.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:23:41 -0500] "GET /static/lib/tempusdominus/js/tempusdominus-bootstrap-4.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:23:41 -0500] "GET /static/css/bootstrap.min.css HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:23:42 -0500] "GET /static/js/main.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:23:37 -0500] "GET /send-email/ HTTP/1.1" 200 3130 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:23:41 -0500] "GET /static/css/style.css HTTP/1.1" 200 1378 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:23:42 -0500] "GET /static/lib/chart/chart.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:27:17 -0500] "GET /static/lib/tempusdominus/js/moment-timezone.min.js HTTP/1.1" 304 0 "https://company.xxx.com/account/profile/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:27:24 -0500] "GET /send-email/ HTTP/1.1" 200 3128 "https://company.xxx.com/account/profile/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:27:13 -0500] "GET /account/profile/ HTTP/1.1" 200 5642 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:23:42 -0500] "GET /static/lib/waypoints/waypoints.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:30:15 -0500] "POST /send-email/ HTTP/1.1" 500 16577 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:31:58 -0500] "POST /send-email/ HTTP/1.1" 500 16556 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:34:03 -0500] "GET /send-email/ HTTP/1.1" 200 3126 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:34:32 -0500] "POST /send-email/ HTTP/1.1" 500 15639 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:38:31 -0500] "POST /send-email/ HTTP/1.1" 500 15685 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:01:48:50 -0500] "POST /send-email/ HTTP/1.1" 500 15659 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:00:57 -0500] "GET /send-email/ HTTP/1.1" 200 3127 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:05:39 -0500] "GET /static/css/style.css HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:05:47 -0500] "GET /static/lib/easing/easing.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:05:47 -0500] "GET /static/lib/tempusdominus/js/moment.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:05:47 -0500] "GET /static/lib/tempusdominus/js/tempusdominus-bootstrap-4.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:05:39 -0500] "GET /static/lib/tempusdominus/css/tempusdominus-bootstrap-4.min.css HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:05:39 -0500] "GET /static/lib/owlcarousel/assets/owl.carousel.min.css HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:05:46 -0500] "GET /static/lib/waypoints/waypoints.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:05:47 -0500] "GET /static/lib/owlcarousel/owl.carousel.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:05:39 -0500] "GET /static/css/bootstrap.min.css HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:05:38 -0500] "GET /send-email/ HTTP/1.1" 200 3128 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:05:47 -0500] "GET /static/js/main.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:05:47 -0500] "GET /static/lib/chart/chart.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:31:15 -0500] "GET /send-email/ HTTP/1.1" 200 3126 "https://company.xxx.com/account/dashboard/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:31:32 -0500] "GET /send-email/ HTTP/1.1" 200 3128 "https://company.xxx.com/account/dashboard/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:31:33 -0500] "GET /static/css/style.css HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:31:34 -0500] "GET /static/lib/tempusdominus/js/moment.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:31:35 -0500] "GET /static/lib/waypoints/waypoints.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:31:33 -0500] "GET /static/lib/tempusdominus/css/tempusdominus-bootstrap-4.min.css HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:31:35 -0500] "GET /static/js/main.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:31:35 -0500] "GET /static/lib/tempusdominus/js/tempusdominus-bootstrap-4.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:31:35 -0500] "GET /static/lib/easing/easing.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:31:33 -0500] "GET /static/lib/owlcarousel/assets/owl.carousel.min.css HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:31:33 -0500] "GET /static/css/bootstrap.min.css HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:38 -0500] "GET /static/admin/img/icon-no.svg HTTP/1.1" 200 290 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:45 -0500] "POST /admin/website/email/ HTTP/1.1" 302 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:54 -0500] "GET /admin/website/email/ HTTP/1.1" 200 4744 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:34:02 -0500] "GET /static/admin/js/cancel.js HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:36 -0500] "GET /static/vendor/adminlte/css/adminlte.min.css HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:39 -0500] "GET /static/vendor/bootstrap/js/bootstrap.min.js HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:39 -0500] "GET /static/admin/js/vendor/jquery/jquery.js HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:50 -0500] "GET /admin/jsi18n/ HTTP/1.1" 200 974 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:53 -0500] "POST /admin/website/email/ HTTP/1.1" 302 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:37 -0500] "GET /static/jazzmin/css/main.css HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:38 -0500] "GET /static/vendor/select2/css/select2.min.css HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:38 -0500] "GET /static/vendor/bootswatch/cyborg/bootstrap.min.css HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:39 -0500] "GET /static/vendor/select2/js/select2.min.js HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:39 -0500] "GET /static/jazzmin/js/main.js HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:43 -0500] "POST /admin/website/email/ HTTP/1.1" 302 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:34:01 -0500] "POST /admin/website/email/ HTTP/1.1" 200 3584 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:31 -0500] "GET /admin/website/email/ HTTP/1.1" 200 4643 "https://company.xxx.com/admin/website/email/18/change/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:38 -0500] "GET /static/img/xxx_logo.png HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:38 -0500] "GET /static/jazzmin/js/change_list.js HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:39 -0500] "GET /static/admin/js/jquery.init.js HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:39 -0500] "GET /static/admin/js/admin/RelatedObjectLookups.js HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:39 -0500] "GET /static/vendor/fontawesome-free/webfonts/fa-solid-900.woff2 HTTP/1.1" 304 0 "https://company.xxx.com/static/vendor/fontawesome-free/css/all.min.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:39 -0500] "GET /static/admin/js/urlify.js HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:34:03 -0500] "POST /admin/website/email/ HTTP/1.1" 302 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:31:35 -0500] "GET /static/lib/owlcarousel/owl.carousel.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:31:35 -0500] "GET /static/lib/chart/chart.min.js HTTP/1.1" 304 0 "https://company.xxx.com/send-email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:38 -0500] "GET /static/admin/img/icon-yes.svg HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:39 -0500] "GET /static/admin/js/core.js HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:46 -0500] "GET /admin/website/email/ HTTP/1.1" 200 4761 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:55 -0500] "GET /admin/jsi18n/ HTTP/1.1" 200 974 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:34:05 -0500] "GET /admin/website/email/ HTTP/1.1" 200 3710 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:39 -0500] "GET /static/admin/js/actions.js HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:39 -0500] "GET /static/vendor/fontawesome-free/webfonts/fa-regular-400.woff2 HTTP/1.1" 304 0 "https://company.xxx.com/static/vendor/fontawesome-free/css/all.min.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:39 -0500] "GET /admin/jsi18n/ HTTP/1.1" 200 974 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:39 -0500] "GET /static/admin/js/vendor/xregexp/xregexp.js HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:39 -0500] "GET /static/admin/js/prepopulate.js HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:37 -0500] "GET /static/vendor/bootswatch/journal/bootstrap.min.css HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:37 -0500] "GET /static/vendor/fontawesome-free/css/all.min.css HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:33:39 -0500] "GET /static/vendor/adminlte/js/adminlte.min.js HTTP/1.1" 304 0 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
41.90.180.45 - - [02/Dec/2024:02:34:06 -0500] "GET /admin/jsi18n/ HTTP/1.1" 200 974 "https://company.xxx.com/admin/website/email/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"

Above is the lates raw access error

If there’s no way to view a complete traceback it will be very difficult to diagnose any error, not just this one. I’d recommend adding something like Python | Sentry for Python to your project so that you can view a full traceback on Sentry.

Thanks, Just installed here is what i can see from the Sentry backend

handled
no
level
level
error
release
release
--
environment
environment
production
url
url
https://company.xxx.com/account/dashboard/
transaction
/account/dashboard/
status_code
status_code
--
Trace: Trace ID
ab4259d9c19a4fcbb947d1e54cadc24e
Runtime: Name
CPython
Runtime: Version
3.8.18
Error Details
Browser: Brave 131
Operating System: Windows
Environment: Production
Django Version: CPython 3.8.18
Server: das107.truehost.cloud
URL: https://company.XXX.com/account/dashboard/
Transaction: /account/dashboard/
Error Information
Level: Error
Handled: No
Mechanism: Django
Runtime: CPython 3.8.18
Request Headers
Accept: text/html, application/xhtml+xml, application/xml;q=0.9, image/avif, image/webp, image/apng, */*;q=0.8
Accept-Encoding: gzip, br
Accept-Language: en-US, en;q=0.7
Cache-Control: max-age=0
Cdn-Loop: cloudflare; loops=1; subreqs=1
Cf-Connecting-Ip: 41.90.180.45
Cf-Ew-Via: 15
Cf-Ipcountry: KE (Kenya)
Cf-Ray: 8ecb4815530cd0b4-CDG
Cf-Visitor: {"scheme":"https"}
Cookie: [Filtered]
Host: company.xxx.com
Priority: u=0, i
Referer: https://company.xxx.com/account/profile/
Sec-Ch-Ua: "Brave";v="131", "Chromium";v="131", "Not_A Brand";v="24"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: "Windows"
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Sec-Gpc: 1
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
X-Forwarded-Proto: https
Server Information
Server Name: company.xxx.com
Server Port: 443 (HTTPS) 
Query
info
10:58:39.896 AM
SELECT `website_website`.`id`, `website_website`.`image`, `website_website`.`website_title`,
       `website_website`.`menu1`, `website_website`.`menu2`, `website_website`.`menu3`,
       `website_website`.`button_text`, `website_website`.`button_link`, `website_website`.`footer_image`
FROM `website_website`
LIMIT 21
Query
info
10:58:39.892 AM
[Filtered]
Query
info
10:58:39.753 AM
SELECT EXTRACT(DAY
               FROM `website_notification`.`created_at`) AS `created_at__day`, COUNT(`website_notification`.`created_at`) AS `count`
FROM `website_notification`
WHERE (EXTRACT(MONTH
               FROM `website_notification`.`created_at`) = %s
       AND `website_notification`.`created_at` BETWEEN %s AND %s
       AND `website_notification`.`user_id` = %s)
GROUP BY 1
ORDER BY 1 ASC
Query
info
10:58:39.751 AM
SELECT EXTRACT(DAY
               FROM `website_notification`.`created_at`) AS `created_at__day`, COUNT(`website_notification`.`created_at`) AS `count`
FROM `website_notification`
WHERE (EXTRACT(MONTH
               FROM `website_notification`.`created_at`) = %s
       AND `website_notification`.`created_at` BETWEEN %s AND %s)
GROUP BY 1
ORDER BY 1 ASC
Query
info
10:58:39.748 AM
SELECT COUNT(*) AS `__count`
FROM `website_profilepicture`
WHERE (EXTRACT(MONTH
               FROM `website_profilepicture`.`updated_at`) = %s
       AND `website_profilepicture`.`updated_at` BETWEEN %s AND %s
       AND `website_profilepicture`.`user_id` = %s)
Query
info
10:58:39.736 AM
SELECT `website_profile`.`id`, `website_profile`.`user_id`, `website_profile`.`phone`
FROM `website_profile`
WHERE `website_profile`.`user_id` = %s
LIMIT 21
Query
info
10:58:39.732 AM
SELECT COUNT(*) AS `__count`
FROM `website_notification`
WHERE (`website_notification`.`read` = %s
       AND `website_notification`.`user_id` = %s)
Query
info
10:58:39.728 AM
SELECT `website_profilepicture`.`id`, `website_profilepicture`.`user_id`, `website_profilepicture`.`image`,
       `website_profilepicture`.`updated_at`
FROM `website_profilepicture`
WHERE `website_profilepicture`.`user_id` = %s
LIMIT 21
Query
info
10:58:39.726 AM
[Filtered]
Query
info
10:58:39.723 AM
SELECT `django_session`.`session_key`, `django_session`.`session_data`, `django_session`.`expire_date`
FROM `django_session`
WHERE (`django_session`.`expire_date` > %s
       AND `django_session`.`session_key` = %s)
LIMIT 21
Query
info
10:58:39.240 AM
INSERT INTO `easyaudit_requestevent` (`url`,
               `method`, `query_string`, `user_id`, `remote_ip`, `datetime`)
VALUES (%s, %s, %s, %s, %s, %s)
Query
info
10:58:39.234 AM
[Filtered]
Query
info
10:58:39.227 AM
SELECT `django_session`.`session_key`, `django_session`.`session_data`, `django_session`.`expire_date`
FROM `django_session`
WHERE (`django_session`.`expire_date` > %s
       AND `django_session`.`session_key` = %s)
LIMIT 21
Query
info
10:58:39.221 AM
SELECT VERSION(), @@sql_mode, @@default_storage_engine, @@sql_auto_is_null, @@lower_case_table_names,
                                                                              CONVERT_TZ('2001-01-01 01:00:00',
                                                                                'UTC',
                                                                                'UTC') IS NOT NULL
Query
info
10:58:39.210 AM
connect
##### ValueError

Missing staticfiles manifest entry for 'images'
django/contrib/staticfiles/storage.py in stored_name at line 513

Hide 13 more frames

        clean_name = parsed_name.path.strip()
        hash_key = self.hash_key(clean_name)
        cache_name = self.hashed_files.get(hash_key)
        if cache_name is None:
            if self.manifest_strict:
                raise ValueError(
                    "Missing staticfiles manifest entry for '%s'" % clean_name
                )
            cache_name = self.clean_name(self.hashed_name(name))
        unparsed_name = list(parsed_name)
        unparsed_name[2] = cache_name
cache_name	
None
clean_name	
"images"
hash_key	
"images"
name	
"images"
parsed_name	

[
"",
"",
"images",
"",
""
]
self	
<django.contrib.staticfiles.storage.ManifestStaticFilesStorage object at 0x7f401f69afa0>
django/contrib/staticfiles/storage.py in _url at line 182

                hashed_name = name
            else:
                args = (clean_name,)
                if hashed_files is not None:
                    args += (hashed_files,)
                hashed_name = hashed_name_func(*args)
        final_url = super().url(hashed_name)
        # Special casing for a @font-face hack, like url(myfont.eot?#iefix")
        # http://www.fontspring.com/blog/the-new-bulletproof-font-face-syntax
__class__	
<class 'django.contrib.staticfiles.storage.HashedFilesMixin'>
args	

[
"images"
]
clean_name	
"images"
force	
False
fragment	
""
hashed_files	
None
hashed_name_func	
<bound method ManifestFilesMixin.stored_name of <django.contrib.staticfiles.storage.ManifestStaticFilesStorage object at 0x7f401f69afa0>>
name	
"images"
self	
<django.contrib.staticfiles.storage.ManifestStaticFilesStorage object at 0x7f401f69afa0>
django/contrib/staticfiles/storage.py in url at line 203

    def url(self, name, force=False):
        """
        Return the non-hashed URL in DEBUG mode.
        """
        return self._url(self.stored_name, name, force)
    def url_converter(self, name, hashed_files, template=None):
        """
        Return the custom URL converter for the given file name.
        """
force	
False
name	
"images"
self	
<django.contrib.staticfiles.storage.ManifestStaticFilesStorage object at 0x7f401f69afa0>
django/templatetags/static.py in handle_simple at line 129

    @classmethod
    def handle_simple(cls, path):
        if apps.is_installed("django.contrib.staticfiles"):
            from django.contrib.staticfiles.storage import staticfiles_storage
            return staticfiles_storage.url(path)
        else:
            return urljoin(PrefixNode.handle_simple("STATIC_URL"), quote(path))
    @classmethod
    def handle_token(cls, parser, token):
cls	
<class 'django.templatetags.static.StaticNode'>
path	
"images"
staticfiles_storage	
<django.contrib.staticfiles.storage.ConfiguredStorage object at 0x7f401f7e2310>
django/templatetags/static.py in url at line 113

            f"{self.__class__.__name__}(varname={self.varname!r}, path={self.path!r})"
        )
    def url(self, context):
        path = self.path.resolve(context)
        return self.handle_simple(path)
    def render(self, context):
        url = self.url(context)
        if context.autoescape:
            url = conditional_escape(url)
context	
[{'True': True, 'False': False, 'None': None}, {}, {}, {'username': 'charles', 'email': 'support@xxx.com', 'profile_picture': <ProfilePicture: charles's Profile Picture>, 'unread_notifications_count': 2, 'profile': None, 'website': <QuerySet [<Website: xxx>]>, 'last_login': datetime.datetime(2024, 12, 3, 21, 51, 53, 424535, tzinfo=datetime.timezone.utc), 'date_joined': datetime.datetime(2024, 11, 30, 12, 27, 31, 659487, tzinfo=datetime.timezone.utc), 'login_frequency_labels': '["1", "3"]', 'login_frequency_data': '[1, 1]', 'notification_frequency_labels': '["1", "3"]', 'notification_frequency_data': '[1, 1]', 'account_updates': 1, 'sentry_trace_meta': '<meta name="sentry-trace" content="ab4259d9c19a4fcbb947d1e54cadc24e-97e4a0ea4921a779-1"><meta name="baggage" content="sentry-trace_id=ab4259d9c19a4fcbb947d1e54cadc24e,sentry-environment=production,sentry-public_key=c8fe5600eb30d504b78d43e2813f489e,sentry-transaction=/account/dashboard/,sentry-sample_rate=1.0,sentry-sampled=true">'}]
path	
"images"
self	
StaticNode(varname='baseUrl', path=<FilterExpression '"images"'>)
django/templatetags/static.py in render at line 116

    def url(self, context):
        path = self.path.resolve(context)
        return self.handle_simple(path)
    def render(self, context):
        url = self.url(context)
        if context.autoescape:
            url = conditional_escape(url)
        if self.varname is None:
            return url
        context[self.varname] = url
context	
[{'True': True, 'False': False, 'None': None}, {}, {}, {'username': 'charles', 'email': 'support@xxx.com', 'profile_picture': <ProfilePicture: charles's Profile Picture>, 'unread_notifications_count': 2, 'profile': None, 'website': <QuerySet [<Website: xxx>]>, 'last_login': datetime.datetime(2024, 12, 3, 21, 51, 53, 424535, tzinfo=datetime.timezone.utc), 'date_joined': datetime.datetime(2024, 11, 30, 12, 27, 31, 659487, tzinfo=datetime.timezone.utc), 'login_frequency_labels': '["1", "3"]', 'login_frequency_data': '[1, 1]', 'notification_frequency_labels': '["1", "3"]', 'notification_frequency_data': '[1, 1]', 'account_updates': 1, 'sentry_trace_meta': '<meta name="sentry-trace" content="ab4259d9c19a4fcbb947d1e54cadc24e-97e4a0ea4921a779-1"><meta name="baggage" content="sentry-trace_id=ab4259d9c19a4fcbb947d1e54cadc24e,sentry-environment=production,sentry-public_key=c8fe5600eb30d504b78d43e2813f489e,sentry-transaction=/account/dashboard/,sentry-sample_rate=1.0,sentry-sampled=true">'}]
self	
StaticNode(varname='baseUrl', path=<FilterExpression '"images"'>)
django/template/base.py in render_annotated at line 966

        rendering, the exception is annotated with contextual line information
        where it occurred in the template. For internal usage this method is
        preferred over using the render method directly.
        """
        try:
            return self.render(context)
        except Exception as e:
            if context.template.engine.debug:
                # Store the actual node that caused the exception.
                if not hasattr(e, "_culprit_node"):
                    e._culprit_node = self
context	
[{'True': True, 'False': False, 'None': None}, {}, {}, {'username': 'charles', 'email': 'support@xxx.com', 'profile_picture': <ProfilePicture: charles's Profile Picture>, 'unread_notifications_count': 2, 'profile': None, 'website': <QuerySet [<Website: xxx>]>, 'last_login': datetime.datetime(2024, 12, 3, 21, 51, 53, 424535, tzinfo=datetime.timezone.utc), 'date_joined': datetime.datetime(2024, 11, 30, 12, 27, 31, 659487, tzinfo=datetime.timezone.utc), 'login_frequency_labels': '["1", "3"]', 'login_frequency_data': '[1, 1]', 'notification_frequency_labels': '["1", "3"]', 'notification_frequency_data': '[1, 1]', 'account_updates': 1, 'sentry_trace_meta': '<meta name="sentry-trace" content="ab4259d9c19a4fcbb947d1e54cadc24e-97e4a0ea4921a779-1"><meta name="baggage" content="sentry-trace_id=ab4259d9c19a4fcbb947d1e54cadc24e,sentry-environment=production,sentry-public_key=c8fe5600eb30d504b78d43e2813f489e,sentry-transaction=/account/dashboard/,sentry-sample_rate=1.0,sentry-sampled=true">'}]
self	
StaticNode(varname='baseUrl', path=<FilterExpression '"images"'>)
django/template/base.py in <listcomp> at line 1005

    # Set to True the first time a non-TextNode is inserted by
    # extend_nodelist().
    contains_nontext = False
    def render(self, context):
        return SafeString("".join([node.render_annotated(context) for node in self]))
    def get_nodes_by_type(self, nodetype):
        "Return a list of all nodes of the given type"
        nodes = []
        for node in self:
.0	
<list_iterator object at 0x7f401e011640>
context	
[{'True': True, 'False': False, 'None': None}, {}, {}, {'username': 'charles', 'email': 'support@xxx.com', 'profile_picture': <ProfilePicture: charles's Profile Picture>, 'unread_notifications_count': 2, 'profile': None, 'website': <QuerySet [<Website: xxx>]>, 'last_login': datetime.datetime(2024, 12, 3, 21, 51, 53, 424535, tzinfo=datetime.timezone.utc), 'date_joined': datetime.datetime(2024, 11, 30, 12, 27, 31, 659487, tzinfo=datetime.timezone.utc), 'login_frequency_labels': '["1", "3"]', 'login_frequency_data': '[1, 1]', 'notification_frequency_labels': '["1", "3"]', 'notification_frequency_data': '[1, 1]', 'account_updates': 1, 'sentry_trace_meta': '<meta name="sentry-trace" content="ab4259d9c19a4fcbb947d1e54cadc24e-97e4a0ea4921a779-1"><meta name="baggage" content="sentry-trace_id=ab4259d9c19a4fcbb947d1e54cadc24e,sentry-environment=production,sentry-public_key=c8fe5600eb30d504b78d43e2813f489e,sentry-transaction=/account/dashboard/,sentry-sample_rate=1.0,sentry-sampled=true">'}]
node	
StaticNode(varname='baseUrl', path=<FilterExpression '"images"'>)
django/template/base.py in render at line 1005

    # Set to True the first time a non-TextNode is inserted by
    # extend_nodelist().
    contains_nontext = False
    def render(self, context):
        return SafeString("".join([node.render_annotated(context) for node in self]))
    def get_nodes_by_type(self, nodetype):
        "Return a list of all nodes of the given type"
        nodes = []
        for node in self:
context	
[{'True': True, 'False': False, 'None': None}, {}, {}, {'username': 'charles', 'email': 'support@xxx.com', 'profile_picture': <ProfilePicture: charles's Profile Picture>, 'unread_notifications_count': 2, 'profile': None, 'website': <QuerySet [<Website: xxx>]>, 'last_login': datetime.datetime(2024, 12, 3, 21, 51, 53, 424535, tzinfo=datetime.timezone.utc), 'date_joined': datetime.datetime(2024, 11, 30, 12, 27, 31, 659487, tzinfo=datetime.timezone.utc), 'login_frequency_labels': '["1", "3"]', 'login_frequency_data': '[1, 1]', 'notification_frequency_labels': '["1", "3"]', 'notification_frequency_data': '[1, 1]', 'account_updates': 1, 'sentry_trace_meta': '<meta name="sentry-trace" content="ab4259d9c19a4fcbb947d1e54cadc24e-97e4a0ea4921a779-1"><meta name="baggage" content="sentry-trace_id=ab4259d9c19a4fcbb947d1e54cadc24e,sentry-environment=production,sentry-public_key=c8fe5600eb30d504b78d43e2813f489e,sentry-transaction=/account/dashboard/,sentry-sample_rate=1.0,sentry-sampled=true">'}]
self	

[
10 items
]
django/template/base.py in _render at line 167

            self.__class__.__qualname__,
            self.source[:20].replace("\n", ""),
        )
    def _render(self, context):
        return self.nodelist.render(context)
    def render(self, context):
        "Display stage -- can be called many times"
        with context.render_context.push_state(self):
            if context.template is None:
context	
[{'True': True, 'False': False, 'None': None}, {}, {}, {'username': 'charles', 'email': 'support@xxx.com', 'profile_picture': <ProfilePicture: charles's Profile Picture>, 'unread_notifications_count': 2, 'profile': None, 'website': <QuerySet [<Website: xxx>]>, 'last_login': datetime.datetime(2024, 12, 3, 21, 51, 53, 424535, tzinfo=datetime.timezone.utc), 'date_joined': datetime.datetime(2024, 11, 30, 12, 27, 31, 659487, tzinfo=datetime.timezone.utc), 'login_frequency_labels': '["1", "3"]', 'login_frequency_data': '[1, 1]', 'notification_frequency_labels': '["1", "3"]', 'notification_frequency_data': '[1, 1]', 'account_updates': 1, 'sentry_trace_meta': '<meta name="sentry-trace" content="ab4259d9c19a4fcbb947d1e54cadc24e-97e4a0ea4921a779-1"><meta name="baggage" content="sentry-trace_id=ab4259d9c19a4fcbb947d1e54cadc24e,sentry-environment=production,sentry-public_key=c8fe5600eb30d504b78d43e2813f489e,sentry-transaction=/account/dashboard/,sentry-sample_rate=1.0,sentry-sampled=true">'}]
self	
<Template template_string="{% load static %}{%...">
django/template/base.py in render at line 175

        "Display stage -- can be called many times"
        with context.render_context.push_state(self):
            if context.template is None:
                with context.bind_template(self):
                    context.template_name = self.name
                    return self._render(context)
            else:
                return self._render(context)
    def compile_nodelist(self):
        """
context	
[{'True': True, 'False': False, 'None': None}, {}, {}, {'username': 'charles', 'email': 'support@xxx.com', 'profile_picture': <ProfilePicture: charles's Profile Picture>, 'unread_notifications_count': 2, 'profile': None, 'website': <QuerySet [<Website: xxx>]>, 'last_login': datetime.datetime(2024, 12, 3, 21, 51, 53, 424535, tzinfo=datetime.timezone.utc), 'date_joined': datetime.datetime(2024, 11, 30, 12, 27, 31, 659487, tzinfo=datetime.timezone.utc), 'login_frequency_labels': '["1", "3"]', 'login_frequency_data': '[1, 1]', 'notification_frequency_labels': '["1", "3"]', 'notification_frequency_data': '[1, 1]', 'account_updates': 1, 'sentry_trace_meta': '<meta name="sentry-trace" content="ab4259d9c19a4fcbb947d1e54cadc24e-97e4a0ea4921a779-1"><meta name="baggage" content="sentry-trace_id=ab4259d9c19a4fcbb947d1e54cadc24e,sentry-environment=production,sentry-public_key=c8fe5600eb30d504b78d43e2813f489e,sentry-transaction=/account/dashboard/,sentry-sample_rate=1.0,sentry-sampled=true">'}]
self	
<Template template_string="{% load static %}{%...">
django/template/backends/django.py in render at line 61

    def render(self, context=None, request=None):
        context = make_context(
            context, request, autoescape=self.backend.engine.autoescape
        )
        try:
            return self.template.render(context)
        except TemplateDoesNotExist as exc:
            reraise(exc, self.backend)
def copy_exception(exc, backend=None):
context	
[{'True': True, 'False': False, 'None': None}, {}, {}, {'username': 'charles', 'email': 'support@xxx.com', 'profile_picture': <ProfilePicture: charles's Profile Picture>, 'unread_notifications_count': 2, 'profile': None, 'website': <QuerySet [<Website: xxx>]>, 'last_login': datetime.datetime(2024, 12, 3, 21, 51, 53, 424535, tzinfo=datetime.timezone.utc), 'date_joined': datetime.datetime(2024, 11, 30, 12, 27, 31, 659487, tzinfo=datetime.timezone.utc), 'login_frequency_labels': '["1", "3"]', 'login_frequency_data': '[1, 1]', 'notification_frequency_labels': '["1", "3"]', 'notification_frequency_data': '[1, 1]', 'account_updates': 1, 'sentry_trace_meta': '<meta name="sentry-trace" content="ab4259d9c19a4fcbb947d1e54cadc24e-97e4a0ea4921a779-1"><meta name="baggage" content="sentry-trace_id=ab4259d9c19a4fcbb947d1e54cadc24e,sentry-environment=production,sentry-public_key=c8fe5600eb30d504b78d43e2813f489e,sentry-transaction=/account/dashboard/,sentry-sample_rate=1.0,sentry-sampled=true">'}]
request	
<WSGIRequest: GET '/account/dashboard/'>
self	
<django.template.backends.django.Template object at 0x7f401e0ad4f0>
django/template/loader.py in render_to_string at line 62

    """
    if isinstance(template_name, (list, tuple)):
        template = select_template(template_name, using=using)
    else:
        template = get_template(template_name, using=using)
    return template.render(context, request)
def _engine_list(using=None):
    return engines.all() if using is None else [engines[using]]
context	

{
10 items
}
request	
<WSGIRequest: GET '/account/dashboard/'>
template	
<django.template.backends.django.Template object at 0x7f401e0ad4f0>
template_name	
"account/dashboard.html"
using	
None
django/shortcuts.py in render at line 24

):
    """
    Return an HttpResponse whose content is filled with the result of calling
    django.template.loader.render_to_string() with the passed arguments.
    "
    content = loader.render_to_string(template_name, context, request, using=using)
    return HttpResponse(content, content_type, status)
def redirect(to, *args, permanent=False, **kwargs):
  
content_type	
None
context	

{
10 items
}
request	
<WSGIRequest: GET '/account/dashboard/'>
status	
None
template_name	
"account/dashboard.html"
using	
None
website/views.py in dashboard at line 579
In App

        'notification_frequency_labels': json.dumps(notification_frequency_labels),  # Pass data as JSON
        'notification_frequency_data': json.dumps(notification_frequency_data),  # Pass data as JSON
        'account_updates': account_updates,
    }
    return render(request, 'account/dashboard.html', context)
    
@login_required
def profile_view(request):
    # Fetch or create profile object
    profile, created = ProfilePicture.objects.get_or_create(user=request.user)
current_month	
12
current_year	
2024
date_joined	
datetime.datetime(2024, 11, 30, 12, 27, 31, 659487, tzinfo=datetime.timezone.utc)
last_login	
datetime.datetime(2024, 12, 3, 21, 51, 53, 424535, tzinfo=datetime.timezone.utc)
login_frequency	
<QuerySet [{'created_at__day': 1, 'count': 1}, {'created_at__day': 3, 'count': 1}]>
profile	
None
profile_picture	
<ProfilePicture: charles's Profile Picture>
request	
<WSGIRequest: GET '/account/dashboard/'>
unread_notifications_count	
2
website	
<QuerySet from django.db.models.query at 0x7f401e0f08e0>
Called from: django/contrib/auth/decorators.py in _wrapper_view

Hide 2 more frames

django/core/handlers/base.py in _get_response at line 197

django/core/handlers/exception.py in inner at line 55

This is so useful hopefully you are able to get all info so as we get rid of these error

Here is a screenshot to enhance eliminating the error

Here is the views.py

from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth.decorators import login_required  # Correct import for login_required
from django.contrib import messages  # Correct import for messages
from django.contrib.auth import update_session_auth_hash
from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm
from django.contrib.auth.models import Group, User
from django.http import JsonResponse
import json
from .models import Email
from django.db.models import Count
from datetime import datetime
from django.utils import timezone
import logging
from .modules import EmailService
from django.core.mail import send_mail
from django.contrib.auth import authenticate, login, logout
from .forms import SubscriptionForm, MessagesForm, ProfileForm, UserProfileForm, CustomPasswordChangeForm
from .models import (
    Subscription, GroupUsers, Section1, Section2, Section3, Section4, Section5, Section6, Section7, 
    Section8, Section9, Section10, Section11, Section_6_Image, Section9Title, Section2Header, 
    Section3Header, Website, Notification, ProfilePicture, Profile, ForgotPassword
)
from django.contrib.auth.tokens import default_token_generator
from django.utils.http import urlsafe_base64_decode
from django.utils.encoding import force_str
from django.http import HttpResponse
logger = logging.getLogger(__name__)

def trigger_error(request):
    division_by_zero = 1 / 0

def index(request):
    # Query all the sections from the database
    section1_data = Section1.objects.all()
    section2header_data = Section2Header.objects.all()
    section2_data = Section2.objects.all()
    section3header_data = Section3Header.objects.all()
    section3_data = Section3.objects.all()
    section4_data = Section4.objects.all()
    section5_data = Section5.objects.all()
    section_6_image_data = Section_6_Image.objects.all()
    section6_data = Section6.objects.all()
    section7_data = Section7.objects.all()
    section8_data = Section8.objects.all()
    section9_title_data = Section9Title.objects.all()
    section9_data = Section9.objects.all()
    section10_data = Section10.objects.all()
    section11_data = Section11.objects.all()
    website = Website.objects.all()
    group_users_data = GroupUsers.objects.all()

    # Initialize forms
    form = SubscriptionForm()
    messages_form = MessagesForm()

    # Prepare context data to be passed to the template
    context = {
        'section1_data': section1_data,
        'section2header_data': section2header_data,
        'section2_data': section2_data,
        'section3header_data': section3header_data,
        'section3_data': section3_data,
        'section4_data': section4_data,
        'section5_data': section5_data,
        'section_6_image_data': section_6_image_data,
        'section6_data': section6_data,
        'section7_data': section7_data,
        'section8_data': section8_data,
        'section9_data': section9_data,
        'section9_title_data': section9_title_data,
        'section10_data': section10_data,
        'section11_data': section11_data,
        'website': website,
        'group_users_data': group_users_data,
        'subscription_messages': [message for message in messages.get_messages(request) if message.tags == 'subscription'],
        'messages_forms': [message for message in messages.get_messages(request) if message.tags != 'subscription']
    }

    if request.method == 'POST':
        if request.POST.get('form_type') == 'subscription':
            form = SubscriptionForm(request.POST)
            messages_form = MessagesForm()
            if not form.is_valid():
                messages.error(request, 'Email already exists! Please use a different email.')
            else:
                email = form.cleaned_data['email']
                if Subscription.objects.create(email=email):
                    messages.success(request, 'Subscription successful! Thank you for subscribing.')
                    return redirect('index')
            context['form'] = form
            context['messages_form'] = messages_form

    else:
        context['form'] = SubscriptionForm()
        context['messages_form'] = MessagesForm()

    if request.method == 'POST':
        if request.POST.get('form_type') == 'messages':
            messages_form = MessagesForm(request.POST)
            form = SubscriptionForm()
            if messages_form.is_valid():
                messages_form.save()
                messages.success(request, 'Message sent successfully!')
                return redirect('index')
            else:
                messages.error(request, 'Failed to send message. Please check your input.')
            context['form'] = form
            context['messages_form'] = messages_form
    elif request.method == 'POST':
        context['form'] = SubscriptionForm()
        context['messages_form'] = MessagesForm()
    # Render the template and pass the context data
    return render(request, 'index.html', context)
    
@login_required(login_url='/account/signin/')
def notifications(request):
    user = request.user

    # Retrieve notifications for the user
    notifications = Notification.objects.filter(user=user).order_by('-created_at')

    # Update the read status for unread notifications
    unread_notifications = notifications.filter(read=False)
    unread_notifications.update(read=True)

    # Fetch profile picture if exists and ensure the image exists
    try:
        profile_picture = ProfilePicture.objects.get(user=user)
        # Ensure the image exists before trying to access its URL
        if not profile_picture.image or not profile_picture.image.name:
            profile_picture = None
    except ProfilePicture.DoesNotExist:
        profile_picture = None

    # Fetch website data (you may want to get a specific object, or all of them)
    website = Website.objects.all()  # Fetch all Website instances (or modify as needed)

    # Pass website data to the context
    context = {
        'notifications': notifications,
        'username': user.username,
        'email': user.email,
        'profile_picture': profile_picture,
        'website': website,  # Updated variable name
    }

    return render(request, 'account/notification.html', context)

def forgot(request):
    # Query the Website model to get the website data
    website = Website.objects.all()  # Query website model to get all data

    if request.method == "POST":
        form = PasswordResetForm(request.POST)
        email = request.POST.get('email')  # Get email from POST data

        # Check if the email is associated with a registered user
        if User.objects.filter(email=email).exists():
            if form.is_valid():  # Validate the form
                user = User.objects.get(email=email)  # Get the user object
                form.save(
                    request=request,
                    use_https=request.is_secure(),
                    token_generator=default_token_generator,  # Use the default token generator
                )
                messages.success(request, 'Password reset email has been sent.')
                return redirect('password_reset_done')
        else:
            messages.error(request, 'This email is not registered.')
    else:
        form = PasswordResetForm()

    # Pass website data to the template
    return render(request, 'account/forgot.html', {'form': form, 'website': website})
    
def password_reset_done(request, auth_views=None):
    website = Website.objects.all()
    return auth_views.PasswordResetDoneView.as_view(
        template_name='account/password_reset_done.html'
    )(request)

def password_reset_confirm(request, uidb64, token):
    global form
    website = Website.objects.all()
    try:
        uid = force_str(urlsafe_base64_decode(uidb64))
        user = User.objects.get(pk=uid)
    except (TypeError, ValueError, OverflowError, User.DoesNotExist):
        user = None

    if user is not None and default_token_generator.check_token(user, token):
        if request.method == "POST":
            new_password1 = request.POST.get('new_password1')
            new_password2 = request.POST.get('new_password2')

            if new_password1 != new_password2:
                messages.error(request, "Passwords do not match.")
            else:
                form = SetPasswordForm(user, request.POST)
                if form.is_valid():
                    form.save()
                    messages.success(request, 'Your password has been reset successfully. Please log in.')
                    return redirect('signin')
                else:
                    messages.error(request, "There was an error with the form.")
        else:
            form = SetPasswordForm(user)
    else:
        messages.error(request, 'The password reset link is invalid or has expired.')
        return redirect('password_reset_done')

    return render(request, 'account/password_reset_confirm.html', {'form': form, 'website': website})

def password_reset_complete(request, auth_views=None):
    website = Website.objects.all()
    return auth_views.PasswordResetCompleteView.as_view(
        template_name='account/password_reset_complete.html'
    )(request)


def track_email_read(request, email_id):
    email = get_object_or_404(Email, id=email_id)
    if not email.is_read:
        EmailService.mark_as_read(email.id)

    # Return a 1x1 transparent pixel
    return HttpResponse(
        '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" width="1" height="1"  style="display:none;" />'
    )

@login_required(login_url='/account/signin/')
def notifications(request):
    user = request.user

    # Retrieve notifications for the user
    notifications = Notification.objects.filter(user=user).order_by('-created_at')

    # Update the read status for unread notifications
    unread_notifications = notifications.filter(read=False)
    unread_notifications.update(read=True)

    # Fetch profile picture if exists and ensure the image exists
    try:
        profile_picture = ProfilePicture.objects.get(user=user)
        # Ensure the image exists before trying to access its URL
        if not profile_picture.image or not profile_picture.image.name:
            profile_picture = None
    except ProfilePicture.DoesNotExist:
        profile_picture = None

    # Fetch website data (you may want to get a specific object, or all of them)
    website = Website.objects.all()  # Fetch all Website instances (or modify as needed)

    # Pass website data to the context
    context = {
        'notifications': notifications,
        'username': user.username,
        'email': user.email,
        'profile_picture': profile_picture,
        'website': website,  # Updated variable name
    }

    return render(request, 'account/notification.html', context)

def trigger_error(request):
    # This will raise a server error (division by zero)
    division_by_zero = 1 / 0

@login_required
def profile_view(request):
    # Fetch or create profile object
    profile, created = ProfilePicture.objects.get_or_create(user=request.user)

    # Initialize user_form, profile_form, and password_form
    user_form = UserProfileForm(instance=request.user)
    profile_form = ProfileForm(instance=profile)
    password_form = CustomPasswordChangeForm(user=request.user)

    # Fetch the profile picture safely
    profile_picture = None
    if profile.image and profile.image.name:
        profile_picture = profile

    # Handle form submissions (both AJAX and regular POST requests)
    if request.method == 'POST':
        action = request.POST.get('action')  # Identify the action (profile picture, user info, password change)

        # Handle Profile Picture Update (AJAX)
        if action == 'update_profile_picture':
            profile_form = ProfileForm(request.POST, request.FILES, instance=profile)
            if profile_form.is_valid():
                profile_form.save()  # Save the profile picture
                return JsonResponse({
                    'success': True,
                    'message': 'Profile picture updated successfully.',
                    'new_image_url': profile.image.url if profile.image else None  # Return the updated image URL for AJAX update
                })
            else:
                return JsonResponse({'success': False, 'message': 'Failed to update profile picture.'})

        # Handle User Info Update (First Name, Last Name, Email, Username)
        elif action == 'update_user_info':
            user_form = UserProfileForm(request.POST, instance=request.user)
            if user_form.is_valid():
                user_form.save()  # Update user model fields (username, email, etc.)
                return JsonResponse({
                    'success': True,
                    'message': 'Your information has been updated successfully.'
                })
            else:
                return JsonResponse({
                    'success': False,
                    'message': 'There was an error updating your information. Please try again.'
                })

        # Handle Password Change
        elif action == 'change_password':
            form = CustomPasswordChangeForm(request.user, request.POST)
            if form.is_valid():
                form.save()
                update_session_auth_hash(request, form.user)  # Keep user logged in after password change
                return JsonResponse({
                    'success': True,
                    'message': 'Your password has been updated successfully.'
                })
            else:
                # Concatenate all form errors into a single message
                error_messages = "\n".join([str(error) for error in form.errors.values()])
                return JsonResponse({
                    'success': False,
                    'message': error_messages  # Concatenate errors for user-friendly message
                })

    # Format last login and date joined for human readability
    last_login = request.user.last_login
    date_joined = request.user.date_joined

    # Format the datetime fields (if they exist) for human-readable output
    if last_login:
        last_login = last_login.strftime('%B %d, %Y, %I:%M %p')  # Example: "October 18, 2024, 03:25 PM"
    else:
        last_login = 'N/A'

    if date_joined:
        date_joined = date_joined.strftime('%B %d, %Y, %I:%M %p')  # Example: "October 18, 2024, 03:25 PM"
    else:
        date_joined = 'N/A'

    # Render the profile template with the formatted dates
    return render(
        request,
        'account/profile.html',
        {
            'user_form': user_form,
            'profile_form': profile_form,
            'password_form': password_form,
            'profile_picture': profile_picture,  # Pass profile picture if it exists
            'username': request.user.username,  # Pass username
            'email': request.user.email,  # Pass email
            'first_name': request.user.first_name,  # Pass first name
            'last_name': request.user.last_name,  # Pass last name
            'last_login': last_login,  # Pass formatted last login
            'date_joined': date_joined,  # Pass formatted date joined
        }
    )

@login_required
def change_password(request):
    if request.method == 'POST':
        form = CustomPasswordChangeForm(request.user, request.POST)

        # Check if it's an AJAX request
        if request.is_ajax():
            if form.is_valid():
                form.save()
                update_session_auth_hash(request, form.user)  # Keep the user logged in after password change
                return JsonResponse({
                    'success': True,
                    'message': 'Your password has been updated successfully.'
                })
            else:
                # Concatenate all form errors into a single message
                error_messages = "\n".join([str(error) for error in form.errors.values()])
                return JsonResponse({
                    'success': False,
                    'message': error_messages  # Concatenate errors for user-friendly message
                })

    # Non-AJAX POST requests (redirect or render the form again)
    else:
        form = CustomPasswordChangeForm(request.user)

    return render(request, 'account/profile.html', {'form': form})

@login_required
def update_user_info(request):
    """View to handle changes for First Name, Last Name, Email, and Username."""
    if request.method == 'POST':
        user_form = UserProfileForm(request.POST, instance=request.user)
        if user_form.is_valid():
            user_form.save()
            messages.success(request, 'Your information has been updated!')
            return redirect('profile')
        else:
            messages.error(request, 'There was an error updating your information. Please try again.')
    else:
        user_form = UserProfileForm(instance=request.user)

    return render(request, 'account/profile.html', {'user_form': user_form})

def signin(request):
    context = {
        'error_message': None
    }

    # Query the Website model to get website data
    website = Website.objects.all()  # Query website model

    if request.method == 'POST':
        username = request.POST.get('username')
        password = request.POST.get('password')

        # Authenticate user using username and password
        user = authenticate(request, username=username, password=password)

        if user is not None:
            user.save()

            # Add user to 'User' group
            group, created = Group.objects.get_or_create(name='User')
            if not user.groups.filter(name='User').exists():
                user.groups.add(group)

            login(request, user)
            return redirect('dashboard')  # Redirect to the dashboard after successful login
        else:
            context['error_message'] = "Invalid username or password. Please try again."

    # Add the website data to the context before rendering the template
    context['website'] = website

    # Render the signin template with the context
    return render(request, 'account/signin.html', context)

def signout(request):
    logout(request)
    return redirect('account')

def signup(request):
    context = {
        'error_message': None,
        'success_message': None,
        'website': Website.objects.all()
    }

    if request.method == 'POST':
        username = request.POST.get('username')
        email = request.POST.get('email')
        phone = request.POST.get('phone')  # Capture phone number from the form
        password = request.POST.get('password')

        # Ensure all required fields are provided
        if not (username and email and password and phone):
            context['error_message'] = "Please fill out all required fields."
            return render(request, 'account/signup.html', context)

        # Check if username or email already exists
        if User.objects.filter(username=username).exists():
            context['error_message'] = "Username already exists."
            return render(request, 'account/signup.html', context)

        if User.objects.filter(email=email).exists():
            context['error_message'] = "Email already exists."
            return render(request, 'account/signup.html', context)

        # Create the user
        user = User.objects.create_user(username=username, email=email, password=password)
        user.save()

        # Create the user's profile and save the phone number
        profile = Profile.objects.create(user=user, phone=phone)
        profile.save()

        # Authenticate and log the user in
        user = authenticate(username=username, password=password)
        if user is not None:
            login(request, user)
            context['success_message'] = "Registration successful! You are now logged in."
            return redirect('signin')  # Redirect to the signin page or dashboard
        else:
            context['error_message'] = "Unable to authenticate user."

    return render(request, 'account/signup.html', context)

def forbidden(request):
    return render(request, 'account/403.html', status=403)

def error(request):
    return render(request, 'account/404.html', status=404)

# 500 Internal Server Error
def server_error(request):
    return render(request, 'account/500.html', status=500)
    
@login_required(login_url='/account/signin/')
def dashboard(request):
    # Fetch profile picture if exists
    try:
        profile_picture = ProfilePicture.objects.get(user=request.user)
    except ProfilePicture.DoesNotExist:
        profile_picture = None

    # Fetch unread notifications count
    unread_notifications_count = Notification.objects.filter(user=request.user, read=False).count()

    # Fetch profile data (like phone number)
    try:
        profile = Profile.objects.get(user=request.user)
    except Profile.DoesNotExist:
        profile = None

    # Query the Website model to get website data
    website = Website.objects.all()

    # Get last login and date joined
    last_login = request.user.last_login
    date_joined = request.user.date_joined

    # Get current month for filtering
    current_month = datetime.now().month
    current_year = datetime.now().year

    # Fetch login frequency per day (current month only)
    login_frequency = Notification.objects.filter(
        created_at__month=current_month,
        created_at__year=current_year
    ).values('created_at__day').annotate(count=Count('created_at')).order_by('created_at__day')

    # Fetch notification frequency per day (current month only)
    notification_frequency = Notification.objects.filter(
        user=request.user,
        created_at__month=current_month,
        created_at__year=current_year
    ).values('created_at__day').annotate(count=Count('created_at')).order_by('created_at__day')

    # Fetch user activity in terms of profile updates for the current month
    # Track profile picture updates (or other relevant profile changes)
    account_updates = ProfilePicture.objects.filter(
        user=request.user,
        updated_at__month=current_month,
        updated_at__year=current_year
    ).count()

    # Process login frequency data for the chart
    login_frequency_labels = [str(day['created_at__day']) for day in login_frequency]
    login_frequency_data = [day['count'] for day in login_frequency]

    # Process notification frequency data for the chart
    notification_frequency_labels = [str(day['created_at__day']) for day in notification_frequency]
    notification_frequency_data = [day['count'] for day in notification_frequency]

    # Pass data to the template context
    context = {
        'username': request.user.username,
        'email': request.user.email,
        'profile_picture': profile_picture,
        'unread_notifications_count': unread_notifications_count,
        'profile': profile,
        'website': website,
        'last_login': last_login,
        'date_joined': date_joined,
        'login_frequency_labels': json.dumps(login_frequency_labels),  # Pass data as JSON
        'login_frequency_data': json.dumps(login_frequency_data),  # Pass data as JSON
        'notification_frequency_labels': json.dumps(notification_frequency_labels),  # Pass data as JSON
        'notification_frequency_data': json.dumps(notification_frequency_data),  # Pass data as JSON
        'account_updates': account_updates,
    }

    return render(request, 'account/dashboard.html', context)
    
@login_required
def profile_view(request):
    # Fetch or create profile object
    profile, created = ProfilePicture.objects.get_or_create(user=request.user)

    # Initialize user_form, profile_form, and password_form
    user_form = UserProfileForm(instance=request.user)
    profile_form = ProfileForm(instance=profile)
    password_form = CustomPasswordChangeForm(user=request.user)

    # Fetch the profile picture safely
    profile_picture = None
    if profile.image and profile.image.name:
        profile_picture = profile

    # Fetch website data
    website = Website.objects.all()  # Fetch all Website instances (You can modify this as needed)

    # Handle form submissions (both AJAX and regular POST requests)
    if request.method == 'POST':
        action = request.POST.get('action')  # Identify the action (profile picture, user info, password change)

        # Handle Profile Picture Update (AJAX)
        if action == 'update_profile_picture':
            profile_form = ProfileForm(request.POST, request.FILES, instance=profile)
            if profile_form.is_valid():
                profile_form.save()  # Save the profile picture
                return JsonResponse({
                    'success': True,
                    'message': 'Profile picture updated successfully.',
                    'new_image_url': profile.image.url if profile.image else None  # Return the updated image URL for AJAX update
                })
            else:
                return JsonResponse({'success': False, 'message': 'Failed to update profile picture.'})

        # Handle User Info Update (First Name, Last Name, Email, Username)
        elif action == 'update_user_info':
            user_form = UserProfileForm(request.POST, instance=request.user)
            if user_form.is_valid():
                user_form.save()  # Update user model fields (username, email, etc.)
                return JsonResponse({
                    'success': True,
                    'message': 'Your information has been updated successfully.'
                })
            else:
                return JsonResponse({
                    'success': False,
                    'message': 'There was an error updating your information. Please try again.' 
                })

        # Handle Password Change
        elif action == 'change_password':
            form = CustomPasswordChangeForm(request.user, request.POST)
            if form.is_valid():
                form.save()
                update_session_auth_hash(request, form.user)  # Keep user logged in after password change
                return JsonResponse({
                    'success': True,
                    'message': 'Your password has been updated successfully.'
                })
            else:
                # Concatenate all form errors into a single message
                error_messages = "\n".join([str(error) for error in form.errors.values()])
                return JsonResponse({
                    'success': False,
                    'message': error_messages  # Concatenate errors for user-friendly message
                })

    # Format last login and date joined for human readability
    last_login = request.user.last_login
    date_joined = request.user.date_joined

    # Format the datetime fields (if they exist) for human-readable output
    if last_login:
        last_login = last_login.strftime('%B %d, %Y, %I:%M %p')  # Example: "October 18, 2024, 03:25 PM"
    else:
        last_login = 'N/A'

    if date_joined:
        date_joined = date_joined.strftime('%B %d, %Y, %I:%M %p')  # Example: "October 18, 2024, 03:25 PM"
    else:
        date_joined = 'N/A'

    # Render the profile template with the formatted dates and website data
    return render(
        request,
        'account/profile.html',
        {
            'user_form': user_form,
            'profile_form': profile_form,
            'password_form': password_form,
            'profile_picture': profile_picture,  # Pass profile picture if it exists
            'username': request.user.username,  # Pass username
            'email': request.user.email,  # Pass email
            'first_name': request.user.first_name,  # Pass first name
            'last_name': request.user.last_name,  # Pass last name
            'last_login': last_login,  # Pass formatted last login
            'date_joined': date_joined,  # Pass formatted date joined
            'website': website,  # Pass Website data to the template
        }
    )
    
def signout(request):
    logout(request)
    return redirect('../')

@login_required  # Ensure the user must be logged in
def send_email_view(request):
    if not request.user.is_superuser:
        return HttpResponse('Unauthorized', status=403)

    if request.method == 'POST':
        recipients = request.POST.getlist('recipients')  # Get multiple emails from the form
        subject = request.POST.get('subject')
        body = request.POST.get('body')

        # Handle additional emails
        additional_emails = request.POST.get('additional_emails', '').split(',')
        # Clean up additional emails
        additional_emails = [email.strip() for email in additional_emails if email.strip()]

        # Combine the recipient lists for emails
        all_recipients = recipients + additional_emails

        # Sending the email to each recipient
        for recipient in all_recipients:
            sent_successfully = EmailService.send_email(
                recipient=recipient,
                subject=subject,
                body=body
            )

            if not sent_successfully:
                messages.error(request, f'Failed to send email to {recipient}.')
                break  # Stop sending if any email fails
        else:
            messages.success(request, 'Emails sent successfully!')

        return redirect('send_email')  # Redirect back to the same page

    # For GET requests, display the user email selection form
    users = User.objects.all()  # Fetch all users
    user_name = request.user.get_full_name()  # Get the logged-in user's name

    # Get the profile picture for the navbar
    try:
        profile_picture = ProfilePicture.objects.get(user=request.user)
        # Ensure the image exists before trying to access its URL
        if not profile_picture.image or not profile_picture.image.name:
            profile_picture = None
    except ProfilePicture.DoesNotExist:
        profile_picture = None
        
    website = Website.objects.all()

    username = request.user.username

    return render(request, 'account/send_email.html', {
        'users': users,
        'user_name': user_name,
        'profile_picture': profile_picture,
        'username': username,
        'email': request.user.email,
        'website': website,
    })
    
def secure_email_read(request, email_id):
    # Fetch the email by ID
    email = get_object_or_404(Email, id=email_id)

    # Track if the email was read
    if not email.is_read:
        email.is_read = True
        email.read_at = timezone.now()  # Mark the current time as the read time
        email.save()

    # Logic to retrieve the User's name by their email address
    user_name = "User"  # Default name if not found
    if email.recipient:
        try:
            user = User.objects.get(email=email.recipient)
            user_name = user.username  # Get the username of the recipient
        except User.DoesNotExist:
            user_name = "User"  # If no user found, keep the default name

    # Fetch website-related data (Just using 'website' here as the variable)
    website = Website.objects.all()

    # Prepare context with website data and email content
    context = {
        'email_body': email.body, 
        'user_name': user_name,
        'website': website  # Using 'website' directly here
    }

    # Render the email content with the user's name and website data
    return render(request, 'account/email_template.html', context)

Additionally I run

python manage.py collectstatic
Stack Trace

ValueError: Missing staticfiles manifest entry for 'images'
  File "django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "django/contrib/auth/decorators.py", line 23, in _wrapper_view
    return view_func(request, *args, **kwargs)
  File "website/views.py", line 579, in dashboard
    return render(request, 'account/dashboard.html', context)
  File "django/shortcuts.py", line 24, in render
    content = loader.render_to_string(template_name, context, request, using=using)
  File "django/template/loader.py", line 62, in render_to_string
    return template.render(context, request)
  File "django/template/backends/django.py", line 61, in render
    return self.template.render(context)
  File "django/template/base.py", line 175, in render
    return self._render(context)
  File "django/template/base.py", line 167, in _render
    return self.nodelist.render(context)
  File "django/template/base.py", line 1005, in render
    return SafeString("".join([node.render_annotated(context) for node in self]))
  File "django/template/base.py", line 1005, in <listcomp>
    return SafeString("".join([node.render_annotated(context) for node in self]))
  File "django/template/base.py", line 966, in render_annotated
    return self.render(context)
  File "django/templatetags/static.py", line 116, in render
    url = self.url(context)
  File "django/templatetags/static.py", line 113, in url
    return self.handle_simple(path)
  File "django/templatetags/static.py", line 129, in handle_simple
    return staticfiles_storage.url(path)
  File "django/contrib/staticfiles/storage.py", line 203, in url
    return self._url(self.stored_name, name, force)
  File "django/contrib/staticfiles/storage.py", line 182, in _url
    hashed_name = hashed_name_func(*args)
  File "django/contrib/staticfiles/storage.py", line 513, in stored_name
    raise ValueError(

:grinning: :rofl: :rofl: :rofl: :rofl: :rofl:

Django Staticfiles and Media not showing when DEBUG = False [Fixed]

HELLO THERE IF YOU ARE FACING THE WHITENOISE ERROR DEBUG=FALSE

I WANT TO TELL YOU THAT HERE IS THE SOLUTION TO THE ENTIRE MESS I WAS ALMOST DYING ON MY LAPTOP SO ALLOW ME TO SHED LIGHT TO YOUR CODE

FIRST GO TO YOUR

urls.py in project **not ** app urls.py:

imports SHOULD BE AS FOLLOWS:

from django.contrib import admin
from django.urls import path, include, re_path
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns # new



from django.conf import settings

from django.views.static import serve

urlspatterns :

# Serve static and media files in debug mode
if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
else:
    # For production, you can use re_path to serve static and media files
    urlpatterns += [
        re_path(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}),
        re_path(r'^static/(?P<path>.*)$', serve, {'document_root': settings.STATIC_ROOT}),
    ]

FULL CODE

# Company/urls.py
from django.contrib import admin
from django.urls import path, include, re_path
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns # new



from django.conf import settings

from django.views.static import serve
urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('website.urls')),  # Ensure this includes website's URLs at the root path
]

# Serve static and media files in debug mode
if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
else:
    # For production, you can use re_path to serve static and media files
    urlpatterns += [
        re_path(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}),
        re_path(r'^static/(?P<path>.*)$', serve, {'document_root': settings.STATIC_ROOT}),
    ]

#NEXT HEAD OVER TO YOUR SETTINGS.PY AND USE THIS…

STATIC_URL = '/static/'

MEDIA_URL = '/media/'

if DEBUG:

    STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]

else:

    STATIC_ROOT = os.path.join(BASE_DIR, 'static')

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')


This should also work

BASE_DIR = Path(__file__).resolve().parent.parent

STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage'  
STATIC_URL = '/static/'  
MEDIA_URL = '/media/'  

STATIC_ROOT = os.path.join(BASE_DIR, 'static')  # Used for collecting static files in production  
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')    # Used for storing uploaded media files  

if DEBUG:
    STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]  # For development static files  
else:
    STATICFILES_DIRS = []  # Not needed in production

Added comments for more explanation

#KINDLY NOTE THE CHANGES ARE IN THE PROJECT URLS.PY NOT APPS URLS.PY AND SETTINGS.PY THIS ERROR IS COMMON IN CPANEL SHARED HOSTING.

ALWAYS USE THIS TO AVOID HAVING BAD CODING TIMES
AM SO SO SORRY DJANGO TEAM FOR BENING ANGRY.
THANKS DJANGO TEAM :pray: :pray: :pray:

Note that you’re using Django’s django.contrib.staticfiles.views.serve() view to serve both static and media files when DEBUG is False. In the docs it says:

This method is grossly inefficient and probably insecure , so it is unsuitable for production .