Re: Error Djongo MongoDB

2018-05-17 Thread Aditya Singh
Hi mate,
This is the assured solution. This is because djongo looks for active mongo
connection to connect. Download mongodb for your os and fire up mongod fron
bin directory. Then create a folder named data/db in root disk drive. It
should then work flawlessly.
Kind Regards,
Aditya

On Fri, May 18, 2018, 9:33 AM Ryan Nowakowski  wrote:

> Is your mongo host (IP) and port set correctly?
>
> On May 17, 2018 4:09:17 PM CDT, Kadir Guloglu 
> wrote:
>>
>> Hi
>>
>> I am try to connect MongoDB and I am getting an exception
>>
>> *Thanks for help*
>>
>> *CMD*
>>
>> *c:\Proje\otomabakv2\otomabak\otomabak>python manage.py makemigrations*
>> *Traceback (most recent call last):*
>> *  File "manage.py", line 15, in *
>> *execute_from_command_line(sys.argv)*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py",
>> line 371, in execute_from_command_line*
>> *utility.execute()*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py",
>> line 365, in execute*
>> *self.fetch_command(subcommand).run_from_argv(self.argv)*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py",
>> line 288, in run_from_argv*
>> *self.execute(*args, **cmd_options)*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py",
>> line 335, in execute*
>> *output = self.handle(*args, **options)*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\commands\makemigrations.py",
>> line 92, in handle*
>> *loader.check_consistent_history(connection)*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\migrations\loader.py",
>> line 275, in check_consistent_history*
>> *applied = recorder.applied_migrations()*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\migrations\recorder.py",
>> line 61, in applied_migrations*
>> *if self.has_table():*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\migrations\recorder.py",
>> line 44, in has_table*
>> *return self.Migration._meta.db_table in
>> self.connection.introspection.table_names(self.connection.cursor())*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\backends\base\introspection.py",
>> line 56, in table_names*
>> *return get_names(cursor)*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\backends\base\introspection.py",
>> line 51, in get_names*
>> *return sorted(ti.name  for ti in
>> self.get_table_list(cursor)*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\djongo\introspection.py",
>> line 34, in get_table_list*
>> *for c in cursor.db_conn.collection_names(False)]*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\database.py",
>> line 617, in collection_names*
>> *for result in self.list_collections(session=session, **kws)]*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\database.py",
>> line 586, in list_collections*
>> *ReadPreference.PRIMARY) as (sock_info, slave_okay):*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\contextlib.py",
>> line 81, in __enter__*
>> *return next(self.gen)*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\mongo_client.py",
>> line 982, in _socket_for_reads*
>> *server = topology.select_server(read_preference)*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\topology.py",
>> line 224, in select_server*
>> *address))*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\topology.py",
>> line 183, in select_servers*
>> *selector, server_timeout, address)*
>> *  File
>> "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\topology.py",
>> line 199, in _select_servers_loop*
>> *self._error_message(selector))*
>> *pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [WinError
>> 10061] No connection could be made because the target machine actively
>> refused it*
>>
>>
>>
>> DATABASES = {
>> "default": {
>> 'ENGINE': 'djongo',
>> "NAME": "admin",
>> "host": "MONGO DB SERVER IP",
>> "PASSWORD": "PASSWORD",
>> "USER": "kadirguloglu1",
>> "PORT": 27017,
>> },
>> }
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django 

Re: How to retrieve existing data of mongodb database in Django

2018-05-17 Thread Ryan Nowakowski
It looks like you're reusing the variable connone. Could that be the issue?

On May 15, 2018 10:38:06 AM CDT, gomahe...@gmail.com wrote:
>I am new to Django started developing the application  but got a
>problem in 
>retrieving the data from already existing data which looks like this
>below.
>   
>   
>   
>  
>{"_id":"5ad72e80bdd7ad184031ab2d","name":"john","country":"usa","place":"xyz"}
>
>{"_id":"5ad72ec6bdd7ad184031ab2e","name":"ron","country":"canada","place":"ABC"}
> 
> 
> 
>The code in the django look like this
>
>
>from mongoengine import *
>from django.shortcuts import render
>from django.contrib.auth.models import User
>
> 
>class demo_data(DynamicDocument):
>meta = {
>
>'index_background':True,
>'collection':'demo_data',
>}
>name = StringField(max_length=100)
>country = StringField(max_length=100)
>place = StringField(max_length=150)
>
>connone = 
>connect(host='mongodb://myusername:mypassw...@example.com/databasename?replicaSet=rs0')
>
>
>def test_extract(request):
>
>connone = demo_data()
>dt_view = connone._data
>
>print(dt_view)
>return render(request,"extract.html",{"dt":dt_view}) 
>
>My  code in extract.html   
> 
>
>
>the data relating to collection {{dt}}
>
>
>
>  
>
>And the output which i got after running is this 
>   
>the data relating to collection {'name': None, 'country': None, 
>'place': None, 'id': None}
>
>Can anyone please help me out from this situation would be  appreciated
>
>-- 
>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/9dc0e170-6a1c-46d0-84be-7385158ea59e%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/94AE5694-74A4-4D61-9068-C405E8BF0F6F%40fattuba.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error Djongo MongoDB

