SyntaxError: positional argument follows keyword argument

320 views
Skip to first unread message

Kean

unread,
Aug 8, 2019, 11:59:41 AM8/8/19
to Django users
Hi, 

New to Django for the expression below, i get

def breg(request):
form = UserCreationForm()
return render(request=request, template_name="source/breg.html", {'forms':form})

 I get the following error

SyntaxError: positional argument follows keyword argument

 Please can anyone help?

Best,

K

Andreas Hasenkopf

unread,
Aug 8, 2019, 12:11:01 PM8/8/19
to django...@googlegroups.com, Kean
Hi,

using keyword arguments consistently might help, e.g.:

return render(
request=request,
template_name="source/breg.html",
context={'forms':form}
)

CU
--
Andreas Hasenkopf
Phone: +49 151 11728439
Homepage: https://www.hasenkopf.xyz
--
Andreas Hasenkopf
Phone: +49 151 11728439
Homepage: https://hasenkopf.xyz

Kasper Laudrup

unread,
Aug 8, 2019, 12:36:43 PM8/8/19
to django...@googlegroups.com
Hi Kean,
This is not really something special to Django. This is pretty basic
Python. Maybe something like this will help:

https://www.programiz.com/python-programming/function-argument

Kind regards,

Kasper Laudrup

DANIEL URBANO DE LA RUA

unread,
Aug 8, 2019, 12:46:30 PM8/8/19
to django...@googlegroups.com
Show the imports o  your file

--
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/df720f0c-84aa-7611-bdcd-65793a5bdfea%40stacktrace.dk.
Reply all
Reply to author
Forward
0 new messages