May be you can try the below in-built django feature for the registration form
creation:
from django.contrib.auth.forms import UserCreationFormdef
register_user(request):
if request.method == 'POST':
form = UserCreationForm(request.POST)
if form.is_valid():
You didn't close the form tag that why you getting this error
On Aug 27, 2019 21:41, "K. KOFFI" wrote:
> please put « > » before the csrf tag
>
>
> Le 27 août 2019 à 16:30 +0100, Kean , a écrit :
>
> Hi Ajeet, thanks for code,
> however after i press submit i get the
>
> Forbidden (403)
> CSRF
please put « > » before the csrf tag
Le 27 août 2019 à 16:30 +0100, Kean , a écrit :
> Hi Ajeet, thanks for code,
> however after i press submit i get the
>
> Forbidden (403)
> CSRF verification failed. Request aborted.
> Help
> Reason given for failure:
>CSRF token missing or incorrect.
>
>
Only see the 'error_new' variable in my view
this variable has taken two values: "ok" or "error1" (true or false, error
or not error,..etc)
def NuevoPac(request):
# Manda al formulario todos los campos vacios
variable1 = 'Agregando nueva Ficha de Paciente'
variable2 = "modifica_rut"
error_new =
Thank you, this resolved issue.
best,
K
On 27 Aug 2019, at 17:30, Ajeet Kumar Gupt wrote:
> Hi Kean,
>
> First need to close the proper tags
>
> I seen your code form tag is not closed properly. Once first form tag closed
> than write the code csrf token
>
> On Tue, 27 Aug, 2019, 7:30 PM
Hi Kean,
First need to close the proper tags
I seen your code form tag is not closed properly. Once first form tag
closed than write the code csrf token
On Tue, 27 Aug, 2019, 7:30 PM Kean, wrote:
> Hi Ajeet, thanks for code,
> however after i press submit i get the
>
> Forbidden (403)
> CSRF
Hi Ajeet, thanks for code,
however after i press submit i get the
Forbidden (403)
CSRF verification failed. Request aborted.
Help
Reason given for failure:
CSRF token missing or incorrect.
In general, this can occur when there is a genuine Cross Site Request Forgery,
or when Django's
Hi,
Please use the below code.
views.py
__
def user_register(request):
# if this is a POST request we need to process the form data
template = 'mymodule/register.html'
# template = 'index.html'
if request.method == 'POST':
# create a form instance and
Wher is the form action? If you don't provide the form action then how can
it recognize which views should be called?
Set the action here:
Like this.
On Sat, Aug 24, 2019 at 10:34 PM Kean wrote:
> Hi,
>
> New to Django.
> I've created a user registration form, the issue is it does not run
>
Hi,
New to Django.
I've created a user registration form, the issue is it does not run
validations or report errors with the data entered. It simply routes to the
redirect url.
Please can I ensure the user sees the correct error in a post case scenari
for both a django form, and customsied
10 matches
Mail list logo