i'm creating an App, using async driver(motor) for mongodb. I have a telegram bot app and django framework app. I want my telegram and web apps use same database. When i try to create User via integrated CreateView class, by default django uses it's standart auth processing and adds user to its default databases(sqlite, postgre etc.) But i'd like to use mongodb and use it asyncronous(as i understood djongo is syncronous driver) the ways I see to solve this: 1) separate users' auth data(to standart database) and other data, that'll be fetched and overwritten frequently(to mongo). 2) use standart view(e.g. TemplateView, FormView) and my own form, write MyOwnUserClass with hashing and all necessary methods. Shortly I want to use instruments of Django with mongodb, how can I reach that?
Well don't know if this is needed here, a piece of my current code: forms.py:
class RegisterUserForm(UserCreationForm):
username = forms.CharField
email = forms.EmailField
password = forms.PasswordInput
password_confirm = forms.PasswordInput
telegram = forms.CharField(required=False)
views.py:
class Register(CreateView):
template_name = 'AIsite/register.html'
form_class = RegisterUserForm
success_url = reverse_lazy('login-user')