2018-05-17 Thread Ryan Nowakowski
Is your mongo host (IP) and port set correctly?

On May 17, 2018 4:09:17 PM CDT, Kadir Guloglu  wrote:
>Hi
>
>I am try to connect MongoDB and I am getting an exception
>
>*Thanks for help*
>
>*CMD*
>
>*c:\Proje\otomabakv2\otomabak\otomabak>python manage.py makemigrations*
>*Traceback (most recent call last):*
>*  File "manage.py", line 15, in *
>*execute_from_command_line(sys.argv)*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py",
>
>line 371, in execute_from_command_line*
>*utility.execute()*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py",
>
>line 365, in execute*
>*self.fetch_command(subcommand).run_from_argv(self.argv)*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py",
>
>line 288, in run_from_argv*
>*self.execute(*args, **cmd_options)*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py",
>
>line 335, in execute*
>*output = self.handle(*args, **options)*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\commands\makemigrations.py",
>
>line 92, in handle*
>*loader.check_consistent_history(connection)*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\migrations\loader.py",
>
>line 275, in check_consistent_history*
>*applied = recorder.applied_migrations()*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\migrations\recorder.py",
>
>line 61, in applied_migrations*
>*if self.has_table():*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\migrations\recorder.py",
>
>line 44, in has_table*
>*return self.Migration._meta.db_table in 
>self.connection.introspection.table_names(self.connection.cursor())*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\backends\base\introspection.py",
>
>line 56, in table_names*
>*return get_names(cursor)*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\backends\base\introspection.py",
>
>line 51, in get_names*
>*return sorted(ti.name for ti in self.get_table_list(cursor)*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\djongo\introspection.py",
>
>line 34, in get_table_list*
>*for c in cursor.db_conn.collection_names(False)]*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\database.py",
>
>line 617, in collection_names*
>*for result in self.list_collections(session=session, **kws)]*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\database.py",
>
>line 586, in list_collections*
>*ReadPreference.PRIMARY) as (sock_info, slave_okay):*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\contextlib.py",
>
>line 81, in __enter__*
>*return next(self.gen)*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\mongo_client.py",
>
>line 982, in _socket_for_reads*
>*server = topology.select_server(read_preference)*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\topology.py",
>
>line 224, in select_server*
>*address))*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\topology.py",
>
>line 183, in select_servers*
>*selector, server_timeout, address)*
>*  File 
>"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\topology.py",
>
>line 199, in _select_servers_loop*
>*self._error_message(selector))*
>*pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [WinError
>
>10061] No connection could be made because the target machine actively 
>refused it*
>
>
>
>DATABASES = {
>"default": {
>'ENGINE': 'djongo',
>"NAME": "admin",
>"host": "MONGO DB SERVER IP",
>"PASSWORD": "PASSWORD",
>"USER": "kadirguloglu1",
>"PORT": 27017,
>},
>}
>
>-- 
>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/aa46a058-7e0f-4116-8156-37ba5c382309%40googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are 

Re: Django 2.0 MongoDB

2018-05-17 Thread Ryan Nowakowski
Django is typically used with a SQL database. There's a fork of Django called 
non-rel that works with mongo but it's not actively developed any longer. 
Instead you can access mongo from a Django view via the standard mongo python 
library but you won't be able to use Django's models or admin. Those are pretty 
dependent on a SQL database.

On May 17, 2018 7:21:10 AM CDT, Kadir Guloglu  wrote:
>Hi
>
>how to connection my django 2 project in MongoDB ?
>
>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/943ce6ad-1f7c-48c7-9a9a-4ffac0f25a45%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/193821D6-941C-4A67-9478-50427D954F41%40fattuba.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 2.1 alpha 1 released

2018-05-17 Thread Aditya Singh
Wow wow wow! My best and nost powerful framework in the world. Super
excited for the new release!
Kind Regards,
Aditya

