Home > Software design >  Django filter data while signup according to country
Django filter data while signup according to country

Time:01-03

I'm making a project using Django and PostgreSQL. the user have to signup and after that login.

Problem

While user is signing up I'm asking different questions like name, email etc one field is **Country(home country)**. once the data store in database. now if the user want to login I want the he/she can see all the data related to home country. e.g UK people can't see data from US or any other country and vise versa.

CodePudding user response:

I suppose you can filter the data according to user country for example:

user = request.user
data = *DataModle*.objects.filter(country=user.country)
  • Related