Django user creation with costume boostrap form - django

I know how to create and extend a usercreation form using the Django modelsform.
But how can I create and authenticate a user without using the inbuilt Django form instead i will use a bootstrap form having my own tailored designs and additional fields?

to solve this issue i had to use django-widget-tweaks to modify my interfaces. it is really a good Django package

Related

How to use Django's inbuilt authentication with custom forms (html templates)

I am trying to create a website using Django where user can register and login currently I am storing the user registration data in my custom database table.
But I am not finding any sold way to do user authentication using the data from my custom tables
So I am in search of a way where I can use Django's inbuilt user auth but with my custom forms( html templates) on top
Please Help me !!
I suggest that you use django-allauth package. What you want has been implemented already.
You can follow the documentation below https://django-allauth.readthedocs.io/en/latest/index.html

Build react form based on serializer of Django Rest Framework

I want to build web app where users can add different ads for sale(cars,apartments, gadgets etc...) and each of this categories models in django are specific and need specific fields in form for creating ad. Creating this forms using django is easy by using ModelForms.
DRF documentation says that
A serializer class is very similar to a Django Form class, and includes similar validation flags on the various fields..... . So I guess I will create form on base of serializers.
My question is: How make a single React component which will render form on base of different serializers that frontend gets from Django-Rest-Framework?
Please any advice or links where I can read about this . If you need I can share some code . Thank you in advance.
Quite a late response, but here's some workaround.
You could check this npm package that convert JSON into React Form: https://www.npmjs.com/package/react-jsonschema-form
You could generate the JSON description from your Django model, by looping among attribute.
It's not straightforward but it worked fine for me.

Django registration that works well with django-authtools

I have a Django app that uses django-authtools which provides a custom auth model so that I can use email as user id.
I am wondering if there is a reusable app that I can reuse for doing registrations. Something like django-registration-redux but that works well with the just using email as user id. Or can django-registration-redux be used in this scenario?
I figured that what I was trying to achieve is achieved by using django-allauth instead. This link shows the way how to achieve it:
I think I can achieve what I am trying to do how it is specified in Remove 'username' field from django-allauth. So I guess

Django: how to use the nice admin tables in the actual application

New to Django, just worked through the 'polls' tutorial. Now I would like to convert those simple views into tabular views, just as in the pretty admin interface. Should I try to clone code from the admin module? Otherwise, how to proceed?
The admin forms are just Django forms and formsets. To build a form for your model you use modelforms. Maybe nice to look at the admin tabular_inline template. It lives at: django/contrib/admin/templates/admin/edit_inline/tabular.html.
The snippet is looping over the form fields.

form from multiple models

I need to create a form where the rows are a list of users and the columns are all the user's permissions. The models are the default django User's and django Permission's models.
How can I do this things? Are there a way to do by django forms or I must do manually with django and js?
If you just want to view this data, extract the relevant information (User and Permission instances), and then generate a table using django templates. Django intentionally does not 'bless' any css or js frameworks, so you are required to do the html yourself (using tools of your choosing).
Forms aren't going to help you here I don't think. I advise you to draw up what it is you want to see, and start figuring out what the html is going to need to look like. Forms in django are simply a mechanism for passing data between django and the user. You are free to render them how you wish.