MongoDB Connection Error with Python

2019-11-11 Thread 'Abhishek Sharma' via Django users
class MongoConnect(object):
def __init__(self,HOST,PORT,DB,USERNAME,PASSSWORD):
self.HOST=HOST
self.PORT=PORT
self.USERNAME=USERNAME
self.PASSSWORD=PASSSWORD
self.DB=DB
def getMongoConnetion(self):
client= MongoClient(self.HOST, self.PORT, username=self.USERNAME, 
password=self.PASSSWORD)
return client

def getDBObject(self, DB):
connection = getMongoConnetion()
return connection[DB].authenticate(USERNAME,PASSSWORD)



MONGO_DB = 'techcraft'
instance=MongoConnect('127.0.0.1',27017,'techcraft','craft','dbcl123456')
client=instance.getMongoConnetion()
db=instance.getDBObject('techcraft')
print(db)



Error##

Traceback (most recent call last):
  File "self.py", line 36, in 
db=instance.getDBObject('techcraft')
  File "self.py", line 28, in getDBObject
connection = getMongoConnetion()
NameError: name 'getMongoConnetion' is not defined

-- 

















The information in this
e-mail and any attachments is 
confidential and may be legally privileged. It is
intended solely for the 
addressee or addressee's. If you are not an intended
recipient, please 
delete the message and any attachments and notify the sender
of 
nondelivery. Any use or disclosure of the contents of either is 
unauthorised
and may be unlawful. All liability for viruses is excluded to 
the fullest
extent permitted by law. Any views expressed in this message 
are those of the
individual sender, except where the sender states them, 
with requisite
authority, to be those of the organisation.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/855f8f95-0175-4983-b667-439d7935c39e%40googlegroups.com.


Please help us to connect django with MongoDB

2019-11-01 Thread 'Abhishek Sharma' via Django users
Please help us to connect django with MongoDB

-- 

















The information in this
e-mail and any attachments is 
confidential and may be legally privileged. It is
intended solely for the 
addressee or addressee's. If you are not an intended
recipient, please 
delete the message and any attachments and notify the sender
of 
nondelivery. Any use or disclosure of the contents of either is 
unauthorised
and may be unlawful. All liability for viruses is excluded to 
the fullest
extent permitted by law. Any views expressed in this message 
are those of the
individual sender, except where the sender states them, 
with requisite
authority, to be those of the organisation.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e2d26181-791d-49d8-ae47-2c2debdbac23%40googlegroups.com.


Re: AttributeError: cffi library '_constant_time' has no function, constant or global variable named '__spec__'

2019-10-20 Thread 'Abhishek Sharma' via Django users
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 21, in 
main()
  File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
  File "C:\Python35\lib\site-packages\django\core\management\__init__.py", 
line 381, in execute_from_command_line
utility.execute()
  File "C:\Python35\lib\site-packages\django\core\management\__init__.py", 
line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python35\lib\site-packages\django\core\management\base.py", line 
323, in run_from_argv
self.execute(*args, **cmd_options)
  File 
"C:\Python35\lib\site-packages\django\core\management\commands\runserver.py", 
line 60, in execute
super().execute(*args, **options)
  File "C:\Python35\lib\site-packages\django\core\management\base.py", line 
364, in execute
output = self.handle(*args, **options)
  File 
"C:\Python35\lib\site-packages\django\core\management\commands\runserver.py", 
line 95, in handle
self.run(**options)
  File 
"C:\Python35\lib\site-packages\django\core\management\commands\runserver.py", 
line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
  File "C:\Python35\lib\site-packages\django\utils\autoreload.py", line 
598, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
  File "C:\Python35\lib\site-packages\django\utils\autoreload.py", line 
583, in start_django
reloader.run(django_main_thread)
  File "C:\Python35\lib\site-packages\django\utils\autoreload.py", line 
301, in run
self.run_loop()
  File "C:\Python35\lib\site-packages\django\utils\autoreload.py", line 
307, in run_loop
next(ticker)
  File "C:\Python35\lib\site-packages\django\utils\autoreload.py", line 
347, in tick
for filepath, mtime in self.snapshot_files():
  File "C:\Python35\lib\site-packages\django\utils\autoreload.py", line 
363, in snapshot_files
for file in self.watched_files():
  File "C:\Python35\lib\site-packages\django\utils\autoreload.py", line 
262, in watched_files
yield from iter_all_python_module_files()
  File "C:\Python35\lib\site-packages\django\utils\autoreload.py", line 
103, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
  File "C:\Python35\lib\site-packages\django\utils\autoreload.py", line 
124, in iter_modules_and_files
if getattr(module, '__spec__', None) is None:
SystemError:  returned a result with an error set



On Sunday, October 20, 2019 at 8:27:48 PM UTC+5:30, Abhishek Sharma wrote:
>
> I'm using Django and while run code getting below error, please help out 
> on it
>
> AttributeError: cffi library '_constant_time' has no function, constant or 
> global variable named '__spec__'
>

-- 

















The information in this
e-mail and any attachments is 
confidential and may be legally privileged. It is
intended solely for the 
addressee or addressee's. If you are not an intended
recipient, please 
delete the message and any attachments and notify the sender
of 
nondelivery. Any use or disclosure of the contents of either is 
unauthorised
and may be unlawful. All liability for viruses is excluded to 
the fullest
extent permitted by law. Any views expressed in this message 
are those of the
individual sender, except where the sender states them, 
with requisite
authority, to be those of the organisation.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e98263bd-05b9-4d7c-bbc7-bd1ebf9a4a83%40googlegroups.com.


AttributeError: cffi library '_constant_time' has no function, constant or global variable named '__spec__'

2019-10-20 Thread 'Abhishek Sharma' via Django users
I'm using Django and while run code getting below error, please help out on 
it

AttributeError: cffi library '_constant_time' has no function, constant or 
global variable named '__spec__'

-- 

















The information in this
e-mail and any attachments is 
confidential and may be legally privileged. It is
intended solely for the 
addressee or addressee's. If you are not an intended
recipient, please 
delete the message and any attachments and notify the sender
of 
nondelivery. Any use or disclosure of the contents of either is 
unauthorised
and may be unlawful. All liability for viruses is excluded to 
the fullest
extent permitted by law. Any views expressed in this message 
are those of the
individual sender, except where the sender states them, 
with requisite
authority, to be those of the organisation.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f6cfbeac-cf93-4d4c-b1bc-50a2cc01dd7b%40googlegroups.com.


Re: MongoDB Connect with Django

2019-09-28 Thread 'Abhishek Sharma' via Django users
Error during connecting Django with MongoDB, Please help on it.

django.core.exceptions.ImproperlyConfigured: 'django_mongodb_engine' isn't
an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
'mysql', 'oracle', 'postgresql', 'sqlite3'



*Regards,*
Abhishek


On Fri, Sep 27, 2019 at 9:18 PM Kasper Laudrup 
wrote:

> On September 27, 2019 3:56:03 PM GMT+02:00, 'Abhishek Sharma' via Django
> users  wrote:
>>
>> Hi Guy,
>>
>> My question is, I'm trying to connect mongodb from localhost using dango
>> freamwork.
>>
>> Realy greatfull if any budy help on it.
>>
>> Regards,
>> Abhishek
>>
>>
>> On Fri, Sep 27, 2019, 6:43 PM Kasper Laudrup 
>> wrote:
>>
>>>
>>>
>>> On 27/09/2019 14.47, 'Abhishek Sharma' via Django users wrote:
>>> > Thanku! Kasper but i didn't find a solution
>>> >
>>>
>>> Then it would probably be easier for people to help you with a solution
>>> if you started by clarifying what your problem is...
>>>
>>> Kind regards,
>>>
>>> Kasper Laudrup
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/7166e14c-f156-f5ee-17a3-5e978293b52c%40stacktrace.dk
>>> .
>>>
>>
>>
>>
>>
>> --
>>
>> The information in this e-mail and any attachments is confidential and
>> may be legally privileged. It is intended solely for the addressee or
>> addressee's. If you are not an intended recipient, please delete the
>> message and any attachments and notify the sender of nondelivery. Any use
>> or disclosure of the contents of either is unauthorised and may be
>> unlawful. All liability for viruses is excluded to the fullest extent
>> permitted by law. Any views expressed in this message are those of the
>> individual sender, except where the sender states them, with requisite
>> authority, to be those of the organisation.
>>
>>
> Hi buddy,
>
> That's not a question.
>
> What have you tried so far?
>
> Did you follow the instructions that someone was kind enough to send you a
> screenshot of?
>
> Which errors did you get, where's your code?
>
> Your not going to get any help until you figure out how to ask a question
> that someone can actually answer.
>
> Kind regards,
>
> Kasper
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/890A2FB0-C7C9-47DC-9FB1-678A7D68F73A%40stacktrace.dk
> <https://groups.google.com/d/msgid/django-users/890A2FB0-C7C9-47DC-9FB1-678A7D68F73A%40stacktrace.dk?utm_medium=email_source=footer>
> .
>

