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

2019-03-30 Thread Gourav Sardana
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.")


On Sat, 30 Mar 2019, 2:18 am Saeed Pooladzadeh,  wrote:

>
> 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, 
>> wrote:
>>
>>> Hello,
>>>
>>> I'm a beginner at Django and Python and now plan to make a simple bot
>>> site for Instagram with instabot:
>>>
>>>
>>> https://github.com/instabot-py/instabot.py
>>>
>>> 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.
>>> 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
>>> <https://groups.google.com/d/msgid/django-users/eac56b27-f17a-4fc9-8476-41f61feae520%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/cdd5ea94-8990-45b7-b011-a1bc68982630%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/cdd5ea94-8990-45b7-b011-a1bc68982630%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CACdXjQLu72ixidLYZny18xqyQGH9dxFCw3GuEjLkrqQ8_N-VrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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

2019-03-29 Thread 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, 
wrote:

> Hello,
>
> I'm a beginner at Django and Python and now plan to make a simple bot site
> for Instagram with instabot:
>
>
> https://github.com/instabot-py/instabot.py
>
> 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-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CACdXjQJRB%2Bazcr4-LzBzDz%3DhKSX7fktEtMOYii2mdXJhzqYNkw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Translation doesn't work?

2019-03-26 Thread Gourav Sardana
Use the correct spelling in your html
Its {%trans%}
Please use this. Hope so this will fine working !
Have a good day!

On Tue, 26 Mar 2019, 11:29 am ANi,  wrote:

> Does anyone have clue about it?
> I'll appreciate your help!
>
> ANi於 2019年3月22日星期五 UTC+8上午11時12分07秒寫道:
>>
>> Hello.
>> The only word that has been translated is "name", but it seems that it is
>> the default one in Django.
>> So basically my translation does not work at all..
>> please help
>>
>> Here is what I've done so far...
>>
>> settings.py
>> MIDDLEWARE = [
>>  ...
>>  'django.contrib.sessions.middleware.SessionMiddleware',
>>  'django.middleware.locale.LocaleMiddleware',
>>  ...
>> ]
>>
>>
>> LANGUAGE = [
>>  ('en-us', 'English'),
>>  ('zh-Hant','繁體中文'),
>> ]
>>
>>
>> LANGUAGE_CODE = 'zh-Hant'
>>
>>
>> USE_I18N = True
>>
>> USE_L10N = True
>>
>> ...
>>
>>
>> LANGUAGE_PATHS = os.path.join(BASE_DIR, "locale")
>>
>>
>> part of django.po
>>
>> #: .\main\models\center.py:43 .\main\models\company.py:18
>> #: .\main\models\company.py:33 .\main\models\log.py:70
>> #: .\main\models\select.py:17 .\main\models\select.py:33
>> #: .\main\models\item.py:95 .\templates\main\main.html:11
>> msgid "name"
>> msgstr "名稱"
>>
>>
>> #: .\main\models\item.py:98 .\templates\main\main.html:13
>> msgid "value"
>> msgstr "價值"
>>
>>
>> #: .\main\models\item.py:102 .\main\models\log.py:98
>> msgid "currency"
>> msgstr "幣別"
>>
>>
>>
>> part of main.html
>> {% load static %}
>> {% load filters %}
>> {% load i18n %}
>> {% block container %}
>>  
>>  
>>  
>>  {% trans 'name' %}
>>  {% tans 'value' %}
>>  ...
>>
>>
>> part of item.py
>> from django.utils.translation import gettext_lazy as _
>> ...
>>
>> class Asset(models.Model):
>>  name = models.CharField(_('name'), max_length=255)
>>  value = models.IntegerField(_('value'))
>>  currency = models.ForeignKey(Currency,
>>   null=True,
>>   on_delete=models.SET_NULL,
>>verbose_name=_('currency'))
>>  ...
>>
>> filte structure
>> myproject
>>  - main_app
>>  - common-statics
>>  - templates
>>  - myproject
>>  - locale
>>  - zh-hant
>>-LC_MESSAGES
>>  - django.mo
>>  - django.po
>>
>>
>> thanks!
>>
>>
>> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/91f4655c-a0d0-4069-8411-155f06d9d01b%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CACdXjQKaHxiK1sUGRkPVo%3DcEK%2Brs-mhvY8BfS-7AS5Fc6ckRYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Test FrameWork Cleanup

2019-03-22 Thread Gourav Sardana
Hey,

I am Gourav Sardana undergraduate computer science student.I am interested 
in the idea of test framework cleanup. @Mentors Can i ask you one thing?  
we have to build a software for improving code or we have to add this in 
our django core code?

Regards,
Gourav Sardana

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/1ba6880e-dbb4-45af-a13a-548ad7d5320b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.