TypeError at / 'dict' object is not callable

Hi everyone,

In my local projject I have the ‘exception.py’ file as the one in: https://github.com/django/django/blob/main/django/core/handlers/exception.py

Whenever I run Django, I’m getting the following :

*TypeError at /*
*'dict' object is not callable*
Request Method:	GET
Request URL:	http://127.0.0.1:8000/
Django Version:	4.2.13
Exception Type:	TypeError
Exception Value:	
'dict' object is not callable
*Exception Location:	C:\Users\USER\.virtualenvs\xxxxxxx-2IRLUV3q\lib\site-packages\django\core\handlers\exception.py, line 55, in inner*
Python Executable:	C:\Users\USER\.virtualenvs\xxxxxx-2IRLUV3q\Scripts\python.exe
Python Version:	3.9.16
Python Path:	
['C:\\Users\\USER\\OneDrive\\Bureau\\xxxxxx',
 'C:\\Users\\USER\\miniconda3\\python39.zip',
 'C:\\Users\\USER\\miniconda3\\DLLs',
 'C:\\Users\\USER\\miniconda3\\lib',
 'C:\\Users\\USER\\miniconda3',
 'C:\\Users\\USER\\.virtualenvs\\xxxxxx-2IRLUV3q',
 'C:\\Users\\USER\\.virtualenvs\\xxxxxx-2IRLUV3q\\lib\\site-packages']
Server time:	Tue, 18 Jun 2024 10:03:28 +0000

My attempts:

Before running Django server,

  • I activated my virtualenv using ‘pipenv shell’
  • In the line 15, I replaced get_response by _get_response but, not successful.
  • Also, in the line 15, I replaced get_response() by get_response[ ] but, not successful.

Any help to fix this issue will be appreciated.

Welcome @DramanSalif !

Please post the complete traceback you are getting on the server console.

Please post your urls.py file and the view that this url would be calling.

Thank you for reaching out.

This is My project tree:
projecct_tree 2024-06-18 071802

This is my project “urls.py”:

analyticsscout> urls.py>:

from django.contrib import admin
from django.conf.urls.i18n import i18n_patterns
from django.urls import path,include
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.sitemaps.views import sitemap
from blog.sitemaps import PostSitemap
sitemaps = {
    'posts': PostSitemap,
}
from analyticsground import views
import debug_toolbar

admin.site.site_header = 'Analyticsscout Admin'
admin.site.index_title = 'Admin'

urlpatterns = i18n_patterns(
    path('admin/', admin.site.urls),
    # Other URL patterns for the project
    path('analyticsground/', include('analyticsground.urls', namespace='analyticsground')),
    path('blog/', include('blog.urls', namespace='blog') ),
    path('__debug__/', include('debug_toolbar.urls')),
    path('sitemap.xml', sitemap, {'sitemaps': sitemaps},
         name='django.contrib.sitemaps.views.sitemap'),
    path('', views.home, name='home'),
    path('data_visualization/', views.data_visualization, name='data_visualization'),
    path('case_studies/', views.case_studies, name='case_studies'),
    path('industry_trends/', views.industry_trends, name='industry_trends'),
    path('contact/', views.contact, name='contact'),
    path('data_viz/', views.data_viz, name='data_viz'),
    path('', include('cms.urls')),
)


urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

analyticsground>views.py>:

    return render(request, 'analyticsground/contact.html')

blog> views.py>:

from django.shortcuts import render, get_object_or_404
from django.core.paginator import Paginator, EmptyPage,\
                                  PageNotAnInteger
from django.views.generic import ListView
from django.core.mail import send_mail
from django.views.decorators.http import require_POST
from django.db.models import Q
from .models import Post, MyData
from taggit.models import Tag

# ...
from django.contrib.postgres.search import SearchVector, TrigramSimilarity,\
                                           SearchQuery, SearchRank
from .forms import EmailPostForm, CommentForm, SearchForm
# ...

def post_list(request, tag_slug=None):
    post_list = Post.published.all()
    tag = None
    if tag_slug:
        tag = get_object_or_404(Tag, slug=tag_slug)
        post_list = post_list.filter(tags__in=[tag])
    # Pagination with 3 posts per page
    paginator = Paginator(post_list, 3)
    page_number = request.GET.get('page', 1)
    try:
        posts = paginator.page(page_number)
    except PageNotAnInteger:
        # If page_number is not an integer deliver the first page
        posts = paginator.page(1)
    except EmptyPage:
        # If page_number is out of range deliver last page of results
        posts = paginator.page(paginator.num_pages)
    return render(request,
                 'blog/post/list.html',
                 {'posts': posts,
                  'tag': tag})



""" class PostListView(ListView):
    
    # Alternative post list view
    
    queryset = Post.published.all()
    context_object_name = 'posts'
    paginate_by = 3
    template_name = 'blog/post/list.html' """




def post_share(request, post_id):
    # Retrieve post by id
    post = get_object_or_404(Post, id=post_id, status=Post.Status.PUBLISHED)
    sent = False
    if request.method == 'POST':
        # Form was submitted
        form = EmailPostForm(request.POST)
        if form.is_valid():
            # Form fields passed validation
            cd = form.cleaned_data
            post_url = request.build_absolute_uri(
                post.get_absolute_url())
            subject = f"{cd['name']} recommends you read " \
                      f"{post.title}"
            message = f"Read {post.title} at {post_url}\n\n" \
                      f"{cd['name']}\'s comments: {cd['comments']}"
            send_mail(subject, message, 'dbsbox@gmail.com',
                      [cd['to']])
            sent = True
    else:
        form = EmailPostForm()
    return render(request, 'blog/post/share.html', {'post': post,
                                                    'form': form,
                                                    'sent': sent})


@require_POST
def post_comment(request, post_id):
    post = get_object_or_404(Post, id=post_id, status=Post.Status.PUBLISHED)
    comment = None
    # A comment was posted
    form = CommentForm(data=request.POST)
    if form.is_valid():
        # Create a Comment object without saving it to the database
        comment = form.save(commit=False)
        # Assign the post to the comment
        comment.post = post
        # Save the comment to the database
        comment.save()
    return render(request, 'blog/post/comment.html',
                           {'post': post,
                            'form': form,
                            'comment': comment})

def post_detail(request, year, month, day, post):
    post = get_object_or_404(Post,
                             status=Post.Status.PUBLISHED,
                             slug=post,
                             publish__year=year,
                             publish__month=month,
                             publish__day=day)
    # List of active comments for this post
    comments = post.comments.filter(active=True)
    # Form for users to comment
    form = CommentForm()
    return render(request,
                  'blog/post/detail.html',
                  {'post': post,
                   'comments': comments,
                   'form': form})



def post_search(request):
    form = SearchForm()
    query = None
    results = []
    if 'query' in request.GET:
        form = SearchForm(request.GET)
        if form.is_valid():
            query = form.cleaned_data['query']
            results = Post.published.annotate(
                similarity=TrigramSimilarity('title', query),
            ).filter(similarity__gt=0.1).order_by('-similarity')
    return render(request,
                  'blog/post/search.html',
                  {'form': form,
                   'query': query,
                   'results': results})







""" def post_search(request):
    form = SearchForm()
    query = None
    results = []
    if 'query' in request.GET:
        form = SearchForm(request.GET)
        if form.is_valid():
            query = form.cleaned_data['query']
            search_vector = SearchVector('title', weight='A') + \
                            SearchVector('content', weight='B')
            search_query = SearchQuery(query)
            results = Post.published.annotate(
                search=search_vector,
                rank=SearchRank(search_vector, search_query)
            ).filter(rank__gte=0.3).order_by('-rank')
    return render(request,
                  'blog/post/search.html',
                  {'form': form,
                   'query': query,
                   'results': results})
 """

This is the complete Traceback I’m getting:

TypeError at /
'dict' object is not callable
Request Method:	GET
Request URL:	"  "
Django Version:	4.2.13
Exception Type:	TypeError
Exception Value:	
'dict' object is not callable
Exception Location:	C:\Users\USER\.virtualenvs\AnalyticsScout_V_1_1-2IRLUV3q\lib\site-packages\django\core\handlers\exception.py, line 55, in inner
Python Executable:	C:\Users\USER\.virtualenvs\AnalyticsScout_V_1_1-2IRLUV3q\Scripts\python.exe
Python Version:	3.9.16
Python Path:	
['C:\\Users\\USER\\OneDrive\\Bureau\\AnalyticsScout_V_1_1',
 'C:\\Users\\USER\\miniconda3\\python39.zip',
 'C:\\Users\\USER\\miniconda3\\DLLs',
 'C:\\Users\\USER\\miniconda3\\lib',
 'C:\\Users\\USER\\miniconda3',
 'C:\\Users\\USER\\.virtualenvs\\AnalyticsScout_V_1_1-2IRLUV3q',
 'C:\\Users\\USER\\.virtualenvs\\AnalyticsScout_V_1_1-2IRLUV3q\\lib\\site-packages']
Server time:	Tue, 18 Jun 2024 10:03:28 +0000
Traceback Switch to copy-and-paste view
C:\Users\USER\.virtualenvs\AnalyticsScout_V_1_1-2IRLUV3q\lib\site-packages\django\core\handlers\exception.py, line 55, in inner
                response = get_response(request) …
Local vars
Request information
USER
AnonymousUser

GET
No GET data

POST
No POST data

FILES
No FILES data

COOKIES
Variable	Value
django_language	
'en'
csrftoken	
'********************'
META
Variable	Value
ALLUSERSPROFILE	
'C:\\ProgramData'
APPDATA	
'C:\\Users\\USER\\AppData\\Roaming'
CHOCOLATEYINSTALL	
'C:\\ProgramData\\chocolatey'
CHOCOLATEYLASTPATHUPDATE	
'133313915542571400'
CHROME_CRASHPAD_PIPE_NAME	
'\\\\.\\pipe\\crashpad_2512_VRCCELMXHEQEIMLL'
COLORTERM	
'truecolor'
COMMONPROGRAMFILES	
'C:\\Program Files\\Common Files'
COMMONPROGRAMFILES(X86)	
'C:\\Program Files (x86)\\Common Files'
COMMONPROGRAMW6432	
'C:\\Program Files\\Common Files'
COMPUTERNAME	
'DRAMPC2'
COMSPEC	
'C:\\Windows\\system32\\cmd.exe'
CONDA_DEFAULT_ENV	
'base'
CONDA_EXE	
'C:\\Users\\USER\\miniconda3\\Scripts\\conda.exe'
CONDA_PREFIX	
'C:\\Users\\USER\\miniconda3'
CONDA_PROMPT_MODIFIER	
'(base) '
CONDA_PYTHON_EXE	
'C:\\Users\\USER\\miniconda3\\python.exe'
CONDA_SHLVL	
'1'
CONTENT_LENGTH	
''
CONTENT_TYPE	
'text/plain'
CSRF_COOKIE	
'iskYat1u1VM6fft2qjoNqGNT9GA9mzA5'
DJANGO_SETTINGS_MODULE	
'analyticsscout.settings'
DRIVERDATA	
'C:\\Windows\\System32\\Drivers\\DriverData'
GATEWAY_INTERFACE	
'CGI/1.1'
GDAL_DATA	
'C:\\Users\\USER\\miniconda3\\Library\\share\\gdal'
GDAL_DRIVER_PATH	
'C:\\Users\\USER\\miniconda3\\Library\\lib\\gdalplugins'
GEOTIFF_CSV	
'C:\\Users\\USER\\miniconda3\\Library\\share\\epsg_csv'
GIT_ASKPASS	
'********************'
HOMEDRIVE	
'C:'
HOMEPATH	
'\\Users\\USER'
HTTP_ACCEPT	
'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7'
HTTP_ACCEPT_ENCODING	
'gzip, deflate, br, zstd'
HTTP_ACCEPT_LANGUAGE	
'en-US,en;q=0.9'
HTTP_CONNECTION	
'keep-alive'
HTTP_COOKIE	
'********************'
HTTP_DNT	
' '
HTTP_HOST	
HTTP_REFERER	
' '
HTTP_SEC_CH_UA	
'"AVG Secure Browser";v="125", "Chromium";v="125", "Not.A/Brand";v="24"'
HTTP_SEC_CH_UA_MOBILE	
'?0'
HTTP_SEC_CH_UA_PLATFORM	
'"Windows"'
HTTP_SEC_FETCH_DEST	
'document'
HTTP_SEC_FETCH_MODE	
'navigate'
HTTP_SEC_FETCH_SITE	
'same-origin'
HTTP_SEC_FETCH_USER	
'?1'
HTTP_UPGRADE_INSECURE_REQUESTS	
'1'
HTTP_USER_AGENT	
('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like '
 'Gecko) Chrome/125.0.0.0 Safari/537.36 AVG/125.0.0.0')
LANG	
'en_US.UTF-8'
LOCALAPPDATA	
'C:\\Users\\USER\\AppData\\Local'
LOGONSERVER	
'\\\\DRAMPC2'
NUMBER_OF_PROCESSORS	
'4'
ONEDRIVE	
'C:\\Users\\USER\\OneDrive'
ONEDRIVECONSUMER	
'C:\\Users\\USER\\OneDrive'
OPENSSL_CONF	
'C:\\Program Files\\PostgreSQL\\psqlODBC\\etc\\openssl.cnf'
ORIGINAL_XDG_CURRENT_DESKTOP	
'undefined'
OS	
'Windows_NT'
PATH	
('c:\\Users\\USER\\.vscode\\extensions\\ms-python.python-2024.8.1\\python_files\\deactivate\\powershell;C:\\Users\\USER\\.virtualenvs\\AnalyticsScout_V_1_1-2IRLUV3q/Scripts;C:\\Users\\USER\\.virtualenvs\\AnalyticsScout_V_1_1-2IRLUV3q\\Scripts;C:\\Users\\USER\\miniconda3;C:\\Users\\USER\\miniconda3\\Library\\mingw-w64\\bin;C:\\Users\\USER\\miniconda3\\Library\\usr\\bin;C:\\Users\\USER\\miniconda3\\Library\\bin;C:\\Users\\USER\\miniconda3\\Scripts;C:\\Users\\USER\\miniconda3\\bin;C:\\Users\\USER\\miniconda3\\condabin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0;C:\\Windows\\System32\\OpenSSH;C:\\Program '
 'Files\\Git\\cmd;C:\\Program '
 'Files\\Graphviz\\bin;C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python311;C:\\ProgramData\\chocolatey\\bin;C:\\Program '
 'Files\\nodejs;C:\\Program Files (x86)\\Microsoft SQL '
 'Server\\160\\Tools\\Binn;C:\\Program Files\\Microsoft SQL '
 'Server\\160\\Tools\\Binn;C:\\Program Files\\Microsoft SQL Server\\Client '
 'SDK\\ODBC\\170\\Tools\\Binn;C:\\Program Files\\Microsoft SQL '
 'Server\\160\\DTS\\Binn;C:\\Program Files (x86)\\Microsoft SQL '
 'Server\\160\\DTS\\Binn;C:\\Program Files\\Azure Data Studio\\bin;C:\\Program '
 'Files\\PostgreSQL\\16\\bin;C:\\Users\\USER\\AppData\\Local\\Programs\\Quarto\\bin;C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python311\\Scripts;C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python311;C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Launcher;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0;C:\\Windows\\System32\\OpenSSH;C:\\Program '
 'Files\\Git\\cmd;C:\\Program '
 'Files\\Graphviz\\bin;C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python311;C:\\ProgramData\\chocolatey\\bin;C:\\Program '
 'Files\\nodejs;C:\\Program Files (x86)\\Microsoft SQL '
 'Server\\160\\Tools\\Binn;C:\\Program Files\\Microsoft SQL '
 'Server\\160\\Tools\\Binn;C:\\Program Files\\Microsoft SQL Server\\Client '
 'SDK\\ODBC\\170\\Tools\\Binn;C:\\Program Files\\Microsoft SQL '
 'Server\\160\\DTS\\Binn;C:\\Program Files (x86)\\Microsoft SQL '
 'Server\\160\\DTS\\Binn;C:\\Program Files\\Azure Data Studio\\bin;C:\\Program '
 'Files\\PostgreSQL\\16\\bin;.;"C:\\Users\\USER\\Python\\Python311\\Scripts;C:\\Users\\USER\\AppData\\Roaming\\Python\\Python311\\Scripts";"C:\\Users\\USER\\AppData\\Local\\Programs\\Microsoft '
 'VS '
 'Code\\bin;C:\\Users\\USER\\.pyenv\\pyenv-win\\bin";C:\\Users\\USER\\AppData\\Local\\Programs\\Microsoft '
 'VS Code\\bin;C:\\Users\\USER\\AppData\\Roaming\\npm;C:\\Program Files\\Azure '
 'Data Studio\\bin;.')
PATHEXT	
'.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC'
PATH_INFO	
'/'
PIPENV_ACTIVE	
'1'
PIP_DISABLE_PIP_VERSION_CHECK	
'1'
PIP_PYTHON_PATH	
'C:\\Users\\USER\\miniconda3\\python.exe'
PROCESSOR_ARCHITECTURE	
'AMD64'
PROCESSOR_IDENTIFIER	
'Intel64 Family 6 Model 69 Stepping 1, GenuineIntel'
PROCESSOR_LEVEL	
'6'
PROCESSOR_REVISION	
'4501'
PROGRAMDATA	
'C:\\ProgramData'
PROGRAMFILES	
'C:\\Program Files'
PROGRAMFILES(X86)	
'C:\\Program Files (x86)'
PROGRAMW6432	
'C:\\Program Files'
PROJ_DATA	
'C:\\Users\\USER\\miniconda3\\Library\\share\\proj'
PROJ_NETWORK	
'ON'
PROMPT	
'(AnalyticsScout_V_1_1-2IRLUV3q) (base) $P$G'
PSMODULEPATH	
('C:\\Program '
 'Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules;C:\\Program '
 'Files (x86)\\Microsoft SQL Server\\160\\Tools\\PowerShell\\Modules\\')
PUBLIC	
'C:\\Users\\Public'
PYENV	
'C:\\Users\\USER\\.pyenv\\pyenv-win\\bin'
PYTHONDONTWRITEBYTECODE	
'1'
QUERY_STRING	
''
REMOTE_ADDR	
'127.0.0.1'
REMOTE_HOST	
''
REQUEST_METHOD	
'GET'
RUN_MAIN	
'true'
SCRIPT_NAME	
''
SERVER_NAME	
'kubernetes.docker.internal'
SERVER_PORT	
'8000'
SERVER_PROTOCOL	
'HTTP/1.1'
SERVER_SOFTWARE	
'WSGIServer/0.2'
SESSIONNAME	
'Console'
SYSTEMDRIVE	
'C:'
SYSTEMROOT	
'C:\\Windows'
TEMP	
'C:\\Users\\USER\\AppData\\Local\\Temp'
TERM_PROGRAM	
'vscode'
TERM_PROGRAM_VERSION	
'1.90.1'
TMP	
'C:\\Users\\USER\\AppData\\Local\\Temp'
USERDOMAIN	
'DRAMPC2'
USERDOMAIN_ROAMINGPROFILE	
'DRAMPC2'
USERNAME	
'USER'
USERPROFILE	
'C:\\Users\\USER'
VIRTUAL_ENV	
'C:\\Users\\USER\\.virtualenvs\\AnalyticsScout_V_1_1-2IRLUV3q'
VSCODE_ENV_PREPEND	
'PATH=c\\x3a\\Users\\USER\\.vscode\\extensions\\ms-python.python-2024.8.1\\python_files\\deactivate\\powershell;C\\x3a\\Users\\USER\\.virtualenvs\\AnalyticsScout_V_1_1-2IRLUV3q/Scripts;'
VSCODE_GIT_ASKPASS_EXTRA_ARGS	
'********************'
VSCODE_GIT_ASKPASS_MAIN	
'********************'
VSCODE_GIT_ASKPASS_NODE	
'********************'
VSCODE_GIT_IPC_HANDLE	
'\\\\.\\pipe\\vscode-git-a1238c0127-sock'
WINDIR	
'C:\\Windows'
XML_CATALOG_FILES	
'file:///C:/Users/USER/miniconda3/etc/xml/catalog'
wsgi.errors	
<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>
wsgi.file_wrapper	
<class 'wsgiref.util.FileWrapper'>
wsgi.input	
<django.core.handlers.wsgi.LimitedStream object at 0x0000027D2D99BF40>
wsgi.multiprocess	
False
wsgi.multithread	
True
wsgi.run_once	
False
wsgi.url_scheme	
'http'
wsgi.version	
(1, 0)
Settings
Using settings module analyticsscout.settings
Setting	Value
ABSOLUTE_URL_OVERRIDES	
{}
ADMINS	
[]
ALLOWED_HOSTS	
[]
APPEND_SLASH	
True
AUTHENTICATION_BACKENDS	
['django.contrib.auth.backends.ModelBackend']
AUTH_PASSWORD_VALIDATORS	
'********************'
AUTH_USER_MODEL	
'auth.User'
BASE_DIR	
WindowsPath('C:/Users/USER/OneDrive/Bureau/AnalyticsScout_V_1_1')
CACHES	
{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS	
'default'
CACHE_MIDDLEWARE_KEY_PREFIX	
'********************'
CACHE_MIDDLEWARE_SECONDS	
600
CMS_CONFIRM_VERSION4	
True
CMS_TEMPLATES	
[('base.html', 'Standard'),
 ('home.html', 'Home page template'),
 ('bootstrap5.html', 'Bootstrap 5 Demo'),
 ('whitenoise-static-files-demo.html', 'Static File Demo')]
CSRF_COOKIE_AGE	
31449600
CSRF_COOKIE_DOMAIN	
None
CSRF_COOKIE_HTTPONLY	
False
CSRF_COOKIE_MASKED	
False
CSRF_COOKIE_NAME	
'csrftoken'
CSRF_COOKIE_PATH	
'/'
CSRF_COOKIE_SAMESITE	
'Lax'
CSRF_COOKIE_SECURE	
False
CSRF_FAILURE_VIEW	
'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME	
'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS	
[]
CSRF_USE_SESSIONS	
False
DATABASES	
{'default': {'ATOMIC_REQUESTS': False,
             'AUTOCOMMIT': True,
             'CONN_HEALTH_CHECKS': False,
             'CONN_MAX_AGE': 0,
             'ENGINE': 'django.db.backends.postgresql',
             'HOST': 'localhost',
             'NAME': 'analyticsscdb',
             'OPTIONS': {},
             'PASSWORD': '********************',
             'PORT': '5432',
             'TEST': {'CHARSET': None,
                      'COLLATION': None,
                      'MIGRATE': True,
                      'MIRROR': None,
                      'NAME': None},
             'TIME_ZONE': None,
             'USER': 'postgres'}}
DATABASE_ROUTERS	
[]
DATA_UPLOAD_MAX_MEMORY_SIZE	
2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS	
1000
DATA_UPLOAD_MAX_NUMBER_FILES	
100
DATETIME_FORMAT	
'N j, Y, P'
DATETIME_INPUT_FORMATS	
['%Y-%m-%d %H:%M:%S',
 '%Y-%m-%d %H:%M:%S.%f',
 '%Y-%m-%d %H:%M',
 '%m/%d/%Y %H:%M:%S',
 '%m/%d/%Y %H:%M:%S.%f',
 '%m/%d/%Y %H:%M',
 '%m/%d/%y %H:%M:%S',
 '%m/%d/%y %H:%M:%S.%f',
 '%m/%d/%y %H:%M']
DATE_FORMAT	
'N j, Y'
DATE_INPUT_FORMATS	
['%Y-%m-%d',
 '%m/%d/%Y',
 '%m/%d/%y',
 '%b %d %Y',
 '%b %d, %Y',
 '%d %b %Y',
 '%d %b, %Y',
 '%B %d %Y',
 '%B %d, %Y',
 '%d %B %Y',
 '%d %B, %Y']
DEBUG	
True
DEBUG_PROPAGATE_EXCEPTIONS	
False
DECIMAL_SEPARATOR	
'.'
DEFAULT_AUTO_FIELD	
'django.db.models.BigAutoField'
DEFAULT_CHARSET	
'utf-8'
DEFAULT_EXCEPTION_REPORTER	
'django.views.debug.ExceptionReporter'
DEFAULT_EXCEPTION_REPORTER_FILTER	
'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FILE_STORAGE	
'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL	
'webmaster@localhost'
DEFAULT_INDEX_TABLESPACE	
''
DEFAULT_TABLESPACE	
''
DISALLOWED_USER_AGENTS	
[]
DJANGOCMS_VERSIONING_ALLOW_DELETING_VERSIONS	
True
EMAIL_BACKEND	
'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST	
'smtpxxxxx'
EMAIL_HOST_PASSWORD	
'********************'
EMAIL_HOST_USER	
'xxxxx'
EMAIL_PORT	
587
EMAIL_SSL_CERTFILE	
None
EMAIL_SSL_KEYFILE	
'********************'
EMAIL_SUBJECT_PREFIX	
'[Django] '
EMAIL_TIMEOUT	
None
EMAIL_USE_LOCALTIME	
False
EMAIL_USE_SSL	
False
EMAIL_USE_TLS	
True
FILER_IMAGE_MODEL	
'filer.Image'
FILE_UPLOAD_DIRECTORY_PERMISSIONS	
None
FILE_UPLOAD_HANDLERS	
['django.core.files.uploadhandler.MemoryFileUploadHandler',
 'django.core.files.uploadhandler.TemporaryFileUploadHandler']
FILE_UPLOAD_MAX_MEMORY_SIZE	
2621440
FILE_UPLOAD_PERMISSIONS	
420
FILE_UPLOAD_TEMP_DIR	
None
FIRST_DAY_OF_WEEK	
0
FIXTURE_DIRS	
[]
FORCE_SCRIPT_NAME	
None
FORMAT_MODULE_PATH	
None
FORM_RENDERER	
'django.forms.renderers.DjangoTemplates'
IGNORABLE_404_URLS	
[]
INSTALLED_APPS	
['djangocms_admin_style',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.sites',
 'django.contrib.sitemaps',
 'django.contrib.postgres',
 'debug_toolbar',
 'cms',
 'menus',
 'treebeard',
 'sekizai',
 'djangocms_versioning',
 'djangocms_alias',
 'djangocms_text_ckeditor',
 'filer',
 'easy_thumbnails',
 'djangocms_frontend',
 'djangocms_frontend.contrib.accordion',
 'djangocms_frontend.contrib.alert',
 'djangocms_frontend.contrib.badge',
 'djangocms_frontend.contrib.card',
 'djangocms_frontend.contrib.carousel',
 'djangocms_frontend.contrib.collapse',
 'djangocms_frontend.contrib.content',
 'djangocms_frontend.contrib.grid',
 'djangocms_frontend.contrib.icon',
 'djangocms_frontend.contrib.image',
 'djangocms_frontend.contrib.jumbotron',
 'djangocms_frontend.contrib.link',
 'djangocms_frontend.contrib.listgroup',
 'djangocms_frontend.contrib.media',
 'djangocms_frontend.contrib.navigation',
 'djangocms_frontend.contrib.tabs',
 'djangocms_frontend.contrib.utilities',
 'djangocms_file',
 'djangocms_picture',
 'djangocms_video',
 'djangocms_googlemap',
 'djangocms_snippet',
 'djangocms_style',
 'analyticsground.apps.AnalyticsgroundConfig',
 'blog.apps.BlogConfig',
 'tag',
 'like',
 'taggit']
INTERNAL_IPS	
['127.0.0.1']
LANGUAGES	
[('en', 'English'), ('fr', 'French')]
LANGUAGES_BIDI	
['he', 'ar', 'ar-dz', 'ckb', 'fa', 'ur']
LANGUAGE_CODE	
'en'
LANGUAGE_COOKIE_AGE	
None
LANGUAGE_COOKIE_DOMAIN	
None
LANGUAGE_COOKIE_HTTPONLY	
False
LANGUAGE_COOKIE_NAME	
'django_language'
LANGUAGE_COOKIE_PATH	
'/'
LANGUAGE_COOKIE_SAMESITE	
None
LANGUAGE_COOKIE_SECURE	
False
LOCALE_PATHS	
[]
LOGGING	
{}
LOGGING_CONFIG	
'logging.config.dictConfig'
LOGIN_REDIRECT_URL	
'/accounts/profile/'
LOGIN_URL	
'/accounts/login/'
LOGOUT_REDIRECT_URL	
None
MANAGERS	
[]
MEDIA_ROOT	
'C:\\Users\\USER\\OneDrive\\Bureau\\AnalyticsScout_V_1_1\\media'
MEDIA_URL	
'/media/'
MESSAGE_STORAGE	
'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE	
['debug_toolbar.middleware.DebugToolbarMiddleware',
 'django.middleware.security.SecurityMiddleware',
 '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',
 'django.middleware.locale.LocaleMiddleware',
 'whitenoise.middleware.WhiteNoiseMiddleware',
 'cms.middleware.user.CurrentUserMiddleware',
 'cms.middleware.page.CurrentPageMiddleware',
 'cms.middleware.toolbar.ToolbarMiddleware',
 'cms.middleware.language.LanguageCookieMiddleware',
 'cms.middleware.utils.ApphookReloadMiddleware',
 'cms.context_processors.cms_settings']
MIGRATION_MODULES	
{}
MONTH_DAY_FORMAT	
'F j'
NUMBER_GROUPING	
0
PASSWORD_HASHERS	
'********************'
PASSWORD_RESET_TIMEOUT	
'********************'
PREPEND_WWW	
False
ROOT_URLCONF	
'analyticsscout.urls'
SECRET_KEY	
'********************'
SECRET_KEY_FALLBACKS	
'********************'
SECURE_CONTENT_TYPE_NOSNIFF	
True
SECURE_CROSS_ORIGIN_OPENER_POLICY	
'same-origin'
SECURE_HSTS_INCLUDE_SUBDOMAINS	
False
SECURE_HSTS_PRELOAD	
False
SECURE_HSTS_SECONDS	
0
SECURE_PROXY_SSL_HEADER	
None
SECURE_REDIRECT_EXEMPT	
[]
SECURE_REFERRER_POLICY	
'same-origin'
SECURE_SSL_HOST	
None
SECURE_SSL_REDIRECT	
False
SERVER_EMAIL	
'root@localhost'
SESSION_CACHE_ALIAS	
'default'
SESSION_COOKIE_AGE	
1209600
SESSION_COOKIE_DOMAIN	
None
SESSION_COOKIE_HTTPONLY	
True
SESSION_COOKIE_NAME	
'sessionid'
SESSION_COOKIE_PATH	
'/'
SESSION_COOKIE_SAMESITE	
'Lax'
SESSION_COOKIE_SECURE	
False
SESSION_ENGINE	
'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE	
False
SESSION_FILE_PATH	
None
SESSION_SAVE_EVERY_REQUEST	
False
SESSION_SERIALIZER	
'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE	
'analyticsscout.settings'
SHORT_DATETIME_FORMAT	
'm/d/Y P'
SHORT_DATE_FORMAT	
'm/d/Y'
SIGNING_BACKEND	
'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS	
[]
SITE_ID	
1
STATICFILES_DIRS	
[]
STATICFILES_FINDERS	
['django.contrib.staticfiles.finders.FileSystemFinder',
 'django.contrib.staticfiles.finders.AppDirectoriesFinder']
STATICFILES_STORAGE	
'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT	
None
STATIC_URL	
'/static/'
STORAGES	
{'default': {'BACKEND': 'django.core.files.storage.FileSystemStorage'},
 'staticfiles': {'BACKEND': 'django.contrib.staticfiles.storage.StaticFilesStorage'}}
TAGGIT_CASE_INSENSITIVE	
True
TEMPLATES	
[{'APP_DIRS': True,
  'BACKEND': 'django.template.backends.django.DjangoTemplates',
  'DIRS': ['C:\\Users\\USER\\OneDrive\\Bureau\\AnalyticsScout_V_1_1\\analyticsscout\\templates'],
  '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',
                                     'django.template.context_processors.i18n',
                                     'sekizai.context_processors.sekizai'],
              'libraries': {'blog_tags': 'blog.templatetags.blog_tags'}}}]
TEST_NON_SERIALIZED_APPS	
[]
TEST_RUNNER	
'django.test.runner.DiscoverRunner'
THOUSAND_SEPARATOR	
','
THUMBNAIL_HIGH_RESOLUTION	
True
THUMBNAIL_PROCESSORS	
('easy_thumbnails.processors.colorspace',
 'easy_thumbnails.processors.autocrop',
 'filer.thumbnail_processors.scale_and_crop_with_subject_location',
 'easy_thumbnails.processors.filters')
TIME_FORMAT	
'P'
TIME_INPUT_FORMATS	
['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']
TIME_ZONE	
'UTC'
USE_DEPRECATED_PYTZ	
False
USE_I18N	
True
USE_L10N	
True
USE_THOUSAND_SEPARATOR	
False
USE_TZ	
True
USE_X_FORWARDED_HOST	
False
USE_X_FORWARDED_PORT	
False
WSGI_APPLICATION	
'analyticsscout.wsgi.application'
X_FRAME_OPTIONS	
'SAMEORIGIN'
YEAR_MONTH_FORMAT	
'F Y'
You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard page generated by the handler for this status code.

Side note: When posting code 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’ve taken the liberty of fixing your original post for you.)

I asked for the view that was generating the error.

Your urls are defined such that:

I do not see a view named home in your views.py

Finally, when asked for a traceback, please post the traceback from the server console, not the browser window. (The browser window is showing an error page, not a traceback.) Please copy/paste the traceback from the server console.

Sorry for the missing view.

analyticsground>views.py:

from django.shortcuts import render
from .models import DataVisualization, CaseStudie, IndustryTrend


# Create your views here.


def industry_trends(request):
    industrytrends = IndustryTrend.objects.all()
    context = {
        'industrytrends': industrytrends
    }

    return render(request, 'analyticsground/industry_trends.html', context)



def case_studies(request):   
    casestudies = CaseStudie.objects.all()
    context = {
        'casestudies': casestudies
    }

    return render(request, 'analyticsground/case_studies.html', context)



def data_visualization(request):
    datavisualizations = DataVisualization.objects.all()
    context = {
        'datavisualizations': datavisualizations
    }

    return render(request, 'analyticsground/data_visualization.html', context)




def home(request):
    return render(request, 'analyticsground/home.html')


def blog(request):
    return render(request, 'blog.html')

def contact(request):
    return render(request, 'analyticsground/contact.html')


def data_viz(request):
    return render(request, 'analyticsground/data_viz.html')

blog>views.py:

from django.shortcuts import render, get_object_or_404
from django.core.paginator import Paginator, EmptyPage,\
                                  PageNotAnInteger
from django.views.generic import ListView
from django.core.mail import send_mail
from django.views.decorators.http import require_POST
from django.db.models import Q
from .models import Post, MyData
from taggit.models import Tag

# ...
from django.contrib.postgres.search import SearchVector, TrigramSimilarity,\
                                           SearchQuery, SearchRank
from .forms import EmailPostForm, CommentForm, SearchForm
# ...

def post_list(request, tag_slug=None):
    post_list = Post.published.all()
    tag = None
    if tag_slug:
        tag = get_object_or_404(Tag, slug=tag_slug)
        post_list = post_list.filter(tags__in=[tag])
    # Pagination with 3 posts per page
    paginator = Paginator(post_list, 3)
    page_number = request.GET.get('page', 1)
    try:
        posts = paginator.page(page_number)
    except PageNotAnInteger:
        # If page_number is not an integer deliver the first page
        posts = paginator.page(1)
    except EmptyPage:
        # If page_number is out of range deliver last page of results
        posts = paginator.page(paginator.num_pages)
    return render(request,
                 'blog/post/list.html',
                 {'posts': posts,
                  'tag': tag})


       
def post_share(request, post_id):
    # Retrieve post by id
    post = get_object_or_404(Post, id=post_id, status=Post.Status.PUBLISHED)
    sent = False
    if request.method == 'POST':
        # Form was submitted
        form = EmailPostForm(request.POST)
        if form.is_valid():
            # Form fields passed validation
            cd = form.cleaned_data
            post_url = request.build_absolute_uri(
                post.get_absolute_url())
            subject = f"{cd['name']} recommends you read " \
                      f"{post.title}"
            message = f"Read {post.title} at {post_url}\n\n" \
                      f"{cd['name']}\'s comments: {cd['comments']}"
            send_mail(subject, message, 'dbsbox@gmail.com',
                      [cd['to']])
            sent = True
    else:
        form = EmailPostForm()
    return render(request, 'blog/post/share.html', {'post': post,
                                                    'form': form,
                                                    'sent': sent})


@require_POST
def post_comment(request, post_id):
    post = get_object_or_404(Post, id=post_id, status=Post.Status.PUBLISHED)
    comment = None
    # A comment was posted
    form = CommentForm(data=request.POST)
    if form.is_valid():
        # Create a Comment object without saving it to the database
        comment = form.save(commit=False)
        # Assign the post to the comment
        comment.post = post
        # Save the comment to the database
        comment.save()
    return render(request, 'blog/post/comment.html',
                           {'post': post,
                            'form': form,
                            'comment': comment})

def post_detail(request, year, month, day, post):
    post = get_object_or_404(Post,
                             status=Post.Status.PUBLISHED,
                             slug=post,
                             publish__year=year,
                             publish__month=month,
                             publish__day=day)
    # List of active comments for this post
    comments = post.comments.filter(active=True)
    # Form for users to comment
    form = CommentForm()
    return render(request,
                  'blog/post/detail.html',
                  {'post': post,
                   'comments': comments,
                   'form': form})


def post_search(request):
    form = SearchForm()
    query = None
    results = []
    if 'query' in request.GET:
        form = SearchForm(request.GET)
        if form.is_valid():
            query = form.cleaned_data['query']
            results = Post.published.annotate(
                similarity=TrigramSimilarity('title', query),
            ).filter(similarity__gt=0.1).order_by('-similarity')
    return render(request,
                  'blog/post/search.html',
                  {'form': form,
                   'query': query,
                   'results': results})

In VS Code integrated terminal I have this:

Microsoft Windows [Version 10.0.22000.2538]
(c) Microsoft Corporation. All rights reserved.

(AnalyticsScout_V_1_1-2IRLUV3q) (base) C:\Users\USER\OneDrive\Bureau\AnalyticsScout_V_1_1>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
June 18, 2024 - 12:21:51
Django version 4.2.13, using settings 'analyticsscout.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.

In fact, I am getting a traceback when I run http://127.0.0.1:8000/ in the browser.

If you are not seeing a traceback in this console after making your request - and getting the error in the browser window, then you’ve got another instance of the server still running somewhere. You’ll need to find that process and terminate it.

You are right. I restarted my computer then I got this in the terminal:


(base) C:\Users\USER\OneDrive\Bureau>cd analyticsscout_v_1_1

(base) C:\Users\USER\OneDrive\Bureau\AnalyticsScout_V_1_1>pipenv shell
Launching subshell in virtual environment...
Microsoft Windows [Version 10.0.22000.2538]
(c) Microsoft Corporation. All rights reserved.

(AnalyticsScout_V_1_1-2IRLUV3q) (base) C:\Users\USER\OneDrive\Bureau\AnalyticsScout_V_1_1>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
June 18, 2024 - 16:01:15
Django version 4.2.13, using settings 'analyticsscout.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.

Internal Server Error: /
Traceback (most recent call last):
  File "C:\Users\USER\.virtualenvs\AnalyticsScout_V_1_1-2IRLUV3q\lib\site-packages\django\core\handlers\exception.py", line 55, in inner
    response = get_response(request)
TypeError: 'dict' object is not callable
[18/Jun/2024 16:02:02] "GET / HTTP/1.1" 500 72820
Internal Server Error: /favicon.ico
Traceback (most recent call last):
  File "C:\Users\USER\.virtualenvs\AnalyticsScout_V_1_1-2IRLUV3q\lib\site-packages\django\core\handlers\exception.py", line 55, in inner
    response = get_response(request)
TypeError: 'dict' object is not callable
[18/Jun/2024 16:02:03] "GET /favicon.ico HTTP/1.1" 500 72720

Unfortunately, I don’t see anything wrong with what you’ve posted, but I also don’t know anything about Django CMS to know what to look for in it.

Hopefully, someone more familiar with Django CMS can pitch in here to help find what’s wrong.