-- 


-- 

















The information in this
e-mail and any attachments is 
confidential and may be legally privileged. It is
intended solely for the 
addressee or addressee's. If you are not an intended
recipient, please 
delete the message and any attachments and notify the sender
of 
nondelivery. Any use or disclosure of the contents of either is 
unauthorised
and may be unlawful. All liability for viruses is excluded to 
the fullest
extent permitted by law. Any views expressed in this message 
are those of the
individual sender, except where the sender states them, 
with requisite
authority, to be those of the organisation.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADXAtDYfPft7Jder7CXP1OHQ6UMOghoMvimOhdeFLq7fcc-vgg%40mail.gmail.com.


Re: MongoDB Connect with Django

2019-09-27 Thread 'Abhishek Sharma' via Django users
Hi Guy,

My question is, I'm trying to connect mongodb from localhost using dango
freamwork.

Realy greatfull if any budy help on it.

Regards,
Abhishek


On Fri, Sep 27, 2019, 6:43 PM Kasper Laudrup  wrote:

>
>
> On 27/09/2019 14.47, 'Abhishek Sharma' via Django users wrote:
> > Thanku! Kasper but i didn't find a solution
> >
>
> Then it would probably be easier for people to help you with a solution
> if you started by clarifying what your problem is...
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7166e14c-f156-f5ee-17a3-5e978293b52c%40stacktrace.dk
> .
>

-- 


-- 

















The information in this
e-mail and any attachments is 
confidential and may be legally privileged. It is
intended solely for the 
addressee or addressee's. If you are not an intended
recipient, please 
delete the message and any attachments and notify the sender
of 
nondelivery. Any use or disclosure of the contents of either is 
unauthorised
and may be unlawful. All liability for viruses is excluded to 
the fullest
extent permitted by law. Any views expressed in this message 
are those of the
individual sender, except where the sender states them, 
with requisite
authority, to be those of the organisation.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADXAtDamVrn1YUkxBGa4E2Cej7fBvRFwMNRfAk-GxmOk1fY0cQ%40mail.gmail.com.


Re: MongoDB Connect with Django

2019-09-27 Thread 'Abhishek Sharma' via Django users
Thanku! Kasper but i didn't find a solution

On Friday, September 27, 2019 at 5:38:09 PM UTC+5:30, Kasper Laudrup wrote:
>
> Hi, 
>
> On 27/09/2019 13.40, 'Abhishek Sharma' via Django users wrote: 
> > 
> > Pls help out me on database connect established between django and 
> mongodb. 
> > 
> > i'm trying to connect from localhost to establish. 
> > 
>
> Have you had a look at this?: 
>
> https://django-mongodb-engine.readthedocs.io/en/latest/index.html 
>
> That was just the first thing I found doing a simple search... 
>
> Kind regards, 
>
> Kasper Laudrup 
>

-- 


-- 

















The information in this
e-mail and any attachments is 
confidential and may be legally privileged. It is
intended solely for the 
addressee or addressee's. If you are not an intended
recipient, please 
delete the message and any attachments and notify the sender
of 
nondelivery. Any use or disclosure of the contents of either is 
unauthorised
and may be unlawful. All liability for viruses is excluded to 
the fullest
extent permitted by law. Any views expressed in this message 
are those of the
individual sender, except where the sender states them, 
with requisite
authority, to be those of the organisation.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/654f2865-c841-49f3-8a95-77136ee9fc73%40googlegroups.com.


MongoDB Connect with Django

2019-09-27 Thread 'Abhishek Sharma' via Django users
Hi,

Pls help out me on database connect established between django and mongodb.

i'm trying to connect from localhost to establish.

Thanks,

-- 


-- 

















The information in this
e-mail and any attachments is 
confidential and may be legally privileged. It is
intended solely for the 
addressee or addressee's. If you are not an intended
recipient, please 
delete the message and any attachments and notify the sender
of 
nondelivery. Any use or disclosure of the contents of either is 
unauthorised
and may be unlawful. All liability for viruses is excluded to 
the fullest
extent permitted by law. Any views expressed in this message 
are those of the
individual sender, except where the sender states them, 
with requisite
authority, to be those of the organisation.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ef02e89a-ad4b-4b0e-ba6e-e3e83e9a90fd%40googlegroups.com.