Deepak
Can i change model name and field(relationship) of abstract user and manager name ??
奈姆
Can i change model name and field(relationship) of abstract user and manager name ??
You have to use the custom user model to override fields, and use custom manager. https://docs.djangoproject.com/en/5.1/topics/auth/customizing/#substituting-a-custom-user-model
Deepak
I want to change the name of custom user and remove their relation
Deepak
Can i do this ?
奈姆
I want to change the name of custom user and remove their relation
Change the table name? Remove what relation? Examples?
Deepak
Like any foreign key relation.
Deepak
Yes, i want to change the name of custom model(table).
Doragonsureiyā
Like any foreign key relation.
What are you talking about?
奈姆
Yes, i want to change the name of custom model(table).
You can set it via model's Meta class. https://docs.djangoproject.com/en/5.1/ref/models/options/#db-table
奈姆
Like any foreign key relation.
extends your custom user model from AbstractBaseUser. It has no related objects/models.
Hamia
I just wanna ask about good courses to learn Django and Django rest framework or I must focus on the documentation is it enough !
Alexander
Hey guys, please advice I have a DB table (in Frontend for costumer it looks similar to Excel table). Every year customer should start a new "list", and fill it in. So the question is about the better way of implementing. Simple idea is just store "year" field in each entry, and then filter data in templates. So maybe exists any way to do it better, any ideas? Thank you
Hamia
'cause am flutter dev and I wanna learn framework for making the back end to my app 😞 I think Django is the best cauz it s big app and big data what do u think guys ?
Олег ­ ­ ­
Hello. Tell me how to use the django-access library. (https://github.com/nnseva/django-access)
clouded
'cause am flutter dev and I wanna learn framework for making the back end to my app 😞 I think Django is the best cauz it s big app and big data what do u think guys ?
Please use @pythonofftopic for questions like whether to use Django or not (or any other framework). For Django specific issues, this group can be used.
clouded
i used this group because the question is related to django
Yeah, it may look like that, but we don't consider it related. The question might spark a discussion about topics that have nothing to do with Django.
clouded
In fact, it's quite likely that people will tell you their opinions about other frameworks, which is nothing that should be discussed here.
Олег ­ ­ ­
How can I differentiate access to different instances of the same object? This is not possible in Django, did I understand correctly?
Maxim
i used this group because the question is related to django
that message you responded to wasn't to you
ZeroCool
Hi everybody, have anyone implemented jwt in drf with a CustomUser? I get the token but when I use axios or fetch from my frontend I got an credentials error, it's weird because the token is valid
ZeroCool
djangorestframework_simplejwt 5.4.0
شهرزاد محمد
in drf how to prevent requests from tools like postman
奈姆
User-Agent request header gives you info about the client. But, that can be spoofed/fake. To protect api endpoints, you can implement auth and rate limiting.
奈姆
yes via the Authorization request header.
Luis Fernando
Hello guys, have you ever seen this error when installing Django and Oracle database on a Linux Server? django.db.utils.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory"
Luis Fernando
I already have installed the instaclient.
Doragonsureiyā
Hello guys, have you ever seen this error when installing Django and Oracle database on a Linux Server? django.db.utils.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory"
Adding the word Django to your Off-Topic question doesn't magically turn it to a Django related question, so delete your question here and move to the @PythonOfftopic group and ask there.
choyon
Is there any playlist where from I can learn django from beginner to advance?
Doragonsureiyā
Is there any playlist where from I can learn django from beginner to advance?
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Alessandro
In DRF, I have a User and Profile serializer to create new users in the sign up. I was thinking to pass all the data like {'username': 'fakeuser1', 'email': 'fake@fake.org', 'first_name': 'Fake', 'last_name': 'Last name', 'password': 'fakepass', 'password2': 'fakepass', 'profile': {'state': 859, 'postal_code': '3143424', ... < all the other profile fields > } My question is, what is the best way to handle Profile validation inside User serializer, in order to prevent creating a user instance without a profile instance.
The Inspired
Don't do validation in UserSerializer. you can do it inside a simple fuction-based view to check that, or if you know how to override viewsets, do it inside ProfileViewset
The Inspired
I usually dont touch user-related stuff... whatever operations you want to do on User, you can do it on Profile and make a one-to-one link between user and profile
Shubham
Any Good resource to learn django and rest framework and jwt.? And what other resources you can recommend?
Nandu
Hi, I need to add a chat feature to my project. Does anyone have any idea how to do it?
Yahya
in my django ecommerce project when i login i got some error as ( JSONDecodeError) is there anyone to help me to fix this
Doragonsureiyā
in my django ecommerce project when i login i got some error as ( JSONDecodeError) is there anyone to help me to fix this
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain: - what you're doing - what you're expecting - what you're using - where you're running the script - what Python version you're using - what packages and their versions you're using - and the most important thing: show the code YOU wrote (read rule 5️⃣ for that) and more details, that way your chances to get help will increase.
S
Hi, I need to add a chat feature to my project. Does anyone have any idea how to do it?
https://channels.readthedocs.io/en/stable/tutorial/part_3.html
Yahya
i am creating a ecommerce project using django and recently i have adedd a feature that will delete the user cart from data base when the order is placed, after that i logout, then when i login i got an error (JSONDecodeError)
Олег ­ ­ ­
How can I differentiate access to different instances of the same object? This is not possible in Django, did I understand correctly? There is user_1, user_2 and user_3. User_1 creates an instance of the Post object. User_2 should see this Post, and user_3 does not have access to this Post.
奈姆
“Permissions can be set not only per type of object, but also per specific object instance.” https://docs.djangoproject.com/en/5.1/topics/auth/default/#permissions-and-authorization
Олег ­ ­ ­
“Permissions can be set not only per type of object, but also per specific object instance.” https://docs.djangoproject.com/en/5.1/topics/auth/default/#permissions-and-authorization
How can I add viewing permission to an object instance for a specific group of users? The documentation says that this can be done and that seems to be it.
Abraham
add 'required' attribute
where ... i mean on the forms or on the models route
Yahya
when i changed my database from sqlite to postresql in railway.app i got some error django.db.utils.OperationalError: connection to server at "postgres-ob4r-production.up.railway.app" (35.213.168.149), port 5432 failed: Connection timed out (0x0000274C/10060) Is the server running on that host and accepting TCP/IP connections? could you help me to fix this
Yahya
Are you trying to connect to the database from your PC or inside railway?
my project is in my pc i want to make my database in cloud and tried to connect my project database to railway.app postgresql when i runserver i got this error django.db.utils.OperationalError: connection to server at "postgres-ob4r-production.up.railway.app" (35.213.168.149), port 5432 failed: Connection timed out (0x0000274C/10060) Is the server running on that host and accepting TCP/IP connections?
Charly
(you can but most cases is not recommended)
Yahya
could you suggest what should i do
Netsi Man
use python-dotenv and hide your secret key.
Doragonsureiyā
could you suggest what should i do
Rule 5️⃣: Never post walls of text or screen photos. Use paste bins like https://dpaste.org, https://hastebin.com, https://bin.kv2.dev or your favorite one!
Charly
could you suggest what should i do
To run a local database if you want to work locally
Yahya
To run a local database if you want to work locally
i didn't get could you explain it will be helpful
Yahya
What part you need explanation?
how to run a local database in postegresql /railway.app
Charly
how to run a local database in postegresql /railway.app
install postgress, and Iḿ talking about locally not in railway
Charly
locally means your PC
Yahya
locally means your PC
ooh is there any way to run my project db in railway.app
Charly
ooh is there any way to run my project db in railway.app
in railway yes but you can't connect from your PC to that database
Yahya
in railway yes but you can't connect from your PC to that database
i am currently doing a project from youtube for study purpose codemy.com/django wednesday ecommerce playlist /43rd video in this video he is adding his local project db in cloud railway.app/postgesql
Yahya
when i tried the same i got the error django.db.utils.OperationalError: connection to server at "postgres-ob4r-production.up.railway.app" (35.213.168.149), port 5432 failed: Connection timed out (0x0000274C/10060) Is the server running on that host and accepting TCP/IP connections?
Yahya
if i push the project to github and host the project in railway.app am i able to use the railway.app/postgresql DB
M...
Hello everyone! I am new in Django So can you suggest me that which plateform and website is good for learn Django
Prinkal
Hello everyone! I am new in Django So can you suggest me that which plateform and website is good for learn Django
you could watch wscubetech channel video series on YouTube and read django documentation. you just need to learn how django MVT frame works rest improve with practice.
Swamy
Hey I am using abstract base use model when I registered the user through portman password hasing but when try to django Admin panel password is not hasing it is showing plan text
Swamy
your message is not clear
I am creating the basic user in admin panel password is not encrypted (abstractuser)