how to find out if instagram accept the username and password of the bot?

80 views
Skip to first unread message

Saeed Pooladzadeh

unread,
Mar 29, 2019, 3:13:30 PM3/29/19
to Django users
Hello,

I'm a beginner at Django and Python and now plan to make a simple bot site for Instagram with instabot:



My problem is how can I find out if Instagram accept the username and password of the user or the username and password is wrong. How can I warn the user?

thanks,
Saeed

Gourav Sardana

unread,
Mar 29, 2019, 3:18:26 PM3/29/19
to django...@googlegroups.com
You have to make a form.py and define your form there. 
In the views you have to make a validation for the username and the password.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/eac56b27-f17a-4fc9-8476-41f61feae520%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Saeed Pooladzadeh

unread,
Mar 29, 2019, 4:47:41 PM3/29/19
to Django users

I know what you mean but if the user inserts a wrong user and password what happens?
در جمعه 29 مارس 2019، ساعت 23:48:26 (UTC+4:30)، Gourav Sardana نوشته:
You have to make a form.py and define your form there. 
In the views you have to make a validation for the username and the password.

On Sat, 30 Mar 2019, 12:44 am Saeed Pooladzadeh, <ling...@gmail.com> wrote:
Hello,

I'm a beginner at Django and Python and now plan to make a simple bot site for Instagram with instabot:



My problem is how can I find out if Instagram accept the username and password of the user or the username and password is wrong. How can I warn the user?

thanks,
Saeed

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.

Gourav Sardana

unread,
Mar 30, 2019, 3:11:17 AM3/30/19
to django...@googlegroups.com
If the user enter incorrect credentials then you will redirect it to another page or a pop up which shows wrong credentials.

def user_login(request):
if request.method == 'POST':
# First get the username and password supplied
username = request.POST.get('username')
password = request.POST.get('password')
# Django's built-in authentication function:
user = authenticate(username=username, password=password)
# If we have a user
if user:
#Check it the account is active
if user.is_active:
# Log the user in.
login(request, user)
if user.groups.filter(name='Doctor'):
return HttpResponse('Hey Doctor')
elif user.groups.filter(name='LabUser'):
return HttpResponseRedirect(reverse('patient_details'))
else:
return HttpResponse('Hey Customer')
else:
# If account is not active:
return HttpResponse("Your account is not active.")
else:
print("Someone tried to login and failed.")
print("They used username: {} and password: {}".format(username,password))
return HttpResponse("Invalid login details supplied.")


To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Saeed Pooladzadeh

unread,
Apr 1, 2019, 11:04:43 AM4/1/19
to Django users
Thanks for your help.maybei cant transfer because my  English is not good. See we have two authentications:

in our bot site and in the Instagram I don't mean authentication in our bot site
I mean in the Instagram app. If the user entered wrong Instagram credentials how we can authenticate this?

Regards,
Saeed

در جمعه 29 مارس 2019، ساعت 23:43:30 (UTC+4:30)، Saeed Pooladzadeh نوشته:
Reply all
Reply to author
Forward
0 new messages