Alikhanov Jakhongir
....
Guys , Loginform (created with LoginView) Always shows error like this :- please enter correct username and password , note that both field maybe case-sensitive but , i give it correct valid data .. there is no error ... Then why it shows this error. . Also i am override the user model . How can i fix this. .?
Firdavs
if not User.objects.filter(username=ip): create_user_ip = User.objects.create_user(username=str(ip), email=ip + '@mail.ru', password=ip,) username = str(create_user_ip.username) password = str(create_user_ip.password) user = authenticate(request, username = username, password = password) if user is not None:# user to'g'rimi login(request, user) plese help me login doesnt work but create_user is working
HamidReza Fekri
Hello I want pass model to all templates ?
Axror
You should use template inheritance
Alex
Hello I want pass model to all templates ?
You can defiine it in a context_processor and then add it to your TEMPLATES https://docs.djangoproject.com/en/3.2/ref/templates/api/#writing-your-own-context-processors
John
Is it's possible to use 3 party auth service in django means firebase authentication or supabase authentication. I build django app for my mobile application backend and where I use supabase as a database and it's work fine but the issues is that django doesn't use supabase authentication model rather then it's create own database table for storing the user it's is fine if you control every thing from django side But the problem will occur when we want to some specific actions that supabase give only it's user like CURD
Nur
Hello, guys! I'm beginner in django and I want to learn django by book which use django 3.0. There are significant and big difference between versions 3.0 and 3.2.6?
Doragonsureiyā
looks like you need an offtopic group, please continue this conversation at @pythonofftopic
Tonnie
MY MODELS
Jerome
MY MODELS
Are you on django 3.2 or a previous one?
Jerome
MY MODELS
Because since 3.2 DEFAULT_AUTO_FIELD is directly generated. Look at this release note https://docs.djangoproject.com/en/3.2/releases/3.2/
Vasilii
how to create sample data for database
Alex
What is the command to upgrade django in Ubuntu
Depends on your installation way. For pip pip install --upgrade django
Alex
how to create sample data for database
For example - by data migrations https://docs.djangoproject.com/en/3.2/topics/migrations/#data-migrations
Vasilii
is this way ok? https://mattsegal.dev/django-factoryboy-dummy-data.html
Alex
is this way ok? https://mattsegal.dev/django-factoryboy-dummy-data.html
Are you going to call such command periodically?
Не выходи из комнаты.
There is table A (located in the default database) and table B (located in the` logs` database). Table B has a_id field, which contains the ID for the corresponding record from table A, which is mapped to another database. Are there any native Django ways to join the list of records from table B to the corresponding records from table A?
Alex
Or just once?
Vasilii
I want integrate it in tests.py
Vasilii
and run with —keepdb
Saurav
Hi, need some help.
Saurav
I want to use a query set multiple times without hitting the DB again and again.
Saurav
Any approach/pseudo code for this
Saurav
Yes But I'm stuck with the implementation of that.
игорь/igor
Yes But I'm stuck with the implementation of that.
Cache would be proper to use for not frequently changed items. I haven't done this in a long time but approach explained on this page https://stackoverflow.com/questions/4631865/caching-query-results-in-django should work, although prior settings should be made. Reference in django documentation
Vasilii
https://mattsegal.dev/django-factoryboy-dummy-data.html, any ideas how to override database name in setup_test_data.py(I want to use test database not main), and what about speed?
laurel
Can anyone tell me how to change password for custom user model?
Gordrick
Can anyone tell me how to change password for custom user model?
Is your custom user model inheriting from AbstractUser or AbstractBaseUser?
Gordrick
You could use set_password and pass in the raw password you want to set https://docs.djangoproject.com/en/3.2/ref/contrib/auth/#django.contrib.auth.models.User.set_password
Anonymous
hello friends i trying to build a Appointment so in it i want to set token number to 0 on every new day so how can i do it any hint or solution please
Ousmane
Good evening I want to put my application django on the Windows server help me
Soma
What are the risks u faced in ur project?
Soma
Pls anyone give one example of django project
Anonymous
Create periodic task
any link for refrence or code
Anshu
any link for refrence or code
U can use celery for periodic task, follow pyplane on YouTube
Anonymous
ok friend
Tanu
how to add random user in django api
Tanu
plzz help me
Maxim
how to add random user in django api
no one can help to do something if they do not understand what exactly make us understand what you want to do
Tanu
ok
Maxim
how to add random user in django api
what does random user mean?
Roshan
Best search implimentation module in django?
哭呀
Hi everyone, now I'm reading "Django 3 By Example". And I face a problem. I have defined a form in form.py under my application, and in view.py I would like to use that form. But I don't know what parameters can be used to the form in view.py. However, the book mentioned something like that : form = MyForm(instance = request.user, data = request.Post) And I cannot find the "instance" and "data" parameters in the Django Documents
Anonymous
Can you tell me that how I can use permission in custom user model?
To set permission on a user, user.user_permissions.add(your_permission).
laurel
To set permission on a user, user.user_permissions.add(your_permission).
Can you give some documentation where i can read about this?
Anonymous
Search permissions in the Django docs
laurel
Actually i created a custom user model using abstract base
Anonymous
So that this is not working for it
Every user model has user_permissions attribute
laurel
Actually i want that when any user signup the is active field will automatically get True
laurel
@fishworm If I want to create an user model by inheriting abstractBaseUser and want that all permission and in my admin panel what i will have to do?
XTM
Hi everyone! Maybe someone can give me some advice here. I have a big postgres DB associated to my django app. I just would like to do complex search's and filtering to get results and do things with them from the admin panel. I'm using django-advanced-filters but it has some bugs and it's not very fancy to show at my client. Any ideas what could I implement? Thank you
Anonymous
@fishworm If I want to create an user model by inheriting abstractBaseUser and want that all permission and in my admin panel what i will have to do?
I don't get you. Basic permissions for creating, deleting, updating etc for your model is provided when you migrate
laurel
Actually when i created customer user model there is no to add permission to a perticular user
laurel
@fishworm no field to add*
Anonymous
@fishworm no field to add*
If you want your user to access your models, you can build forms
Сергей
how can I change default behavior of form input name in formset_factory like this name="company_bank-0-account_number" I wana see name="company_bank-account_number[]" array input
moad
I want to stream video from webcam of user to my django server and save it in DataBase How i will do it ???
Harish
How to prevent two different users from logging into same portal simultaneously? For example, Let's say two Users U1 & U2. In same window, First Tab: When I first login as U1 in portal P, that user specific data is coming which is expected. Second Tab: I logged in as U2 into same portal P, that user specific data is coming which is expected. Now, if I go to 1st tab & reload, U2 specific data is showing which is not what wanted.. So, how to fix this ? Like atleast it should log out the user U1. P.S : I'm using ExpiringToken Authentication ( custom ) in DRF.
Almaz
Hello, everyone! I have a question. I'm looking for django tutorial where explains how to build reset password by email. I watched some videos from YouTube, but in every video I've watched, it is necessary to allow less secure in user's Gmail and i don't think in real websites people will allow less secure to their Gmail. Who can give me any recommendations about that?
Almaz
In this tutorial I have to manually write only one exact Gmail address. But i wanna do reset like in real websites on the internet, i mean, in real websites people don't write their Gmail addresses to backend code, they just write their Gmail to form and after that they get message to their Gmail. Is there something like that?
Owolabi
Is there a way I can integrate Google map to Django admin for tracking drivers location and movement on a chauffeur project?
Viji
Hi.. im new to django. Plz help me guys.. How can i store the form data into django sqlite db while using foreign key.. I have been struggling since 48 hrs.. anyone plz help me??😢
Оппозиция
how to add file to requst.files from view?
Eric
Hi.. im new to django. Plz help me guys.. How can i store the form data into django sqlite db while using foreign key.. I have been struggling since 48 hrs.. anyone plz help me??😢
Share your code via https://paste.ubuntu.com/ or https://gist.github.com/ and maybe someone will be able to help you. Submitting forms with Django is pretty clearly explained here: https://docs.djangoproject.com/en/3.2/topics/forms/ (And to "save" you would have the logic for saving the submitted data to a DB table in your View)