Nasib
I want deleteconfirm in same page
Nasib
In templates
Nasib
Anyone can help
Лиза
Hi! 👋🏻 Do I need to use prefetch related for m2m field If I need only IDs without any extra data?
Yulian
Hi! 👋🏻 Do I need to use prefetch related for m2m field If I need only IDs without any extra data?
found this: https://stackoverflow.com/questions/18935186/django-prefetch-related-id-only
Kim
Can i create form for to models?
Kim
Yes
How can i do that?
Charly
How can i do that?
ModelFormsets
👑 Dharmzeey
Hello, please I am working on a project, all the users will be created by the admin, so the admin will be the one to generate username and password. I am using usercreationform of forms.py which I render on the html for the user registration. I want to use the uuid.uuid4 to generate unique passwords, What I want to accomplish is that the password field should be handled by views.py and should be ignored on the html page. I tried using the exclude fields on the forms.py but it didn't work and I have checked different solutions online but didn't get any solution Please I need a way out
Tush_de
Has anyone worked on permissions for more than 3 different users and have access to only the content they add?? I need help
Fivi
what do you want to do ?
Tush_de
what do you want to do ?
So let's say I have a user tender, when I create multiple tender users I am unable to restrict access to only what each independent user added
~:$
So let's say I have a user tender, when I create multiple tender users I am unable to restrict access to only what each independent user added
Django permissions do not work at object level. It is worked as model level. https://docs.djangoproject.com/en/4.1/topics/auth/default/ https://testdriven.io/blog/django-permissions/
👑 Dharmzeey
Well I am assuming that in your forms.py you are using the modelForm and using the meta class to exclude the password field. In your views.py when you save the form using the parameter commit=false then generate the password.... Using make_password function. Uuid is a unique ID.... Do not use it as password.
I am using usercreationform not modelform And the exclude didn't exclude the password from rendering on the template And that's what I want to achieve, not showing the password field on the html page, but I will the use the make_password in views.py
True
Is it possible to have OTP with JWT, and how?
Enock
am having issues with register form. Am using AUTH_USER_MODEL where I have extended my AbstractBaseUSer.. Now the problem is that it seem I cant have the user loaded
True
Both are different things.
JWT is a thing but not OTP, OTP is concept and I'm just wondering if there is way to impiliment it on JWT auth
Sergey
Hi guys how can i use some kind of list serilizer with different childrens?
~:$
JWT is a thing but not OTP, OTP is concept and I'm just wondering if there is way to impiliment it on JWT auth
OTP is a one time password which mostly use to validate the user cell number and email address.
Maxim
just open editor and write the code
Luis
Post your code on pastebin and show us the error
Anonymous
This is just a simple Todo list
Anonymous
No one will help you code this get your hand dirty and drop and error you encounter here
Charles
Hello friends. I have a class (generic.GenericAPIAView) That returns the list of uploaded document When I try paginate by it does not work.. How can I paginate my list... Please assist
True
OTP is a one time password which mostly use to validate the user cell number and email address.
I know and what you said is ture, but should we say if a website has impilimented jwt auth it must not/ can not have login using otp?!
PR
How can i set template to django admin panel?
Gud
Any tutorial available to use Django with kotlin?
vld
Hi all. Can you tell me how I can add cart payment functionality to the online store on Django? Has anyone done something like this?
Sravya
Bro how can i count the no of votes in my online voting system project
dazedPirate
cj
Which data bro
you're the one developing the "Voting System"... you should know the data you're collecting and you should know how to process that data ¯\_(ツ)_/¯ we don't read minds here —and we don't solve homework either—
👑 Dharmzeey
Some to assist me
Have you checked the drf docs There is a section that explains pagination
Tazhutin
I want to filter model User by group in dropbox in admin panel form, i mean in dropbox there are only user from group clients id = models.ForeignKey(User.objects.filter(groups__name="clients" ... ... ... I've tried that way but got an error django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet. i need only users from group clients, not all users How can i do it?
Hunter
Am getting Attribute Error, and I have define that module or function. Please someone help. AttributeError: module 'B_Test_App.views' has no attribute 'newPage' 'B_Test_App.views.py' File : def newPage(request): temp = loader.get_template('new_1.html') return HttpResponse(temp.render()) 'B_Test_App.urls.py' File : from . import views urlpatterns = [ path('', views.index), # path('newPage/', views.newPage), path('newPage/', views.newPage, name='newPage'), ]
Mihir
Anyone have working multiple select checkbox with searching facilities, i tried select2 and few, which are not working
Adam
Can you please tell me how I can change the field of a linked model by sending a patch request from the serializer? The code that does not work right now. I'm trying to change username and the response comes back: { { "username": [ "The object with username=Ara123 does not exist." ] } http://linkode.org/#ZuJqfsNwGnIx3TSroaNqp1
Adam
U use email like username.
Yes, but that's irrelevant to the question)
šяıяαм〘CID〙
PS D:\Project> python -m pip install Pillow Requirement already satisfied: Pillow in c:\users\my pc\appdata\local\programs\python\python310\lib\site-packages (9.2.0) PS D:\Project> python .\manage.py makemigrations manager SystemCheckError: System check identified some issues: ERRORS: manager.participants.image: (fields.E210) Cannot use ImageField because Pillow is not installed. HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow". manager.participants.symbol: (fields.E210) Cannot use ImageField because Pillow is not installed. HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow". bro i am unable to use pillows any solution
User
Tried bro
Do you have any domain policies (like applocker)? I've been struggling with that for a long time
JavaScript
While learning django I have not used virtual environment....is it ok?? Is this even required??
Adorilson
While learning django I have not used virtual environment....is it ok?? Is this even required??
It is no required. But important. I too recommend that u use It.
JavaScript
It is no required. But important. I too recommend that u use It.
Thanks.....but What is the benefit of virtual env, I can work without it also....but I have seen everyone doing it
Adorilson
Thanks.....but What is the benefit of virtual env, I can work without it also....but I have seen everyone doing it
Isolated the project dependencies from SO dependencies. Isolated each project you work in own environment Imagine that project A uses a library in version 3 and project B uses the same library in version 4.
Adorilson
🙁.
To use virtual environment is a good practice. Do it.
Charly
Or don't do it, if you work alone you can have any bad practices and no one will care.
Arina
I'm using the templater and I'm passing the markup as text. How can I make the browser understand the markup, even if it's text? thanks
cj
Thanks.....but What is the benefit of virtual env, I can work without it also....but I have seen everyone doing it
if you're at that point of doubt, then consider using a virtual environment as a mandatory requirement
xdd
Hi everyone, how i can decode jwt token to receive user_id?
Finjp
And then you can ur data from the request body. But before authentication, if you try to print username from request you room get AnonymousUser Soo ...
Finjp
You will get*
xdd
Authenticate the token
Look here mate i have this code ( token = request.headers['Authorization'].split(' ')[1]), and with it i can receive token, that i put in headers, how i can decode it to receive user id.
xdd
I tried to use this(user_json = json.loads(base64.b64decode(token.split(".")[1])) user_id = user_json['id']), but i get this error(binascii.Error: Incorrect padding )
Abhie
How can I use lbph face recognition in my project
Charly
How can I use lbph face recognition in my project
probably trough a library like opencv
Jay
TypeError: User() got unexpected keyword arguments: 'is_staff', 'is_active'
Jay
while creating a superuser
Jay
class User(AbstractBaseUser, PermissionsMixin): TYPE = ( ("social", "social"), ("custom", "custom"), ) username = None email = models.EmailField(unique=True, blank=True) mobile = models.IntegerField() address = models.TextField() profile_pic = models.ImageField(null=True, blank=True, default="profiel.jpg") signup_type = models.CharField(max_length=200, null=True, choices=TYPE, blank=True, default="social") created_at = models.DateTimeField(auto_now_add=True, null=True) updated_at = models.DateTimeField(auto_now_add=True, null=True) created_by = models.CharField(max_length=250, null=True, blank=True) updated_by = models.CharField(max_length=250, null=True, blank=True) objects = UserManager() USERNAME_FIELD = "email" REQUIRED_FIELDS = []
Jay
https://dpaste.org/G2F1t