Help me

33 views
Skip to first unread message

Théodore KOSSI

unread,
May 21, 2021, 5:25:19 AM5/21/21
to django...@googlegroups.com

Hellooo guys, I need your help. I want to create a form in django and I don't know exactly what i can use to create it. 

--
theodoros17@python-developer

712189512

unread,
May 21, 2021, 5:27:34 AM5/21/21
to django...@googlegroups.com
It depends on what you want to do
Are creating the form from a model or a general usage form 

--
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/CAKiMjQENmpGCoMuE3zmuaFaYkD8t7v7Kc0OWz7G_BdQegVXSNw%40mail.gmail.com.
--
Gabrielstone😎

Théodore KOSSI

unread,
May 21, 2021, 5:29:55 AM5/21/21
to django...@googlegroups.com
general usage form. Tell me what the importance of model form?




--
theodoros17@python-developer

712189512

unread,
May 21, 2021, 5:33:48 AM5/21/21
to django...@googlegroups.com
Both forms are pretty easy to use
Model form makes it more simpler because it takes your model and creates a form out of your model for you whereas general form you have to do everything from scratch 

--
Gabrielstone😎

Théodore KOSSI

unread,
May 21, 2021, 5:44:37 AM5/21/21
to django...@googlegroups.com
okay I understand. So , I want to create A general form. What can I use?




--
theodoros17@python-developer

712189512

unread,
May 21, 2021, 6:32:51 AM5/21/21
to django...@googlegroups.com
From django import forms 
Class Feedback(forms.form):
     name = forms.CharField(widget=forms.TextInput)

Just like that and you import it into your views
If you want more information you can read the django documentation too 

--
Gabrielstone😎

sebasti...@gmail.com

unread,
May 21, 2021, 6:52:53 AM5/21/21
to Django users
Here are a tutorial for django with explanations how you can use forms in django

Théodore KOSSI

unread,
May 21, 2021, 7:15:12 AM5/21/21
to django...@googlegroups.com
thanks you very much



--
theodoros17@python-developer

Boris Pérez

unread,
May 21, 2021, 12:56:40 PM5/21/21
to django...@googlegroups.com
Another way, maybe more familiar to u is to create the form directly
on the template (html) ..something like
<form id="myform" method="post" action="your_view">
<input type="text" id="inp_1" name="name_1"></input>
</form>

And then in the view:
def your_view(request):
if request.method == "POST":
return HttpResponse("My name is", request.POST["name_1"]
else:
return HttpResponse("Error, method must be POST"]

And of course, add the path to your view in the urls.py file...
Greetings
>>>>>>>> <https://groups.google.com/d/msgid/django-users/CAKiMjQENmpGCoMuE3zmuaFaYkD8t7v7Kc0OWz7G_BdQegVXSNw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>>
>>>>>>> --
>>>>>>> Gabrielstone😎
>>>>>>>
>>>>>>> --
>>>>>>> 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/CAL-5MpUi4ZvrGfN20MrsFN4dTtD57Z0Ae5vWeCybBBZb-Afn6g%40mail.gmail.com
>>>>>>> <https://groups.google.com/d/msgid/django-users/CAL-5MpUi4ZvrGfN20MrsFN4dTtD57Z0Ae5vWeCybBBZb-Afn6g%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> theodoros17@python-developer
>>>>>>
>>>>>> --
>>>>>> 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/CAKiMjQFO3ssc-J4hgzc_7%2Bw_VjU88uwSBeVC-Bmupyh4mDxNKQ%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/django-users/CAKiMjQFO3ssc-J4hgzc_7%2Bw_VjU88uwSBeVC-Bmupyh4mDxNKQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> --
>>>>> Gabrielstone😎
>>>>>
>>>>> --
>>>>> 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/CAL-5MpXX_884cpG7de%2BHoMH1t1tuk1PJmT7%3DTEjhqZEVHD%2BEfA%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/django-users/CAL-5MpXX_884cpG7de%2BHoMH1t1tuk1PJmT7%3DTEjhqZEVHD%2BEfA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>
>>>>
>>>> --
>>>> theodoros17@python-developer
>>>>
>>>> --
>>>> 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/CAKiMjQFaU2RVAf-rV%3DCx3c6jFO9fn9koUX%3DUu20GhBygouAXcQ%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAKiMjQFaU2RVAf-rV%3DCx3c6jFO9fn9koUX%3DUu20GhBygouAXcQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> Gabrielstone😎
>>>
>> --
>> 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/0e093d46-bb7f-463b-b575-ddd791be2634n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/0e093d46-bb7f-463b-b575-ddd791be2634n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> --
> theodoros17@python-developer
>
> --
> 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/CAKiMjQGKOK8zfS06-yX9T06QG8KVJGUZv907uoBFoDN9VtqTeQ%40mail.gmail.com.
>
Reply all
Reply to author
Forward
0 new messages