please help me todebug this code

76 views
Skip to first unread message

DUSHYANT SINGH

unread,
Aug 28, 2021, 10:42:37 PM8/28/21
to Django users

Environment:


Request Method: GET

Django Version: 3.0
Python Version: 3.8.6
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'course',
 'fees']
Installed Middleware:
['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']


Template error:
In template C:\Users\DUSHYANT THAKUR\PycharmProjects\django\gs15\course\templates\course\index.html, error at line 2
   '"' is not a registered tag library. Must be one of:
admin_list
admin_modify
admin_urls
cache
i18n
l10n
log
static
tz
   1 : <!DOCTYPE html>
   2 :  {% load static "%} 
   3 : <html lang="en">
   4 :   <head>
   5 :     <meta charset="UTF-8" />
   6 :     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   7 :     <link rel="stylesheet" href="{% static 'css/style.css' %}" />
   8 :     <title>{{title}}</title>
   9 :   </head>
   10 : 
   11 :   <body>
   12 :     <h2>Start Learning {{cname}}</h2>


Traceback (most recent call last):
  File "C:\Users\DUSHYANT THAKUR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\template\defaulttags.py", line 1021, in find_library
    return parser.libraries[name]

During handling of the above exception ('"'), another exception occurred:
  File "C:\Users\DUSHYANT THAKUR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\Users\DUSHYANT THAKUR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\handlers\base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "C:\Users\DUSHYANT THAKUR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\handlers\base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\Users\DUSHYANT THAKUR\PycharmProjects\django\gs15\course\views.py", line 5, in learn_django
    return render(request,'course/index.html')
  File "C:\Users\DUSHYANT THAKUR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\shortcuts.py", line 19, in render
    content = loader.render_to_string(template_name, context, request, using=using)
  File "C:\Users\DUSHYANT THAKUR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\template\loader.py", line 61, in render_to_string
    template = get_template(template_name, using=using)
  File "C:\Users\DUSHYANT THAKUR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\template\loader.py", line 15, in get_template
    return engine.get_template(template_name)
  File "C:\Users\DUSHYANT THAKUR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\template\backends\django.py", line 34, in get_template
    return Template(self.engine.get_template(template_name), self)
  File "C:\Users\DUSHYANT THAKUR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\template\engine.py", line 143, in get_template
    template, origin = self.find_template(template_name)
  File "C:\Users\DUSHYANT THAKUR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\template\engine.py", line 125, in find_template
    template = loader.get_template(name, skip=skip)
  File "C:\Users\DUSHYANT THAKUR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\template\loaders\base.py", line 29, in get_template
    return Template(
  File "C:\Users\DUSHYANT THAKUR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\template\base.py", line 156, in __init__
    self.nodelist = self.compile_nodelist()
  File "C:\Users\DUSHYANT THAKUR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\template\base.py", line 194, in compile_nodelist
    return parser.parse()
  File "C:\Users\DUSHYANT THAKUR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\template\base.py", line 477, in parse
    raise self.error(token, e)
  File "C:\Users\DUSHYANT THAKUR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\template\base.py", line 475, in parse
    compiled_result = compile_func(self, token)
  File "C:\Users\DUSHYANT THAKUR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\template\defaulttags.py", line 1078, in load
    lib = find_library(parser, name)
  File "C:\Users\DUSHYANT THAKUR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\template\defaulttags.py", line 1023, in find_library
    raise TemplateSyntaxError(

Exception Type: TemplateSyntaxError at /cor/learndj/
Exception Value: '"' is not a registered tag library. Must be one of:
admin_list
admin_modify
admin_urls
cache
i18n
l10n
log
static
tz

MR INDIA

unread,
Aug 30, 2021, 11:00:03 AM8/30/21
to Django users
send the template

Peter van der Does

unread,
Aug 30, 2021, 12:10:13 PM8/30/21
to django...@googlegroups.com

You got a " on line 2 that shouldn't be there

On 8/28/21 1:15 PM, DUSHYANT SINGH wrote:
In template C:\Users\DUSHYANT THAKUR\PycharmProjects\django\gs15\course\templates\course\index.html, error at line 2
   '"' is not a registered tag library. Must be one of:

   1 : <!DOCTYPE html>
   2 :  {% load static "%} 
--
Peter van der Does
o: 
410-584-2500
ONeil Interactive, Inc 

Munzir Abba Daneji

unread,
Aug 30, 2021, 12:58:40 PM8/30/21
to django...@googlegroups.com
Peter Check your Template DIR you supposed to organize you folders flow under your "first_project" folder create the template folder and inser you html 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4c7aa0fa-8e0e-01c1-e5f0-491a3c3d9c96%40oneilinteractive.com.

Peter van der Does

unread,
Aug 30, 2021, 8:46:20 PM8/30/21
to django...@googlegroups.com

Uh what question are you answering?

Munzir Abba Daneji

unread,
Aug 31, 2021, 6:59:06 AM8/31/21
to django...@googlegroups.com
Hi peter The tag library you use is not correct use 
<! DOCTYPE html>
{% load static %}

again you html directory seems to be not organise try project_folder > Template_folder> index.html for example 

Peter van der Does

unread,
Aug 31, 2021, 9:16:50 AM8/31/21
to django...@googlegroups.com

You seem to be confused about who asked the question because it was not me who asked the question.

Munzir Abba Daneji

unread,
Sep 1, 2021, 5:16:41 AM9/1/21
to django...@googlegroups.com
Alright Peter sorry i get it. Fine

Reply all
Reply to author
Forward
0 new messages