On Fri, May 18, 2018, 6:45 AM Tim Graham  wrote:

> We've made the first release on the way to Django's next major
> release, Django 2.1! With about two and a half months until the
> final release (scheduled for August 1), we'll need timely testing
> from the community to ensure an on time, stable release. Check out the
> blog post:
> https://www.djangoproject.com/weblog/2018/may/17/django-21-alpha-1/
>
> --
> 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/CAD-rxRCubeJJQ36%3DV4kaaaYUr82fWq-hsnrNy7e-4YqGT-sQQA%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/CAEPfumg%2BF2MQa8p33sooFV61Z37V06Ujw9RAfYJsmrvqwf7kKA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django 2.1 alpha 1 released

2018-05-17 Thread Tim Graham
We've made the first release on the way to Django's next major
release, Django 2.1! With about two and a half months until the
final release (scheduled for August 1), we'll need timely testing
from the community to ensure an on time, stable release. Check out the
blog post:
https://www.djangoproject.com/weblog/2018/may/17/django-21-alpha-1/

-- 
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/CAD-rxRCubeJJQ36%3DV4kaaaYUr82fWq-hsnrNy7e-4YqGT-sQQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Error Djongo MongoDB

2018-05-17 Thread Kadir Guloglu
Hi

I am try to connect MongoDB and I am getting an exception

*Thanks for help*

*CMD*

*c:\Proje\otomabakv2\otomabak\otomabak>python manage.py makemigrations*
*Traceback (most recent call last):*
*  File "manage.py", line 15, in *
*execute_from_command_line(sys.argv)*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py",
 
line 371, in execute_from_command_line*
*utility.execute()*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py",
 
line 365, in execute*
*self.fetch_command(subcommand).run_from_argv(self.argv)*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py",
 
line 288, in run_from_argv*
*self.execute(*args, **cmd_options)*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py",
 
line 335, in execute*
*output = self.handle(*args, **options)*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\commands\makemigrations.py",
 
line 92, in handle*
*loader.check_consistent_history(connection)*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\migrations\loader.py",
 
line 275, in check_consistent_history*
*applied = recorder.applied_migrations()*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\migrations\recorder.py",
 
line 61, in applied_migrations*
*if self.has_table():*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\migrations\recorder.py",
 
line 44, in has_table*
*return self.Migration._meta.db_table in 
self.connection.introspection.table_names(self.connection.cursor())*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\backends\base\introspection.py",
 
line 56, in table_names*
*return get_names(cursor)*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\backends\base\introspection.py",
 
line 51, in get_names*
*return sorted(ti.name for ti in self.get_table_list(cursor)*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\djongo\introspection.py",
 
line 34, in get_table_list*
*for c in cursor.db_conn.collection_names(False)]*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\database.py",
 
line 617, in collection_names*
*for result in self.list_collections(session=session, **kws)]*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\database.py",
 
line 586, in list_collections*
*ReadPreference.PRIMARY) as (sock_info, slave_okay):*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\contextlib.py", 
line 81, in __enter__*
*return next(self.gen)*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\mongo_client.py",
 
line 982, in _socket_for_reads*
*server = topology.select_server(read_preference)*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\topology.py",
 
line 224, in select_server*
*address))*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\topology.py",
 
line 183, in select_servers*
*selector, server_timeout, address)*
*  File 
"C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\topology.py",
 
line 199, in _select_servers_loop*
*self._error_message(selector))*
*pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [WinError 
10061] No connection could be made because the target machine actively 
refused it*



DATABASES = {
"default": {
'ENGINE': 'djongo',
"NAME": "admin",
"host": "MONGO DB SERVER IP",
"PASSWORD": "PASSWORD",
"USER": "kadirguloglu1",
"PORT": 27017,
},
}

-- 
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/aa46a058-7e0f-4116-8156-37ba5c382309%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError : cannot import name include

2018-05-17 Thread Daniel Hepper
You are using Django 1.11 with the tutorial written for Django 2.0. Therr 
should be a version picker on the bottom right of the tutorial.

You are seeing this error because the way to import ‚include’ has changed from 
1.11 to 2.0

Hope that helps,
Daniel

> Am 17.05.2018 um 19:34 schrieb Tristan Demot :
> 
> Hello,
> 
>  I use docs.djangoproject.co/en/2.0
>  Python 2 7 13
> Gjango 1.11.13
> 
> Creating the Polls app OK
> 
> Write your first view OK
> 
> But python manage runserver don't work
> With : python -Wall manage.py test
> 
> ImportError : cannot import name include
> 
> If you want to see something, ask me
> 
> Many 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/1fe7df04-dc85-4a3d-940e-4dde7de31477%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/16D40353-23AC-4172-99D7-FD9F7879800C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError : cannot import name include

