cannot assign to literal

22 views
Skip to first unread message

Rodrigo Alves

unread,
May 7, 2021, 1:34:51 PM5/7/21
to django...@googlegroups.com
Boa tarde amigos!

alguém pode me ajudar?

esta aparecendo este erro!

cannot assign to literal

o meu codigo é este:

def form(request):
    data = {}
    data = ['form'] = CarrosForm()
    return render(request'form.html'data)

Lipede Tope

unread,
May 7, 2021, 7:22:09 PM5/7/21
to django...@googlegroups.com
Try data['form'] =Carossform()

--
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/CAKkbzD0AUqvGSFRgBuSmkNMqgRtW1EGoBKM2x3P61uJrZX7OdQ%40mail.gmail.com.

Ennio Santos

unread,
May 9, 2021, 4:04:27 AM5/9/21
to Django users
Or just this:
data = {
    'form': = CarrosForm()
}

to the return render, you need to add the html template name.
Reply all
Reply to author
Forward
0 new messages