It is misspelled, the right is *csrf_token*

Em quinta-feira, 26 de novembro de 2020 às 14:57:37 UTC-3, 
[email protected] escreveu:

> hi friends,
>
> please help me to  resolve this issue..
>
>
> Environment:
>
>
> Request Method: GET
> Request URL: http://127.0.0.1:8000/login/
>
> Django Version: 3.1.3
> Python Version: 3.9.0
> Installed Applications:
> ['django.contrib.admin',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'log']
> 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:\django-projects\dp1\site1\log\templates\log\login.html, 
> error at line 23
>    Invalid block tag on line 23: 'csrf_tocken', expected 'endblock'. Did 
> you forget to register or load this tag?
>    13 :            <link rel="stylesheet" href="">
>    14 :        </head>
>    15 :        <body>
>    16 :         {% extends "log/base.html" %}
>    17 :         {% block content %}
>    18 :             <h1 class='text-center'>Login page</h1>
>    19 :             <div class="col-md-6 offset-md-3">
>    20 : 
>    21 : 
>    22 :                 <form method="POST">
>    23 :                      {% csrf_tocken %} 
>    24 :                     <div class="form-group">
>    25 :         
>    26 :                         <input type="text" class="form-control"  
>  placeholder="Enter Username" name="username">
>    27 :         
>    28 :                     </div>
>    29 :                     <div class="form-group">
>    30 :     
>    31 :                         <input type="password" 
> class="form-control" placeholder="Enter Password" name="password">
>    32 :                     </div>
>    33 :     
>
>
> Traceback (most recent call last):
>   File 
> "C:\django-projects\venv\lib\site-packages\django\template\base.py", line 
> 470, in parse
>     compile_func = self.tags[command]
>
> During handling of the above exception ('csrf_tocken'), another exception 
> occurred:
>   File 
> "C:\django-projects\venv\lib\site-packages\django\core\handlers\exception.py",
>  
> line 47, in inner
>     response = get_response(request)
>   File 
> "C:\django-projects\venv\lib\site-packages\django\core\handlers\base.py", 
> line 179, in _get_response
>     response = wrapped_callback(request, *callback_args, **callback_kwargs)
>   File "C:\django-projects\dp1\site1\log\views.py", line 20, in login_user
>     return render(request, 'log/login.html', {})
>   File "C:\django-projects\venv\lib\site-packages\django\shortcuts.py", 
> line 19, in render
>     content = loader.render_to_string(template_name, context, request, 
> using=using)
>   File 
> "C:\django-projects\venv\lib\site-packages\django\template\loader.py", line 
> 61, in render_to_string
>     template = get_template(template_name, using=using)
>   File 
> "C:\django-projects\venv\lib\site-packages\django\template\loader.py", line 
> 15, in get_template
>     return engine.get_template(template_name)
>   File 
> "C:\django-projects\venv\lib\site-packages\django\template\backends\django.py",
>  
> line 34, in get_template
>     return Template(self.engine.get_template(template_name), self)
>   File 
> "C:\django-projects\venv\lib\site-packages\django\template\engine.py", line 
> 143, in get_template
>     template, origin = self.find_template(template_name)
>   File 
> "C:\django-projects\venv\lib\site-packages\django\template\engine.py", line 
> 125, in find_template
>     template = loader.get_template(name, skip=skip)
>   File 
> "C:\django-projects\venv\lib\site-packages\django\template\loaders\base.py", 
> line 29, in get_template
>     return Template(
>   File 
> "C:\django-projects\venv\lib\site-packages\django\template\base.py", line 
> 155, in __init__
>     self.nodelist = self.compile_nodelist()
>   File 
> "C:\django-projects\venv\lib\site-packages\django\template\base.py", line 
> 193, in compile_nodelist
>     return parser.parse()
>   File 
> "C:\django-projects\venv\lib\site-packages\django\template\base.py", line 
> 478, in parse
>     raise self.error(token, e)
>   File 
> "C:\django-projects\venv\lib\site-packages\django\template\base.py", line 
> 476, in parse
>     compiled_result = compile_func(self, token)
>   File 
> "C:\django-projects\venv\lib\site-packages\django\template\loader_tags.py", 
> line 270, in do_extends
>     nodelist = parser.parse()
>   File 
> "C:\django-projects\venv\lib\site-packages\django\template\base.py", line 
> 478, in parse
>     raise self.error(token, e)
>   File 
> "C:\django-projects\venv\lib\site-packages\django\template\base.py", line 
> 476, in parse
>     compiled_result = compile_func(self, token)
>   File 
> "C:\django-projects\venv\lib\site-packages\django\template\loader_tags.py", 
> line 213, in do_block
>     nodelist = parser.parse(('endblock',))
>   File 
> "C:\django-projects\venv\lib\site-packages\django\template\base.py", line 
> 472, in parse
>     self.invalid_block_tag(token, command, parse_until)
>   File 
> "C:\django-projects\venv\lib\site-packages\django\template\base.py", line 
> 522, in invalid_block_tag
>     raise self.error(
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ff6f440c-35a8-42ec-ae00-3a3286426703n%40googlegroups.com.

Reply via email to