This may not seem simple, but it is.
1) You need a model with all the fields (docs),
2) Register that model to be visible on admin page (docs),
3) Create a forms.py file inside your app folder and form class inside that file (docs),
4) Create a simple template, it needs to have specific name or that name must be specified in a view from point 4 (same docs page as in 3),
5) Handle the form in views.py by adding a class-based FormView (docs),
6) Add the specific url to urls.py.
For more info about template creation visit: https://simpleisbetterthancomplex.com/article/2017/08/19/how-to-render-django-form-manually.html
W dniu niedziela, 23 września 2018 17:52:00 UTC+2 użytkownik Ansari Sabir napisał:
-- 1) You need a model with all the fields (docs),
2) Register that model to be visible on admin page (docs),
3) Create a forms.py file inside your app folder and form class inside that file (docs),
4) Create a simple template, it needs to have specific name or that name must be specified in a view from point 4 (same docs page as in 3),
5) Handle the form in views.py by adding a class-based FormView (docs),
6) Add the specific url to urls.py.
For more info about template creation visit: https://simpleisbetterthancomplex.com/article/2017/08/19/how-to-render-django-form-manually.html
W dniu niedziela, 23 września 2018 17:52:00 UTC+2 użytkownik Ansari Sabir napisał:
How to create a form that collect information (like first name, last name, email address, contact number, gender) and admin can see that information in the /admin/ in django.
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/94746cc2-2e64-4182-a659-be73848c4e66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment