Re: Django attempting to connect to mysql without password even when password has been provided

2018-05-27 Thread Coder Dude
I tried that. Still Doesn't work. I am using django 2.0. 
I found a stackoverflow thread which suggests that it might be a bug with 
pymysql along with mysql8.

It works properly when i create a user without password and provide it's 
credentials.

https://stackoverflow.com/questions/50336458/pymysql-access-denied-using-password-no-but-using-password


On Monday, May 28, 2018 at 12:33:11 AM UTC+5:30, Daniel Germano Travieso 
wrote:
>
> Hello! What version of Django are you running?
>
> You may need to provide extra info such as host and port 
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql',
> 'NAME': 'mydatabase',
> 'USER': 'mydatabaseuser',
> 'PASSWORD': 'mypassword',
> 'HOST': '127.0.0.1',
> 'PORT': '5432',
> }}
>
> Hope it helps
>
>
>
> *[]'s*
> *Daniel Germano Travieso*
> *Engenharia da Computação Turma: 013*
> *Unicamp*
>
> On Sun, May 27, 2018 at 8:24 AM, Coder Dude  > wrote:
>
>> This is the code in my settings.py :
>>
>> import pymysql
>>
>> pymysql.install_as_MySQLdb()
>>
>>
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.mysql',
>> 'NAME': 'learn001',
>> 'USER': 'test01',
>> 'PASSWORD': 'test01', #Password is also test01
>>
>>
>> }
>> }
>>
>>
>> Yet , it is throwing the following error :
>>
>> django.db.utils.OperationalError: (1045, "Access denied for user 
>> 'test01'@'localhost' (using password: NO)".
>>
>> I don't understand why it is trying to connect without a password. 
>>
>> It works properly if I create a user with no password and then provide 
>> it's username.
>>
>>
>>
>>
>> -- 
>> 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/bc025b3b-58b6-450a-8d37-3fca71568e72%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
On Monday, May 28, 2018 at 12:33:11 AM UTC+5:30, Daniel Germano Travieso 
wrote:
>
> Hello! What version of Django are you running?
>
> You may need to provide extra info such as host and port 
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql',
> 'NAME': 'mydatabase',
> 'USER': 'mydatabaseuser',
> 'PASSWORD': 'mypassword',
> 'HOST': '127.0.0.1',
> 'PORT': '5432',
> }}
>
> Hope it helps
>
>
>
> *[]'s*
> *Daniel Germano Travieso*
> *Engenharia da Computação Turma: 013*
> *Unicamp*
>
> On Sun, May 27, 2018 at 8:24 AM, Coder Dude  > wrote:
>
>> This is the code in my settings.py :
>>
>> import pymysql
>>
>> pymysql.install_as_MySQLdb()
>>
>>
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.mysql',
>> 'NAME': 'learn001',
>> 'USER': 'test01',
>> 'PASSWORD': 'test01', #Password is also test01
>>
>>
>> }
>> }
>>
>>
>> Yet , it is throwing the following error :
>>
>> django.db.utils.OperationalError: (1045, "Access denied for user 
>> 'test01'@'localhost' (using password: NO)".
>>
>> I don't understand why it is trying to connect without a password. 
>>
>> It works properly if I create a user with no password and then provide 
>> it's username.
>>
>>
>>
>>
>> -- 
>> 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/bc025b3b-58b6-450a-8d37-3fca71568e72%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
On Monday, May 28, 2018 at 12:33:11 AM UTC+5:30, Daniel Germano Travieso 
wrote:
>
> Hello! What version of Django are you running?
>
> You may need to provide extra info such as host and port 
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql',
> 'NAME': 'mydatabase',
> 'USER': 'mydatabaseuser',
> 'PASSWORD': 'mypassword',
> 'HOST': '127.0.0.1',
> 'PORT': '5432',
> }}
>
> Hope it helps
>
>
>
> *[]'s*
> *Daniel Germano 

Re: Authenticate with mobile number(duplicate mobile number)

2018-05-27 Thread lakshitha kumara
Hello Jason,

Thank you fro your suggestion. but thing is im getting mobile number like 
this .



user can enter the email or mobile number. if user enter mobile number with 
country code that fine if not then i get user country code via ip and 
validate mobile number. then i save two first one is user enter mobile 
number. so it can with country code or without. the problem is if country 
code not there can be duplicate number i can save number with country code 
if user not enter the country code because next login user will not enter 
the country code so then that user cant login. 

look like i only option is saving mobile number with country code and once 
user enter the mobile number without country code then search db LIKE and 
if match with password login to the system.

Thanks

On Sunday, May 27, 2018 at 5:32:25 PM UTC+5:30, lakshitha kumara wrote:
>
> Hello guys
>
> I have some issue in user Authenticate System for example there are tow 
> country called X and Y this two country phone code is +9 and +10 (this is 
> only for example) . this two country have two people name called R and M. R 
> person mobile is +9123456789 and M person mobile number is +10123456789.
>
> There are site called P and this two user come to register on that site 
> and enter the mobile number. both people enter the mobile number without 
> country code but this site get user country code via ip address.
>
> But problem is if we save mobile number as what user enter mobile number 
> field will be duplicate. and if save with country code user don't know 
> about it and next time once he came and enter the same mobile number he 
> entered before system will say invalid mobile number.
>
> i would like to know best way bypass this method . most of websites have 
> this issue.
>
> 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/e94d3d85-8798-4aaf-817f-4a0a043e11c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need help

2018-05-27 Thread Umar Kambala
Thank u will try it
On May 27, 2018 7:01 PM, "Dheeraj Singh"  wrote:

> I will encourage you to use pyCharm for same it will give you kick start
>
> On Sun, May 27, 2018 at 7:14 PM, Umar Kambala 
> wrote:
>
>> I wans to start a new project on de django web development but wen I type
>> >django-admin startproject mysite I get this error
>> CouldNotFoundError:No module name 'django.template' plz help me out
>>
>> --
>> 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/ms
>> gid/django-users/CAPkbFbbGger-TTpvRKvKcvhLzarHvjoLB0u7KWZfHU
>> wt%3DwbHPw%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
>
> *Warm Regards*
>
> *Dheeraj Singh | Software Engineer | Girnar Technologies |*207 | Adarsh
> Nagar | Near S Bhag Singh Chowk | Jaipur| 302004 | India |
> +91 141 422 4400 office | +91 9887678100 mobile
>
> www.girnarSoft.com  A venture of girnarSoft
>
> Proud owners of www.CarDekho.com , India's #1
> auto portal!
>
>
> *Confidentiality Notice & Legal Disclaimer:* This E-Mail Message
> (including attachments) may contain Confidential and/or legally privileged
> Information and is meant for the intended recipient(s) only. If you have
> received this e-mail in error and are not the intended recipient/s, kindly
> notify the sender and then delete this e-mail immediately from your system.
> You are also hereby notified that any use, any form of reproduction,
> dissemination, copying, disclosure, modification, distribution and/or
> publication of this e-mail, its contents or its attachment/s other than by
> its intended recipient/s is strictly prohibited and may be unlawful.
>
> Internet Communications cannot be guaranteed to be secure or error-free as
> information could be delayed, intercepted, corrupted, lost, or contain
> viruses. Girnar does not accept any liability for any errors, omissions,
> viruses or computer problems experienced by any recipient as a result of
> this E-mail.
>
> --
> 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/CAOaDkT7Tnk3YfQunEGdzfqX0ALt%3DzZ2LwsjjupUqAc6BUNM4Ow%
> 40mail.gmail.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/CAPkbFbaAuag8OQrFnoZ4Xj-k6gWfoDkUXcfA37AUd9yQyEZR7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to update Django 2 JSON FIeld?

2018-05-27 Thread Mark Phillips
I have a model called Document with a field called metadata defined as
JSONField(blank=True). I want to be able to search the Document model for a
certain key in the metadata field, and change that key.

For example, there is a key 'People' in some of the Document objects, and I
want to change that key to "Person". I tried these queries -

>>> fred=Document.objects.filter(metadata__has_key='People')
>>> fred
, , , , , ]>
>>> sam = fred[0].metadata
>>> sam
{'Date': '05/07/1994', 'Title': 'title 2', 'Location': 'Tempe',
'Orientation': 'Landscape', 'Photo Type': 'Individual', 'URL': '
http://sam.com', 'People': ['Tina Phillips Roderique'], 'Decade': '1990',
'a boolean': False}
>>> sam['Person'] = sam.pop('People')
>>> sam
{'Date': '05/07/1994', 'Title': 'title 2', 'Location': 'Tempe',
'Orientation': 'Landscape', 'Photo Type': 'Individual', 'Person': ['Tina
Phillips Roderique'], 'URL': 'http://sam.com', 'Decade': '1990', 'a
boolean': False}
>>> fred[0].metadata = sam
>>> fred[0].metadata
{'Date': '05/07/1994', 'Title': 'title 2', 'Location': 'Tempe',
'Orientation': 'Landscape', 'Photo Type': 'Individual', 'URL': '
http://sam.com', 'People': ['Tina Phillips Roderique'], 'Decade': '1990',
'a boolean': False}
>>>

I was able to change the key in the dictionary 'sam', but when I tried to
replace the metadata dictionary in fred[0], it did not update. I must be
missing something in how to update a field in a django model.

Thanks for any suggestions you may have!

Mark

-- 
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/CAEqej2OF%3D8fWmpQAXNJV10gcNtG7xMDiFVEpArrwMjRp4fVuSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django attempting to connect to mysql without password even when password has been provided

2018-05-27 Thread Daniel Germano Travieso
Hello! What version of Django are you running?

You may need to provide extra info such as host and port

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mydatabase',
'USER': 'mydatabaseuser',
'PASSWORD': 'mypassword',
'HOST': '127.0.0.1',
'PORT': '5432',
}}

Hope it helps



*[]'s*
*Daniel Germano Travieso*
*Engenharia da Computação Turma: 013*
*Unicamp*

On Sun, May 27, 2018 at 8:24 AM, Coder Dude  wrote:

> This is the code in my settings.py :
>
> import pymysql
>
> pymysql.install_as_MySQLdb()
>
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql',
> 'NAME': 'learn001',
> 'USER': 'test01',
> 'PASSWORD': 'test01', #Password is also test01
>
>
> }
> }
>
>
> Yet , it is throwing the following error :
>
> django.db.utils.OperationalError: (1045, "Access denied for user 
> 'test01'@'localhost'
> (using password: NO)".
>
> I don't understand why it is trying to connect without a password.
>
> It works properly if I create a user with no password and then provide
> it's username.
>
>
>
>
> --
> 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/bc025b3b-58b6-450a-8d37-3fca71568e72%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/CABF8kZPSeDL3fy5p29cdrSD2dNe%3D0q8Q1P6ATbHXNtJzg1imxw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need help

2018-05-27 Thread Dheeraj Singh
I will encourage you to use pyCharm for same it will give you kick start

On Sun, May 27, 2018 at 7:14 PM, Umar Kambala  wrote:

> I wans to start a new project on de django web development but wen I type
> >django-admin startproject mysite I get this error
> CouldNotFoundError:No module name 'django.template' plz help me out
>
> --
> 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/CAPkbFbbGger-TTpvRKvKcvhLzarHvjoLB0u7KWZfHU
> wt%3DwbHPw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

*Warm Regards*

*Dheeraj Singh | Software Engineer | Girnar Technologies |*207 | Adarsh
Nagar | Near S Bhag Singh Chowk | Jaipur| 302004 | India |
+91 141 422 4400 office | +91 9887678100 mobile

www.girnarSoft.com  A venture of girnarSoft

Proud owners of www.CarDekho.com , India's #1
auto portal!


*Confidentiality Notice & Legal Disclaimer:* This E-Mail Message (including
attachments) may contain Confidential and/or legally privileged Information
and is meant for the intended recipient(s) only. If you have received this
e-mail in error and are not the intended recipient/s, kindly notify the
sender and then delete this e-mail immediately from your system. You are
also hereby notified that any use, any form of reproduction, dissemination,
copying, disclosure, modification, distribution and/or publication of this
e-mail, its contents or its attachment/s other than by its intended
recipient/s is strictly prohibited and may be unlawful.

Internet Communications cannot be guaranteed to be secure or error-free as
information could be delayed, intercepted, corrupted, lost, or contain
viruses. Girnar does not accept any liability for any errors, omissions,
viruses or computer problems experienced by any recipient as a result of
this E-mail.

-- 
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/CAOaDkT7Tnk3YfQunEGdzfqX0ALt%3DzZ2LwsjjupUqAc6BUNM4Ow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: help me out

2018-05-27 Thread Aristeidis Almpanis
Good day,

Please be more careful when asking a question and provide more details. For
example include in your email all the python traceback info.

>From the error you described: "NameError: name 'template' is not defined"
it seems that you are referring to a "template" variable in your code that
is never set to a value (it is not defined).

You can also tell us more about which tutorial you are trying to do so we
can refer to the code - or include your code to the email.

AA

On Sun, May 27, 2018 at 10:33 AM, Umar Kambala 
wrote:

> Good day
> Plz I have a problem, on mysite I have the following
> mysite/personal/templates/personal but wen I runserver it gives me
> "NameError: name 'template' is not define.. Please can u help me locate the
> problem? Thank u
> On May 24, 2018 4:56 PM, "Melvyn Sopacua"  wrote:
>
>> On donderdag 24 mei 2018 17:28:53 CEST Umar Kambala wrote:
>> > It is located in mysite/polls/template/polls/
>>
>> It should be in mysite/polls/templates/polls/
>>
>> Note: templates with an s, not template.
>>
>> --
>> Melvyn Sopacua
>>
>> --
>> 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/ms
>> gid/django-users/61115682.T1ecY6nzIZ%40fritzbook.
>> 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/CAPkbFbYPHKRZ8QXtfLnXV%3D29AcTpeOOxucqGSfd5VAMa3fmfvA
> %40mail.gmail.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/CAD5ymB5FjqZ95gwn6Gv1%3DiKg4AaqF1bSAxM7Wh2Sd7Y9eqJj6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need help

2018-05-27 Thread Zahid Hossain
Install django latest version

On Sun, May 27, 2018 at 7:44 PM, Umar Kambala  wrote:

> I wans to start a new project on de django web development but wen I type
> >django-admin startproject mysite I get this error
> CouldNotFoundError:No module name 'django.template' plz help me out
>
> --
> 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/CAPkbFbbGger-TTpvRKvKcvhLzarHvjoLB0u7KWZfHU
> wt%3DwbHPw%40mail.gmail.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/CAMLBuuErig8X1zTBD_fN_cLkbXvdV%3Dff%3Dmo%3DHWz3ANMAGcFdPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Authenticate with mobile number(duplicate mobile number)

2018-05-27 Thread Jason
from my perspective: you can do two things.  First and easiest, is to have 
the user include the country code when registering.  So if they get a 
duplicate phone number, that's not your fault.  Second, and more 
complicated, is to use a pre-save db signal to execute the user country 
lookup by IP and transform the phone number before the db insert happens.

-- 
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/893cf3eb-fc86-4e8f-a7a1-9348b2ced817%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Need help

2018-05-27 Thread Umar Kambala
I wans to start a new project on de django web development but wen I type
>django-admin startproject mysite I get this error
CouldNotFoundError:No module name 'django.template' plz help me out

-- 
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/CAPkbFbbGger-TTpvRKvKcvhLzarHvjoLB0u7KWZfHUwt%3DwbHPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Authenticate with mobile number(duplicate mobile number)

2018-05-27 Thread lakshitha kumara
Hello guys

I have some issue in user Authenticate System for example there are tow 
country called X and Y this two country phone code is +9 and +10 (this is 
only for example) . this two country have two people name called R and M. R 
person mobile is +9123456789 and M person mobile number is +10123456789.

There are site called P and this two user come to register on that site and 
enter the mobile number. both people enter the mobile number without 
country code but this site get user country code via ip address.

But problem is if we save mobile number as what user enter mobile number 
field will be duplicate. and if save with country code user don't know 
about it and next time once he came and enter the same mobile number he 
entered before system will say invalid mobile number.

i would like to know best way bypass this method . most of websites have 
this issue.

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/5c0d3b5b-e055-4106-9517-943d3d5594c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django attempting to connect to mysql without password even when password has been provided

2018-05-27 Thread Coder Dude
This is the code in my settings.py :

import pymysql

pymysql.install_as_MySQLdb()


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'learn001',
'USER': 'test01',
'PASSWORD': 'test01', #Password is also test01


}
}


Yet , it is throwing the following error :

django.db.utils.OperationalError: (1045, "Access denied for user 
'test01'@'localhost' (using password: NO)".

I don't understand why it is trying to connect without a password. 

It works properly if I create a user with no password and then provide it's 
username.




-- 
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/bc025b3b-58b6-450a-8d37-3fca71568e72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django channels with python background tasks

2018-05-27 Thread Roger Gammans
Jaiswal,
Either my solution 1 or 2 will solve your problem, or rewriting your
scripts as management commands (which is probably the easiest route).
If you want to keep them separate :-
For solution 1; I would look at using the requests library (see https:/
/pypi.org/project/requests/ ) in your backend scripts and adding
django-rest-framework to your django project ( http://www.django-rest-f
ramework.org  ) to handle to API views. 
For solution 2:  it is more roll your own; but googling 'zmq' and
'redis'  would be a start to get you thinking about how these things
can hang together. This is probably the most advanced solution though.
I'm sorry this is not a lot more help, it is all up to understanding
what your comfortable with *exactly*  what you want to achieve from
here.

On Sun, 2018-05-27 at 02:22 -0700, Sourabh Jaiswal wrote:
> Hi Roger,
> Thanks for your reply.
> 
> Yes you are correct. There are actually 2 modules of this project:-
> 1. Django front end which is totally isolated in itself if I talk
> about it with back-end reference. And currently it has no mechanism
> whatsoever to communicate with back-end.
> 2. python based back-end scripts. which itself is a program. It can
> be started with some management IPs of Network elements and that
> program will keep getting the data from those NE synchronously.
>     This back-end can not communicate with any external program yet.
> And uses a global variable file for starting the threads.
> 
> Now to link these 2 modules I understand I need to to introduce APIs
> in module 2. and call those APIs from django.
> Which is exactly what you are suggesting in your suggestion 1.
> Correct me if I am wrong.
> 
> Just a little bit more help. Can you please guide me to some tutorial
> to get this thing started.
> 
> Thanks in advance.
> 
> Regards,
> Jaiswal
> 
> On Sunday, May 27, 2018 at 2:34:05 PM UTC+5:30, Roger Gammans wrote:
> > I think there is a little bit of confusion in this thread,a s we
> > keep talk about django and the deamon process and ignoring the
> > frontend.
> > So to clarify; there we are talking about a system with at least 3
> > execution environments:
> > 1 The Browser2 Django backend processes3 The backend daemon/cli
> > -process.
> > django-channel provides a mechanism which (amongst other uses) can
> > get near-realtime updates from a django environment to the web
> > browser, but if you don't need this you can just store all your
> > status data in the data base . Then when the browser fetches a
> > views it will have the most recent data in the database.
> > You still however need to communicate between the backend process
> > and the rest of the django environment, the simplest way as Ryan
> > suggesting is tobring this inside the django environment by
> > implementing it as a management command, from there you have access
> > to the python end of the channels api to send messages to the
> > browsers, or the model objects to save to the database. Management
> > commands can be arbitrarily complex, so that not a problem in
> > itself.
> > I have a similar system in development and there we do run the
> > backend daemon outside of the dajngo environment, but that makes
> > database access hard as you need a separate copy of the database
> > models, or to use raw SQL. In our system we still have a django
> > management command though which has the responsibility of
> > pumping/handling messages from the deamon to the intended
> > destination.
> > If you want to keep your backend separate l I can see two
> > reasonable paths:   1. Use a custom set of django views to
> > provide a API your backend connects to over localhost/http to send
> > the it message updates. 2. A django management command as a
> > API interface message handler, which connects to the backend over
> > one of many message channels out there. (ie. zmq, redis, unix-
> > sockets, etc)
> > Hope this helps a little bit.
> > On Sun, 2018-05-27 at 01:01 -0700, Sourabh Jaiswal wrote:
> > > HI Ryan,
> > > The back-end script in this case is not only doing telnet. Its
> > > getting data from multiple network elements using telnet and
> > > multi-threading. There are multiple threads started when I start
> > > the backend script which takes monitoring data from diff-diff
> > > network elements at the same time. The communication between the
> > > threads is happening using a python Sockets. A TCP server is
> > > responsible to pass the messages between threads. So I have to
> > > have this background program run to collect data.
> > > 
> > > The control from django I want is, to be able to start multiple
> > > instance of this whole back-end package when user clicks on such
> > > cluster in django front end. Passing management IP and other
> > > relevant information from django DB. and after starting
> > > particular instance django should be able to control it.
> > > 
> > > What I found out from recent googling and stuff is. I need to
> > > write some APIs in back-end 

Re: Django channels with python background tasks

2018-05-27 Thread Umar Kambala
Please when I runserver I gets this error, NameError:name 'template' is not
defined. My templates are in this dir mysite/personal/templates/personal.
What's my problem?
On May 27, 2018 9:04 AM, "Roger Gammans" 
wrote:

> I think there is a little bit of confusion in this thread,a s we keep talk
> about django and the deamon process and ignoring the frontend.
>
> So to clarify; there we are talking about a system with at least 3
> execution environments:
>
> 1 The Browser
> 2 Django backend processes
> 3 The backend daemon/cli -process.
>
> django-channel provides a mechanism which (amongst other uses) can get
> near-realtime updates from a django environment to the web browser, but if
> you don't need this you can just store all your status data in the data
> base . Then when the browser fetches a views it will have the most recent
> data in the database.
>
> You still however need to communicate between the backend process and the
> rest of the django environment, the simplest way as Ryan suggesting is to
> bring this inside the django environment by implementing it as a
> management command, from there you have access to the python end of the
> channels api to send messages to the browsers, or the model objects to save
> to the database. Management commands can be arbitrarily complex, so that
> not a problem in itself.
>
> I have a similar system in development and there we do run the backend
> daemon outside of the dajngo environment, but that makes database access
> hard as you need a separate copy of the database models, or to use raw SQL.
> In our system we still have a django management command though which has
> the responsibility of pumping/handling messages from the deamon to the
> intended destination.
>
> If you want to keep your backend separate l I can see two reasonable paths:
> 1. Use a custom set of django views to provide a API your backend connects
> to over localhost/http to send the it message updates.
> 2. A django management command as a API interface message handler, which
> connects to the backend over one of many message channels out there. (ie.
> zmq, redis, unix-sockets, etc)
>
> Hope this helps a little bit.
>
> On Sun, 2018-05-27 at 01:01 -0700, Sourabh Jaiswal wrote:
>
> HI Ryan,
>
> The back-end script in this case is not only doing telnet. Its getting
> data from multiple network elements using telnet and multi-threading. There
> are multiple threads started when I start the backend script which takes
> monitoring data from diff-diff network elements at the same time. The
> communication between the threads is happening using a python Sockets. A
> TCP server is responsible to pass the messages between threads. So I have
> to have this background program run to collect data.
>
> The control from django I want is, to be able to start multiple instance
> of this whole back-end package when user clicks on such cluster in django
> front end. Passing management IP and other relevant information from django
> DB. and after starting particular instance django should be able to control
> it.
>
> What I found out from recent googling and stuff is. I need to write some
> APIs in back-end program and as Andrew suggested it needs to be written in
> such a way that it can be polled via django.
> So where to start in this regard? can you please guide me for that.
>
> Thanks in advance!
>
> Regards,
> Jaiswal.
>
> On Saturday, May 26, 2018 at 8:15:28 PM UTC+5:30, Ryan Nowakowski wrote:
>
> Another idea: create a Django management command that does the telnet
> stuff and just run that periodically via Cron. You can always move to
> channels or celery later.
>
> On May 26, 2018 9:33:16 AM CDT, Ryan Nowakowski 
> wrote:
>
> In addition to websockets, channels can be used to run background tasks
> that could take a long time for example a telnet connection. You can Google
> Django channels background tasks.
>
> An alternative to channels for background tasks is celery.
>
> On May 26, 2018 5:03:51 AM CDT, Andrew Godwin  wrote:
>
> Hi Jaiswal,
>
> I'm afraid that I can't give detailed help about what your best options
> are or walk you through how to do it - that's something you'll have to
> research and decide on yourself. Channels allows you to do low-latency
> communictation between Django back-ends and JavaScript, but anything you
> can do with it can also be done slower using a polling API connection.
>
> My recommendation would be to start simple - doing it using an API that
> you poll every few seconds - and then once you have that figured out, look
> at how you could improve it using WebSockets and channels.
>
> Andrew
>
> On Sat, May 26, 2018 at 8:38 AM Sourabh Jaiswal 
> wrote:
>
> Hi,
>
>
> I am writing a python based application(CLI Back End) which does telnet to
> some network components and gets some data. It saves the data in sqlite db.
>
>
> For this application I am writing Django based 

Re: help me out

2018-05-27 Thread Umar Kambala
Good day
Plz I have a problem, on mysite I have the following
mysite/personal/templates/personal but wen I runserver it gives me
"NameError: name 'template' is not define.. Please can u help me locate the
problem? Thank u
On May 24, 2018 4:56 PM, "Melvyn Sopacua"  wrote:

> On donderdag 24 mei 2018 17:28:53 CEST Umar Kambala wrote:
> > It is located in mysite/polls/template/polls/
>
> It should be in mysite/polls/templates/polls/
>
> Note: templates with an s, not template.
>
> --
> Melvyn Sopacua
>
> --
> 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/61115682.T1ecY6nzIZ%40fritzbook.
> 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/CAPkbFbYPHKRZ8QXtfLnXV%3D29AcTpeOOxucqGSfd5VAMa3fmfvA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django channels with python background tasks

2018-05-27 Thread Sourabh Jaiswal
Hi Roger,

Thanks for your reply.

Yes you are correct. There are actually 2 modules of this project:-
1. Django front end which is totally isolated in itself if I talk about it 
with back-end reference. And currently it has no mechanism whatsoever to 
communicate with back-end.
2. python based back-end scripts. which itself is a program. It can be 
started with some management IPs of Network elements and that program will 
keep getting the data from those NE synchronously.
This back-end can not communicate with any external program yet. And 
uses a global variable file for starting the threads.

Now to link these 2 modules I understand I need to to introduce APIs in 
module 2. and call those APIs from django.
Which is exactly what you are suggesting in your suggestion 1. Correct me 
if I am wrong.

Just a little bit more help. Can you please guide me to some tutorial to 
get this thing started.

Thanks in advance.

Regards,
Jaiswal

On Sunday, May 27, 2018 at 2:34:05 PM UTC+5:30, Roger Gammans wrote:
>
> I think there is a little bit of confusion in this thread,a s we keep talk 
> about django and the deamon process and ignoring the frontend.
>
> So to clarify; there we are talking about a system with at least 3 
> execution environments:
>
> 1 The Browser
> 2 Django backend processes
> 3 The backend daemon/cli -process.
>
> django-channel provides a mechanism which (amongst other uses) can get 
> near-realtime updates from a django environment to the web browser, but if 
> you don't need this you can just store all your status data in the data 
> base . Then when the browser fetches a views it will have the most recent 
> data in the database.
>
> You still however need to communicate between the backend process and the 
> rest of the django environment, the simplest way as Ryan suggesting is to
> bring this inside the django environment by implementing it as a 
> management command, from there you have access to the python end of the 
> channels api to send messages to the browsers, or the model objects to save 
> to the database. Management commands can be arbitrarily complex, so that 
> not a problem in itself.
>
> I have a similar system in development and there we do run the backend 
> daemon outside of the dajngo environment, but that makes database access 
> hard as you need a separate copy of the database models, or to use raw SQL. 
> In our system we still have a django management command though which has 
> the responsibility of pumping/handling messages from the deamon to the 
> intended destination.
>
> If you want to keep your backend separate l I can see two reasonable paths:
> 1. Use a custom set of django views to provide a API your backend connects 
> to over localhost/http to send the it message updates.
> 2. A django management command as a API interface message handler, which 
> connects to the backend over one of many message channels out there. (ie. 
> zmq, redis, unix-sockets, etc)
>
> Hope this helps a little bit.
>
> On Sun, 2018-05-27 at 01:01 -0700, Sourabh Jaiswal wrote:
>
> HI Ryan,
>
> The back-end script in this case is not only doing telnet. Its getting 
> data from multiple network elements using telnet and multi-threading. There 
> are multiple threads started when I start the backend script which takes 
> monitoring data from diff-diff network elements at the same time. The 
> communication between the threads is happening using a python Sockets. A 
> TCP server is responsible to pass the messages between threads. So I have 
> to have this background program run to collect data.
>
> The control from django I want is, to be able to start multiple instance 
> of this whole back-end package when user clicks on such cluster in django 
> front end. Passing management IP and other relevant information from django 
> DB. and after starting particular instance django should be able to control 
> it.
>
> What I found out from recent googling and stuff is. I need to write some 
> APIs in back-end program and as Andrew suggested it needs to be written in 
> such a way that it can be polled via django.
> So where to start in this regard? can you please guide me for that.
>
> Thanks in advance!
>
> Regards,
> Jaiswal.
>
> On Saturday, May 26, 2018 at 8:15:28 PM UTC+5:30, Ryan Nowakowski wrote:
>
> Another idea: create a Django management command that does the telnet 
> stuff and just run that periodically via Cron. You can always move to 
> channels or celery later.
>
> On May 26, 2018 9:33:16 AM CDT, Ryan Nowakowski  
> wrote:
>
> In addition to websockets, channels can be used to run background tasks 
> that could take a long time for example a telnet connection. You can Google 
> Django channels background tasks.
>
> An alternative to channels for background tasks is celery. 
>
> On May 26, 2018 5:03:51 AM CDT, Andrew Godwin  wrote:
>
> Hi Jaiswal,
>
> I'm afraid that I can't give detailed help about what your best options 
> are or 

Re: Django channels with python background tasks

2018-05-27 Thread Roger Gammans
I think there is a little bit of confusion in this thread,a s we keep
talk about django and the deamon process and ignoring the frontend.
So to clarify; there we are talking about a system with at least 3
execution environments:
1 The Browser2 Django backend processes3 The backend daemon/cli
-process.
django-channel provides a mechanism which (amongst other uses) can get
near-realtime updates from a django environment to the web browser, but
if you don't need this you can just store all your status data in the
data base . Then when the browser fetches a views it will have the most
recent data in the database.
You still however need to communicate between the backend process and
the rest of the django environment, the simplest way as Ryan suggesting
is tobring this inside the django environment by implementing it as a
management command, from there you have access to the python end of the
channels api to send messages to the browsers, or the model objects to
save to the database. Management commands can be arbitrarily complex,
so that not a problem in itself.
I have a similar system in development and there we do run the backend
daemon outside of the dajngo environment, but that makes database
access hard as you need a separate copy of the database models, or to
use raw SQL. In our system we still have a django management command
though which has the responsibility of pumping/handling messages from
the deamon to the intended destination.
If you want to keep your backend separate l I can see two reasonable
paths:  1. Use a custom set of django views to provide a API your
backend connects to over localhost/http to send the it message updates. 
2. A django management command as a API interface message handler,
which connects to the backend over one of many message channels out
there. (ie. zmq, redis, unix-sockets, etc)
Hope this helps a little bit.
On Sun, 2018-05-27 at 01:01 -0700, Sourabh Jaiswal wrote:
> HI Ryan,
> The back-end script in this case is not only doing telnet. Its
> getting data from multiple network elements using telnet and multi-
> threading. There are multiple threads started when I start the
> backend script which takes monitoring data from diff-diff network
> elements at the same time. The communication between the threads is
> happening using a python Sockets. A TCP server is responsible to pass
> the messages between threads. So I have to have this background
> program run to collect data.
> 
> The control from django I want is, to be able to start multiple
> instance of this whole back-end package when user clicks on such
> cluster in django front end. Passing management IP and other relevant
> information from django DB. and after starting particular instance
> django should be able to control it.
> 
> What I found out from recent googling and stuff is. I need to write
> some APIs in back-end program and as Andrew suggested it needs to be
> written in such a way that it can be polled via django.
> So where to start in this regard? can you please guide me for that.
> 
> Thanks in advance!
> 
> Regards,
> Jaiswal.
> 
> On Saturday, May 26, 2018 at 8:15:28 PM UTC+5:30, Ryan Nowakowski
> wrote:
> > Another idea: create a Django management command that does the
> > telnet stuff and just run that periodically via Cron. You can
> > always move to channels or celery later.
> > 
> > On May 26, 2018 9:33:16 AM CDT, Ryan Nowakowski  > > wrote:
> > > In addition to websockets, channels can be used to run background
> > > tasks that could take a long time for example a telnet
> > > connection. You can Google Django channels background tasks.
> > > 
> > > 
> > > 
> > > An alternative to channels for background tasks is celery. 
> > > 
> > > On May 26, 2018 5:03:51 AM CDT, Andrew Godwin  > > g> wrote:
> > > > Hi Jaiswal,
> > > > I'm afraid that I can't give detailed help about what your best
> > > > options are or walk you through how to do it - that's something
> > > > you'll have to research and decide on yourself. Channels allows
> > > > you to do low-latency communictation between Django back-ends
> > > > and JavaScript, but anything you can do with it can also be
> > > > done slower using a polling API connection.
> > > > 
> > > > My recommendation would be to start simple - doing it using an
> > > > API that you poll every few seconds - and then once you have
> > > > that figured out, look at how you could improve it using
> > > > WebSockets and channels.
> > > > 
> > > > Andrew
> > > > On Sat, May 26, 2018 at 8:38 AM Sourabh Jaiswal  > > > ail.com> wrote:
> > > > > Hi,
> > > > > 
> > > > > I am writing a python based application(CLI Back End) which
> > > > > does telnet to some network components and gets some data. It
> > > > > saves the data in sqlite db.
> > > > > 
> > > > > For this application I am writing Django based frond end.
> > > > > Which will start the CLI app and monitor it. For
> > > > > communication between the CLI 

Re: Django channels with python background tasks

2018-05-27 Thread Sourabh Jaiswal
HI Ryan,

The back-end script in this case is not only doing telnet. Its getting data 
from multiple network elements using telnet and multi-threading. There are 
multiple threads started when I start the backend script which takes 
monitoring data from diff-diff network elements at the same time. The 
communication between the threads is happening using a python Sockets. A 
TCP server is responsible to pass the messages between threads. So I have 
to have this background program run to collect data.

The control from django I want is, to be able to start multiple instance of 
this whole back-end package when user clicks on such cluster in django 
front end. Passing management IP and other relevant information from django 
DB. and after starting particular instance django should be able to control 
it.

What I found out from recent googling and stuff is. I need to write some 
APIs in back-end program and as Andrew suggested it needs to be written in 
such a way that it can be polled via django.
So where to start in this regard? can you please guide me for that.

Thanks in advance!

Regards,
Jaiswal.

On Saturday, May 26, 2018 at 8:15:28 PM UTC+5:30, Ryan Nowakowski wrote:
>
> Another idea: create a Django management command that does the telnet 
> stuff and just run that periodically via Cron. You can always move to 
> channels or celery later.
>
> On May 26, 2018 9:33:16 AM CDT, Ryan Nowakowski  > wrote:
>>
>> In addition to websockets, channels can be used to run background tasks 
>> that could take a long time for example a telnet connection. You can Google 
>> Django channels background tasks.
>>
>> An alternative to channels for background tasks is celery. 
>>
>> On May 26, 2018 5:03:51 AM CDT, Andrew Godwin > > wrote:
>>>
>>> Hi Jaiswal,
>>>
>>> I'm afraid that I can't give detailed help about what your best options 
>>> are or walk you through how to do it - that's something you'll have to 
>>> research and decide on yourself. Channels allows you to do low-latency 
>>> communictation between Django back-ends and JavaScript, but anything you 
>>> can do with it can also be done slower using a polling API connection.
>>>
>>> My recommendation would be to start simple - doing it using an API that 
>>> you poll every few seconds - and then once you have that figured out, look 
>>> at how you could improve it using WebSockets and channels.
>>>
>>> Andrew
>>>
>>> On Sat, May 26, 2018 at 8:38 AM Sourabh Jaiswal >> > wrote:
>>>
 Hi,


 I am writing a python based application(CLI Back End) which does telnet 
 to some network components and gets some data. It saves the data in sqlite 
 db.


 For this application I am writing Django based frond end. Which will 
 start the CLI app and monitor it. For communication between the CLI App 
 and 
 django I am not able to decide what to use. I read somewhere on net that 
 django channels can be used in this problem.


 I have no idea about what django channel is and what it does. Can some 
 one please help me in this I need to come up with a tool for this CLI and 
 django communication ASAP.



 Thanks in advance!

 Regards, Jaiswal.

 -- 
 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/2d704873-07cf-41d7-a747-0beb9ac85cfa%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/cbbf6a44-125e-4a0c-a220-8c025a05a00c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django channels with python background tasks

2018-05-27 Thread Sourabh Jaiswal
Hi Andrew,

Thanks a lot for your reply.

For a fast and easy approach I need the backend to be able to tell its 
status when asked by Django and be able to act when django sends some 
activity events.
The back end will be a long running program which will run in an infinite 
loop once started by django. After that django should have the capability 
to pause the program or stop the program Such events needs to be sent by 
django using HTML buttons and the back-end script should be able to act on 
those even and give ack that its done.

I am really sorry for asking very basic questions. But I started with 
django this month only so I dont have very good idea about it or how to 
achieve this.

Can you please guide me a bit. And point me a tutorial of some sort to 
achieve this.
>From your videos about django channels what I understood so far is Django 
channels can be used to offload the heavy work loads from one app or one 
server to some small services and apps.

Thanks a lot in advance!

Regards,
Jaiswal.

On Saturday, May 26, 2018 at 3:34:53 PM UTC+5:30, Andrew Godwin wrote:
>
> Hi Jaiswal,
>
> I'm afraid that I can't give detailed help about what your best options 
> are or walk you through how to do it - that's something you'll have to 
> research and decide on yourself. Channels allows you to do low-latency 
> communictation between Django back-ends and JavaScript, but anything you 
> can do with it can also be done slower using a polling API connection.
>
> My recommendation would be to start simple - doing it using an API that 
> you poll every few seconds - and then once you have that figured out, look 
> at how you could improve it using WebSockets and channels.
>
> Andrew
>
> On Sat, May 26, 2018 at 8:38 AM Sourabh Jaiswal  > wrote:
>
>> Hi,
>>
>>
>> I am writing a python based application(CLI Back End) which does telnet 
>> to some network components and gets some data. It saves the data in sqlite 
>> db.
>>
>>
>> For this application I am writing Django based frond end. Which will 
>> start the CLI app and monitor it. For communication between the CLI App and 
>> django I am not able to decide what to use. I read somewhere on net that 
>> django channels can be used in this problem.
>>
>>
>> I have no idea about what django channel is and what it does. Can some 
>> one please help me in this I need to come up with a tool for this CLI and 
>> django communication ASAP.
>>
>>
>>
>> Thanks in advance!
>>
>> Regards, Jaiswal.
>>
>> -- 
>> 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/2d704873-07cf-41d7-a747-0beb9ac85cfa%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/6e518095-793b-49e9-be57-7a0a2578b7a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error while doing django tutorial part 2

2018-05-27 Thread 'Anthony Flury' via Django users
What is the code for your Choice model.  The error message clearly states that 
the Choice model is the one with the problem. 

-- 
Anthony Flury
email : anthony.fl...@btinternet.com
Twitter : @TonyFlury

> On 26 May 2018, at 18:47, Kranthi Kiran <1991.kran...@gmail.com> wrote:
> 
> Text of error message in case the image is not loading
> 
> 
> >>> q = Question.objects.get(pk=1)
> >>> q.choice_set.all()
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/usr/lib64/python3.6/site-packages/django/db/models/query.py", line 
> 251,  
> in __repr__
> return '<%s %r>' % (self.__class__.__name__, data)
>   File "/usr/lib64/python3.6/site-packages/django/db/models/base.py", line 
> 513,  
> in __repr__
> return '<%s: %s>' % (self.__class__.__name__, self)
>   File "/home/kkondapalli/mysite/polls/models.py", line 25, in __str__
> return self.question_text
> AttributeError: 'Choice' object has no attribute 'question_text'
> >>>
> 
> 
> 
>> On Saturday, 26 May 2018 22:49:04 UTC+5:30, Kranthi Kiran wrote:
>> Hello User,
>> 
>> I am following django tutorial at 
>> https://docs.djangoproject.com/en/2.0/intro/tutorial02/
>> 
>> After modifying polls/models.py  and when running python3.6 manage.py shell 
>> again
>> 
>> 
>> I am getting the following error at the following 
>> 
>> >>> q = Question.objects.get(pk=1)
>> 
>> # Display any choices from the related object set -- none so far.
>> >>> q.choice_set.all()
>> 
>> 
>> Error screenshot
>> 
>> 
>> 
>> 
>> Please help me to resolve the issue at earliest
>> 
> 
> -- 
> 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/0e27456c-eefa-4a1e-bf4f-a44d9e8dcad1%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/79BDF872-C026-4A13-A6FA-31C7041CFD3A%40btinternet.com.
For more options, visit https://groups.google.com/d/optout.