TemplateDoesNotExist at /
rest_framework/api.html
| Request Method: |
GET |
| Request URL: |
http://api.alcode.ma/ |
| undefined |
—: |
| Django Version: |
5.1.3 |
| undefined |
—: |
| Exception Type: |
TemplateDoesNotExist |
| undefined |
—: |
| Exception Value: |
|
| undefined |
—: |
rest_framework/api.html
| Exception Location: |
/home/ubuntu/alcodeBackend/venv/lib/python3.10/site-packages/django/template/loader.py, line 19, in get_template |
| Raised during: |
app.views.Category_queries |
| undefined |
—: |
| Python Executable: |
/home/ubuntu/alcodeBackend/venv/bin/python3 |
| undefined |
—: |
| Python Version: |
3.10.12 |
| undefined |
—: |
| Python Path: |
|
| undefined |
—: |
['/home/ubuntu/alcodeBackend',
'/home/ubuntu/alcodeBackend/venv/bin',
'/usr/lib/python310.zip',
'/usr/lib/python3.10',
'/usr/lib/python3.10/lib-dynload',
'/home/ubuntu/alcodeBackend/venv/lib/python3.10/site-packages']
| Server time: |
Tue, 09 Dec 2025 01:04:41 +0000 |
Template-loader postmortem
Django tried loading these templates, in this order:
Using engine :
- This engine did not provide a list of tried templates.
-
/home/ubuntu/alcodeBackend/venv/lib/python3.10/site-packages/django/core/handlers/exception.py, line 55, in inner
-
response = get_response(request)
…
Local vars
TemplateDoesNotExist('rest_framework/api.html')
<bound method BaseHandler._get_response of <django.core.handlers.wsgi.WSGIHandler object at 0x7197460ff9a0>>
<WSGIRequest: GET '/'>
-
/home/ubuntu/alcodeBackend/venv/lib/python3.10/site-packages/django/core/handlers/base.py, line 220, in _get_response
-
response = response.render()
…
Local vars
<function View.as_view.<locals>.view at 0x719745627ac0>
()
{}
<bound method CsrfViewMiddleware.process_view of <CsrfViewMiddleware get_response=convert_exception_to_response.<locals>.inner>>
<WSGIRequest: GET '/'>
None
<django.core.handlers.wsgi.WSGIHandler object at 0x7197460ff9a0>
<function View.as_view.<locals>.view at 0x719745627ac0>
-
/home/ubuntu/alcodeBackend/venv/lib/python3.10/site-packages/django/template/response.py, line 114, in render
-
self.content = self.rendered_content
…
Local vars
<Response status_code=200, "text/html; charset=utf-8">
<Response status_code=200, "text/html; charset=utf-8">
-
/home/ubuntu/alcodeBackend/venv/lib/python3.10/site-packages/rest_framework/response.py, line 74, in rendered_content
-
ret = renderer.render(self.data, accepted_media_type, context)
…
Local vars
| Variable |
Value |
| accepted_media_type |
|
'text/html'
'utf-8'
'text/html; charset=utf-8'
{'args': (),
'kwargs': {},
'request': <rest_framework.request.Request: GET '/'>,
'response': <Response status_code=200, "text/html; charset=utf-8">,
'view': <app.views.WrappedAPIView object at 0x7197455049a0>}
'text/html'
<rest_framework.renderers.BrowsableAPIRenderer object at 0x7197455061d0>
<Response status_code=200, "text/html; charset=utf-8">
-
/home/ubuntu/alcodeBackend/venv/lib/python3.10/site-packages/rest_framework/renderers.py, line 726, in render
-
template = loader.get_template(self.template)
…
Local vars
| Variable |
Value |
| accepted_media_type |
|
'text/html'
'you are home'
{'args': (),
'kwargs': {},
'request': <rest_framework.request.Request: GET '/'>,
'response': <Response status_code=200, "text/html; charset=utf-8">,
'view': <app.views.WrappedAPIView object at 0x7197455049a0>}
<rest_framework.renderers.BrowsableAPIRenderer object at 0x7197455061d0>
-
/home/ubuntu/alcodeBackend/venv/lib/python3.10/site-packages/django/template/loader.py, line 19, in get_template
-
raise TemplateDoesNotExist(template_name, chain=chain)
…
Local vars
[]
[]
'rest_framework/api.html'
None
Request information
USER
AnonymousUser
GET
No GET data
POST
No POST data
FILES
No FILES data
COOKIES
No cookie data
META
| Variable |
Value |
| 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'
'gzip, deflate, br, zstd'
'en-FR,en;q=0.9,fr-FR;q=0.8,fr;q=0.7,ar-XB;q=0.6,ar;q=0.5,en-GB;q=0.4,en-US;q=0.3'
'no-cache'
'close'
'api.alcode.ma'
'no-cache'
'"Chromium";v="142", "Google Chrome";v="142", "Not_A Brand";v="99"'
'?0'
'"Windows"'
'document'
'navigate'
'none'
'?1'
| HTTP_UPGRADE_INSECURE_REQUESTS |
|
'1'
('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like '
'Gecko) Chrome/142.0.0.0 Safari/537.36')
'/'
''
'/'
'127.0.0.1'
'52680'
'GET'
''
'127.0.0.1'
'8001'
'HTTP/1.0'
'gunicorn/23.0.0'
<socket.socket fd=9, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 8001), raddr=('127.0.0.1', 52680)>
<gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x719745504ee0>
<class 'gunicorn.http.wsgi.FileWrapper'>
<gunicorn.http.body.Body object at 0x719745504af0>
True
True
False
False
'http'
(1, 0)
Settings
Using settings module backend.settings
| Setting |
Value |
| ABSOLUTE_URL_OVERRIDES |
|
{}
[]
['api.alcode.ma', '16.171.173.31', 'localhost', '127.0.0.1']
True
['django.contrib.auth.backends.ModelBackend']
'********************'
'auth.User'
PosixPath('/home/ubuntu/alcodeBackend')
{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
'default'
| CACHE_MIDDLEWARE_KEY_PREFIX |
|
'********************'
600
['https://alcode.ma', 'http://alcode.ma']
False
31449600
None
False
'csrftoken'
'/'
'Lax'
False
'django.views.csrf.csrf_failure'
'HTTP_X_CSRFTOKEN'
[]
False
{'default': {'ATOMIC_REQUESTS': False,
'AUTOCOMMIT': True,
'CONN_HEALTH_CHECKS': False,
'CONN_MAX_AGE': 0,
'ENGINE': 'django.db.backends.sqlite3',
'HOST': '',
'NAME': PosixPath('/home/ubuntu/alcodeBackend/db.sqlite3'),
'OPTIONS': {},
'PASSWORD': '********************',
'PORT': '',
'TEST': {'CHARSET': None,
'COLLATION': None,
'MIGRATE': True,
'MIRROR': None,
'NAME': None},
'TIME_ZONE': None,
'USER': ''}}
[]
| DATA_UPLOAD_MAX_MEMORY_SIZE |
|
2621440
| DATA_UPLOAD_MAX_NUMBER_FIELDS |
|
1000
| DATA_UPLOAD_MAX_NUMBER_FILES |
|
100
'N j, Y, P'
['%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']
'N j, Y'
['%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']
True
| DEBUG_PROPAGATE_EXCEPTIONS |
|
False
'.'
'django.db.models.BigAutoField'
'utf-8'
| DEFAULT_EXCEPTION_REPORTER |
|
'django.views.debug.ExceptionReporter'
| DEFAULT_EXCEPTION_REPORTER_FILTER |
|
'django.views.debug.SafeExceptionReporterFilter'
'webmaster@localhost'
''
''
[]
'django.core.mail.backends.smtp.EmailBackend'
'localhost'
'********************'
''
25
None
'********************'
'[Django] '
None
False
False
False
| FILE_UPLOAD_DIRECTORY_PERMISSIONS |
|
None
['django.core.files.uploadhandler.MemoryFileUploadHandler',
'django.core.files.uploadhandler.TemporaryFileUploadHandler']
| FILE_UPLOAD_MAX_MEMORY_SIZE |
|
2621440
420
None
0
[]
None
None
| FORMS_URLFIELD_ASSUME_HTTPS |
|
False
'django.forms.renderers.DjangoTemplates'
[]
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'corsheaders',
'rest_framework',
'rest_framework_simplejwt',
'app.apps.AppConfig']
[]
[('af', 'Afrikaans'),
('ar', 'Arabic'),
('ar-dz', 'Algerian Arabic'),
('ast', 'Asturian'),
('az', 'Azerbaijani'),
('bg', 'Bulgarian'),
('be', 'Belarusian'),
('bn', 'Bengali'),
('br', 'Breton'),
('bs', 'Bosnian'),
('ca', 'Catalan'),
('ckb', 'Central Kurdish (Sorani)'),
('cs', 'Czech'),
('cy', 'Welsh'),
('da', 'Danish'),
('de', 'German'),
('dsb', 'Lower Sorbian'),
('el', 'Greek'),
('en', 'English'),
('en-au', 'Australian English'),
('en-gb', 'British English'),
('eo', 'Esperanto'),
('es', 'Spanish'),
('es-ar', 'Argentinian Spanish'),
('es-co', 'Colombian Spanish'),
('es-mx', 'Mexican Spanish'),
('es-ni', 'Nicaraguan Spanish'),
('es-ve', 'Venezuelan Spanish'),
('et', 'Estonian'),
('eu', 'Basque'),
('fa', 'Persian'),
('fi', 'Finnish'),
('fr', 'French'),
('fy', 'Frisian'),
('ga', 'Irish'),
('gd', 'Scottish Gaelic'),
('gl', 'Galician'),
('he', 'Hebrew'),
('hi', 'Hindi'),
('hr', 'Croatian'),
('hsb', 'Upper Sorbian'),
('hu', 'Hungarian'),
('hy', 'Armenian'),
('ia', 'Interlingua'),
('id', 'Indonesian'),
('ig', 'Igbo'),
('io', 'Ido'),
('is', 'Icelandic'),
('it', 'Italian'),
('ja', 'Japanese'),
('ka', 'Georgian'),
('kab', 'Kabyle'),
('kk', 'Kazakh'),
('km', 'Khmer'),
('kn', 'Kannada'),
('ko', 'Korean'),
('ky', 'Kyrgyz'),
('lb', 'Luxembourgish'),
('lt', 'Lithuanian'),
('lv', 'Latvian'),
('mk', 'Macedonian'),
('ml', 'Malayalam'),
('mn', 'Mongolian'),
('mr', 'Marathi'),
('ms', 'Malay'),
('my', 'Burmese'),
('nb', 'Norwegian Bokmål'),
('ne', 'Nepali'),
('nl', 'Dutch'),
('nn', 'Norwegian Nynorsk'),
('os', 'Ossetic'),
('pa', 'Punjabi'),
('pl', 'Polish'),
('pt', 'Portuguese'),
('pt-br', 'Brazilian Portuguese'),
('ro', 'Romanian'),
('ru', 'Russian'),
('sk', 'Slovak'),
('sl', 'Slovenian'),
('sq', 'Albanian'),
('sr', 'Serbian'),
('sr-latn', 'Serbian Latin'),
('sv', 'Swedish'),
('sw', 'Swahili'),
('ta', 'Tamil'),
('te', 'Telugu'),
('tg', 'Tajik'),
('th', 'Thai'),
('tk', 'Turkmen'),
('tr', 'Turkish'),
('tt', 'Tatar'),
('udm', 'Udmurt'),
('ug', 'Uyghur'),
('uk', 'Ukrainian'),
('ur', 'Urdu'),
('uz', 'Uzbek'),
('vi', 'Vietnamese'),
('zh-hans', 'Simplified Chinese'),
('zh-hant', 'Traditional Chinese')]
['he', 'ar', 'ar-dz', 'ckb', 'fa', 'ug', 'ur']
'en-us'
None
None
False
'django_language'
'/'
None
False
[]
{}
'logging.config.dictConfig'
'/accounts/profile/'
'/accounts/login/'
None
[]
'/home/ubuntu/alcodeBackend/media'
'/media/'
'django.contrib.messages.storage.fallback.FallbackStorage'
['corsheaders.middleware.CorsMiddleware',
'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']
{}
'F j'
0
'********************'
'********************'
False
{'DEFAULT_AUTHENTICATION_CLASSES': ('rest_framework_simplejwt.authentication.JWTAuthentication',)}
'backend.urls'
'********************'
'********************'
| SECURE_CONTENT_TYPE_NOSNIFF |
|
True
| SECURE_CROSS_ORIGIN_OPENER_POLICY |
|
'same-origin'
| SECURE_HSTS_INCLUDE_SUBDOMAINS |
|
False
False
0
None
[]
'same-origin'
None
False
'root@localhost'
'default'
1209600
None
True
'sessionid'
'/'
'Lax'
False
'django.contrib.sessions.backends.db'
| SESSION_EXPIRE_AT_BROWSER_CLOSE |
|
False
None
| SESSION_SAVE_EVERY_REQUEST |
|
False
'django.contrib.sessions.serializers.JSONSerializer'
'backend.settings'
'm/d/Y P'
'm/d/Y'
'django.core.signing.TimestampSigner'
[]
[]
['django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder']
'/home/ubuntu/alcodeBackend/static'
'/static/'
{'default': {'BACKEND': 'django.core.files.storage.FileSystemStorage'},
'staticfiles': {'BACKEND': 'django.contrib.staticfiles.storage.StaticFilesStorage'}}
[]
[]
'django.test.runner.DiscoverRunner'
','
'P'
['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']
'UTC'
True
False
True
False
False
'backend.wsgi.application'
'DENY'
'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.