2018-05-17 Thread Fidel Leon
You are using the wrong combination of Django and tutorial: “include” is
available in Django 2 and up, but you’re using Django 1.11.

Fidel Leon
fi...@flm.cat
Phone: +34 622 26 44 92 
GPG: 2585 30C2 E3C7 7151 0864  946B 7423 F94B 5753 5FC7

El 17 de mayo de 2018 a las 20:56:56, Tristan Demot (
cont...@journal-immo.com) escribió:

Hello,

 I use docs.djangoproject.co/en/2.0
 Python 2 7 13
Gjango 1.11.13

Creating the Polls app OK
Write your first view OK
But python manage runserver don't work
With : python -Wall manage.py test

ImportError : cannot import name include

If you want to see something, ask me

Many 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/1fe7df04-dc85-4a3d-940e-4dde7de31477%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/CAHXg%3DN090U8JCFfdvZJWH1qSoWQgp2mQH6z2RfCzj3384epQKQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


ImportError : cannot import name include

2018-05-17 Thread Tristan Demot
Hello,

 I use docs.djangoproject.co/en/2.0
 Python 2 7 13
Gjango 1.11.13

Creating the Polls app OK
Write your first view OK
But python manage runserver don't work
With : python -Wall manage.py test

ImportError : cannot import name include

If you want to see something, ask me

Many 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/1fe7df04-dc85-4a3d-940e-4dde7de31477%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Field.choices get all items as json

2018-05-17 Thread C. Kirby
if you just want to put that into json do:
import json

YEAR_IN_SCHOOL_CHOICES = (
('FR', 'Freshman'),
('SO', 'Sophomore'),
('JR', 'Junior'),
('SR', 'Senior'),
)

serialized_year_choices = json.dumps(Model.YEAR_IN_SCHOOL_CHOICES) 





On Thursday, May 17, 2018 at 10:52:15 AM UTC-4, Majid Hojati wrote:
>
> Hi,
> I have a Field.choices in my model. lets say it is:
>
> YEAR_IN_SCHOOL_CHOICES = (
>> ('FR', 'Freshman'),
>> ('SO', 'Sophomore'),
>> ('JR', 'Junior'),
>> ('SR', 'Senior'),
>> )
>
>
> I can access them using this method Model. YEAR_IN_SCHOOL_CHOICES  but 
> how can I convert it to a json then I can send them using a webservice ? is 
> there any good method?
>

-- 
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/3ebbf6ad-9d34-44ec-8274-983cb5a5fa97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Field.choices get all items as json

2018-05-17 Thread Majid Hojati
Hi,
I have a Field.choices in my model. lets say it is:

YEAR_IN_SCHOOL_CHOICES = (
> ('FR', 'Freshman'),
> ('SO', 'Sophomore'),
> ('JR', 'Junior'),
> ('SR', 'Senior'),
> )


I can access them using this method Model. YEAR_IN_SCHOOL_CHOICES  but how 
can I convert it to a json then I can send them using a webservice ? is 
there any good method?

-- 
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/42833f6b-0016-42ec-81c2-d37c9cd9a119%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django 2.0 MongoDB

2018-05-17 Thread Kadir Guloglu
Hi

how to connection my django 2 project in MongoDB ?

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/943ce6ad-1f7c-48c7-9a9a-4ffac0f25a45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: New to Python

2018-05-17 Thread Derek
In addition to Beautiful Soup, you probably need Requests 
(http://docs.python-requests.org/en/master/).

Some examples of using these together:

https://gist.github.com/bradmontgomery/1872970

https://www.digitalocean.com/community/tutorials/how-to-work-with-web-data-using-requests-and-beautiful-soup-with-python-3

P.S. In future try to use a descriptive name for your post to the group; 
e.g. Looking for help on web scraping woith Python 

On Tuesday, 15 May 2018 22:01:59 UTC+2, Mo El wrote:
>
> Hi there,
>
> I`m new to python and i have been watching a lot of tutorials regarding 
> web scraping using python, and my question is what is the best library to 
> use, and can someone help me to understand how to write a scrapped data to 
> an HTML, say i scrapped some data from a website and i wanted to write that 
> data to another page to view or use using python as well.
>
> Your help is very much appreciated  
>

-- 
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/685112bf-4ed7-41d6-8042-c1c02776cbf8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.