Someone
Yes ... thanks .. and both apps have authentication .. one app have only one hardcoded credentials for my app to access its resources .. and i have login for users.. if am importing views and configuring url's, can I pass credentials from views?
Someone
We both are using token auth
Someone
I have few more queries 😔
inchidi
coz thats means you guys need to share same User which is mean share same db right?
Someone
ew thats bad, then you will do more than domain setup i guess. i think your boss made a bad decision
What is efficient set up here? It would be better if react interacts with both apps endpoints... lot of work can be reduced ..
Someone
coz thats means you guys need to share same User which is mean share same db right?
No... we are in a trouble like, we both now should give access to same set of users .. if react is interacting with both apps endpoint then authentication is a problem .. like my app will separate token and another app totally different token for same user .. so we thought of having one hard coded credential for one app and to access its resource from other ..
Someone
I tried to read a lot on net.. i dint get anything that would help..
Someone
I have another prob also... for my application I am using django-rest-auth.. bcz it seems to be nice one.. we have like 1000 users .. for first login am creating a default login with employee id number..so that on their first login they should reset their password.. but django-rest-auth needs email to reset password.. on our user base many people does not got email.. so prob in resetting password also.. is there any way to resolve this? If not any other app to achieve my requirement?
inchidi
What is efficient set up here? It would be better if react interacts with both apps endpoints... lot of work can be reduced ..
on frontend side if using axios for example, your friend can store 2 axios cofig to 2 const and do request using that 2 object. its so simple and efficient
Someone
🤔🧐.. if am importing his views and configuring URL's... then my authentication only will be enough right.. bcz its just isauthenticated class, my auth will also work right??...
Someone
why they doenst receive the email? i think nothing wrong in yout reset password flow part
No.. few people like drivers, factory workers dont have official email id which we have in db.. so prob in sending them mail for resetting password..
inchidi
We are using JWT only
then the problem only your authentication model which is by default User model
inchidi
No.. few people like drivers, factory workers dont have official email id which we have in db.. so prob in sending them mail for resetting password..
wait, i think you are using wrong method here. user should "change password" not "reset password" tho
inchidi
🤔🧐.. if am importing his views and configuring URL's... then my authentication only will be enough right.. bcz its just isauthenticated class, my auth will also work right??...
you want to merge only views, not models. means you will have 2 User model right? if both app have same models then no problem here
inchidi
Yes sorry change password
change password doesnt need app to send new email right? user just type old password, and new password then password changed?
Someone
change password doesnt need app to send new email right? user just type old password, and new password then password changed?
I will check that. Bcz when i checked it had email field as mandatory .. i might have mistaken .. will check once again..
inchidi
We got different models.. but User model is same as we share same set of users...
then you 3 option now: » merge the api » passing the api response » force to use 2 url on frontend side the rest is up to your team
Someone
then you 3 option now: » merge the api » passing the api response » force to use 2 url on frontend side the rest is up to your team
I will work with first option... i understood 1st and 3rd option.. what is 2nd (passing the api response) .. am just curious to know..
Someone
this one, but its really bad choice
Yes... anyway i will go with 1st one ... thanks a lot for clearing the doubts . 😊
inchidi
you're welcome
Anonymous
Are any of you in NYC? I'm looking to have a chat with someone with a strong Django background
Sayan
I was wondering how should I store user preferences in django, I've made a new accounts app to handle Userprofile, but lets say i also want to add user preferences like `'dark_mode' = true, 'notif_method' = 'email_only' `etc. Should add these as fields directly in the Userprofile model or make another class for perferences?
Sayan
I'm new to django, so just wanted to know, if what i'm doing is right
inchidi
at gender, charfield require max_length btw
Sayan
I'm confused as in when to subclass the User model and when to use AbstractUser to extend
inchidi
I'm confused as in when to subclass the User model and when to use AbstractUser to extend
dont extend User model coz you will have 2 "User" table, make onetoone like you did.
Sayan
Oh okay thanks
inchidi
I'm confused as in when to subclass the User model and when to use AbstractUser to extend
if you already know how is your User model gonna be since creating project, then extending AbstractUser better
Sayan
I'll then merge preferences, and now i have to learn forms(or is there any other way to do it,because few people say they dont like django forms)
Sayan
if you already know how is your User model gonna be since creating project, then extending AbstractUser better
Oh i see,so basically if i want to add some important info like mob.no address etc, then its better to extend it right?
inchidi
but in middle of work, replacing User with custom User pretty hard
but you will know how to do that after you know django better. its part of django learning curve
Sayan
Ok i get it now
Sayan
And by anychance do you know whay sqlsquencereset does?
Sayan
I tried to reset my pk's it didn't work :/
inchidi
sorry i never use that
Sayan
Okay
Sayan
Thanks
Sarath
Hey guys. I have a doubt.
Sarath
How to do validations in drf
Sarath
is serializer have ?
Sarath
I am new in python .. and django..pls help
Omer
Does anyone have a good tutorial about deploying a django rest api?
Django Bot
>> Links - pdb: Using the Python debugger in Django - Minutiæ by Mike Tigas
inchidi
Django Bot
>> Links - Building a combined stream of recent additions using the Django ORM
inchidi
its same with deploying other django web app
https://docs.djangoproject.com/en/2.0/howto/deployment/
inchidi
is serializer have ?
serializer do validation per serializer field type or per model field if its ModelSerializer
Sarath
Could you give me the syntax using model serializer
Sarath
I am using class based view
inchidi
here https://github.com/DimasInchidi/djangoid_kulgram1/blob/master/portofool_io/serializers.py
Sarath
How to call validator from a class based view...
inchidi
How to call validator from a class based view...
it depends on the case but here is the doc http://www.django-rest-framework.org/api-guide/validators/
Django Bot
>> Links - PauLoX – Full-Text Search in Django with PostgreSQL
Django Bot
>> Links - Flask vs Django
Anonymous
Do you know how create business models? Maybe give me links.
Anonymous
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
Anonymous
https://pastebin.com/mCzsdWEY
Anonymous
my codes need some help with this
Anonymous
/stat@combot
Combot
combot.org/chat/-1001146340312
inchidi
my codes need some help with this
what are you trying to do?
Anonymous
what are you trying to do?
inserting data into sqlite with faker
Anonymous
but when i'm executing the code