Re: Help: 'django.utils.six.moves' is not a package

2018-04-10 Thread Babatunde Akinyanmi
Do you have any module making use of six? Also is there any change in the
story if you do `python3 manage.py [command]`
On Tue, 10 Apr 2018, 18:57 Julio Biason,  wrote:

> Six is self-contained it does look anywhere, it has its own list of “how
> it was before and how it is now”.
>
> In the case of moves, it has conditions of “module urlparse is urlparse in
> python 2 and urllib.parse in python 3” and then sets its own move module to
> point to one of those, based on python version.
>
> It’s weird that it can find six, but not the “moves” module. Have you
> tried deleting your virtual end and creating it again, with the new
> versions?
>
> Get Outlook for iOS 
> --
> *From:* django-users@googlegroups.com  on
> behalf of Derek Zeng 
> *Sent:* Tuesday, April 10, 2018 10:31:27 AM
> *To:* django-users@googlegroups.com
> *Subject:* Re: Help: 'django.utils.six.moves' is not a package
>
>
>
> On Tue, Apr 10, 2018, 1:39 AM Babatunde Akinyanmi 
> wrote:
>
>>
>>
>> On Tue, 10 Apr 2018, 02:47 Derek Zeng,  wrote:
>>
>>> I'm using django 2.0.
>>> What exactly is the purpose of django.utils.six.moves module?
>>>
>> Allowing a code base to be able to run on both python 2 and python 3
>>
>
> yeah, but what role does moves module play here? if an old module is not
> found here, where does it look for it?
>
>
>> I have read the source but don't quite understand. Seems like a poly-fill
>>> of pre-existing libraries like urllib
>>>
>>>
>>> On Mon, Apr 9, 2018 at 3:47 PM, Avraham Serour 
>>> wrote:
>>>
 sounds like django 2 removed six and some library you are using still
 hopes it exists.

 what django version are you using?

 On Mon, Apr 9, 2018 at 3:39 AM, Derek Zeng  wrote:

> I got the following error when running pytest in django. Help is
> appreciated.
>
> This is the test I run
>
> import pytest
> from .factories import *
>
> @pytest.mark.django_db
> def test_with_client(client):
>   PostFactory.create() # if commented out, the error is gone
>   response = client.get('/')
>
>   body = str(response.content)
>   assert 'Mysite' in body
>
> PostFactory creates a Post object in the database
>
>
> apps/blog/tests/test_post.py:5 (test_with_client)
> client = 
> @pytest.mark.django_db
> def test_with_client(client):
> p = PostFactory.create()
>
> > response = client.get('/')
> blog/tests/test_post.py:10:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _ _ _ _ _
> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:517:
> in get
> response = super().get(path, data=data, secure=secure, **extra)
> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:332:
> in get
> return self.generic('GET', path, secure=secure, **r)
> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:404:
> in generic
> return self.request(**r)
> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:467:
> in request
> response = self.handler(environ)
> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:125:
> in __call__
> self.load_middleware()
> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/core/handlers/base.py:37:
> in load_middleware
> middleware = import_string(middleware_path)
> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/utils/module_loading.py:17:
> in import_string
> module = import_module(module_path)
> ../../../../.virtualenvs/django/lib/python3.6/importlib/__init__.py:126:
> in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
> :994: in _gcd_import
> ???
> :971: in _find_and_load
> ???
> :955: in _find_and_load_unlocked
> ???
> :665: in _load_unlocked
> ???
> :678: in exec_module
> ???
> :219: in _call_with_frames_removed
> ???
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _ _ _ _ _
> from __future__ import absolute_import
>
> import re
>
> from django import http
> from django.apps import apps
> from django.utils.cache import patch_vary_headers
> > from django.utils.six.moves.urllib.parse import urlparse
> E ModuleNotFoundError: No module named
> 'django.utils.six.moves.urllib'; 'django.utils.six.moves' is not a package
> ../../../../.virtualenvs/django/lib/python3.6/site-packages/corsheaders/middleware.py:8:
> ModuleNotFoundError
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django 

Re: A first time programmer

2018-04-10 Thread FranzOC

be sure about that you have installed django typing $pip freeze in your 
console

-- 
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/c76a10cb-a7d2-46c3-8915-4849b5b6a2e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Suggest any document to learn below syntax?

2018-04-10 Thread Mike Dewhirst

On 11/04/2018 7:51 AM, Utpal Brahma wrote:

{{  question.question_text  }}

{%  for  choice  in  question.choice_set.all  %}
 {{  choice.choice_text  }}
{%  endfor  %}



Try this ...

https://docs.djangoproject.com/en/2.0/#the-template-layer


I got this syntax in Writing your first Django app, part 3.
--
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/398dae6d-0387-41dc-a8e4-f3485ad1465c%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/6d1c26cb-304e-272b-05db-f76affba0ecc%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Django and Live Chat

2018-04-10 Thread Daniel Ash
If I was going to tackle this, I would use XMPP as the protocol.  If it's 
internal only it will be easier than if there is a requirement to federate 
external to your environment.  Someone already did some of the work for you.
https://github.com/fpytloun/django-xmpp


On Tuesday, April 10, 2018 at 12:53:29 AM UTC-5, Haroon Ahmed wrote:
>
> Hi,
>
> I am using Django 1.9.8 and Python 3.4.4, will upgrade my django to 
> 1.11,
> I want to create Chat functionality in my project, My requirement is 
> that application users can Live chat with Admin users and maintain chat 
> history of each user!
> Please suggest some packages or solution that i can customize 
> according to my requirement!
> 
> Any kind of hep will be appreciated in advance.
>
> Regards,
> Haroon Ahmed
>

-- 
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/6115ef29-8777-40a8-9ec8-a4f33140a7e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN]: django-todo 2.0

2018-04-10 Thread katuramu henry
This is awesome work Scot


On Tue, Apr 10, 2018 at 6:50 PM, Scot Hacker  wrote:

> “django-todo is a *pluggable*, multi-user, multi-group, multi-list todo
> and ticketing system - a reusable app designed to be dropped into any
> existing Django project. Users can create tasks for themselves or for
> others, or create ”assigned tasks” that will be filed into a specific list
> (public tickets).”
>
>
> That was the original project description, and it hasn’t changed in 10+
> years.
>
>
> When I first created django-todo, it was a simple “let’s learn Django”
> project idea. I open sourced it, it’s been relatively successful, and the
> project has received numerous contributions over the years (grateful!).
> When I heard that it wasn’t compatible with Django 2.0, I looked back on
> that dusty old code and realized it was time for a major refactor/upgrade.
>
>
> The update started small, but by the end, I had made 75 commits and
> written the first suite of working tests (finally!). Virtually every
> module and template has been refactored, I  adopted Bootstrap as the
> default layout engine, and finally got around to creating a live demo site
> for the project.
>
>
> django-todo 2.0 requires Django 2.0 and Python 3.x  - no apologies.
> Unfortunately, this is a backwards-incompatible update (you’ll need to
> migrate old data manually, if you have any).
>
>
> Hope it’s useful to a few teams or individuals out there. Contributions
> still very much welcome.
>
>
> Demo site: http://django-todo.org/
>
> Docs: http://django-todo.readthedocs.io/
>
> Github: https://github.com/shacker/django-todo
>
> Demo host site (which runs django-todo.org):
> https://github.com/shacker/gtd
>
>
> --
> 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/4222bcad-bb6d-4406-936b-3d3e0cc37f06%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/CALyMqZTHA-QmNL5-XikkeHzoW3%3DM6ua2jWby10u4GAzmXG4AHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Suggest any document to learn below syntax?

2018-04-10 Thread Utpal Brahma


{{ question.question_text }}{% for choice in 
question.choice_set.all %}
{{ choice.choice_text }}{% endfor %}


I got this syntax in Writing your first Django app, part 3.

-- 
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/398dae6d-0387-41dc-a8e4-f3485ad1465c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to achieve wildcard search using haystack in django

2018-04-10 Thread shawnmhy


I am currently working on haystack search in django. I met 2 problems, 
first, when I use 'Whoosh' engine, the search can only return the result 
that match exactly the same with my search key, for example if I type 
'ABC', it cannot match 'ABCD' Secondly, how can I achieve wildcard search 
using haystack? For example, if I type'A*C', it can return 'ABC', 'ABCCC' 
'AC' and so one. Or other method just to achieve the same result(Basically, 
return the result that contains the key word in same order)

-- 
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/f13fe857-13c9-4d46-b1f8-9f8d42298dae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help: 'django.utils.six.moves' is not a package

2018-04-10 Thread Julio Biason
Six is self-contained it does look anywhere, it has its own list of "how it was 
before and how it is now".

In the case of moves, it has conditions of "module urlparse is urlparse in 
python 2 and urllib.parse in python 3" and then sets its own move module to 
point to one of those, based on python version.

It's weird that it can find six, but not the "moves" module. Have you tried 
deleting your virtual end and creating it again, with the new versions?

Get Outlook for iOS

From: django-users@googlegroups.com  on behalf 
of Derek Zeng 
Sent: Tuesday, April 10, 2018 10:31:27 AM
To: django-users@googlegroups.com
Subject: Re: Help: 'django.utils.six.moves' is not a package



On Tue, Apr 10, 2018, 1:39 AM Babatunde Akinyanmi 
> wrote:


On Tue, 10 Apr 2018, 02:47 Derek Zeng, 
> wrote:
I'm using django 2.0.
What exactly is the purpose of django.utils.six.moves module?
Allowing a code base to be able to run on both python 2 and python 3

yeah, but what role does moves module play here? if an old module is not found 
here, where does it look for it?


I have read the source but don't quite understand. Seems like a poly-fill of 
pre-existing libraries like urllib


On Mon, Apr 9, 2018 at 3:47 PM, Avraham Serour 
> wrote:
sounds like django 2 removed six and some library you are using still hopes it 
exists.

what django version are you using?

On Mon, Apr 9, 2018 at 3:39 AM, Derek Zeng 
> wrote:
I got the following error when running pytest in django. Help is appreciated.

This is the test I run

import pytest
from .factories import *

@pytest.mark.django_db
def test_with_client(client):
  PostFactory.create() # if commented out, the error is gone
  response = client.get('/')

  body = str(response.content)
  assert 'Mysite' in body

PostFactory creates a Post object in the database


apps/blog/tests/test_post.py:5 (test_with_client)
client = 
@pytest.mark.django_db
def test_with_client(client):
p = PostFactory.create()

> response = client.get('/')
blog/tests/test_post.py:10:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:517:
 in get
response = super().get(path, data=data, secure=secure, **extra)
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:332:
 in get
return self.generic('GET', path, secure=secure, **r)
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:404:
 in generic
return self.request(**r)
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:467:
 in request
response = self.handler(environ)
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:125:
 in __call__
self.load_middleware()
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/core/handlers/base.py:37:
 in load_middleware
middleware = import_string(middleware_path)
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/utils/module_loading.py:17:
 in import_string
module = import_module(module_path)
../../../../.virtualenvs/django/lib/python3.6/importlib/__init__.py:126: in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
:994: in _gcd_import
???
:971: in _find_and_load
???
:955: in _find_and_load_unlocked
???
:665: in _load_unlocked
???
:678: in exec_module
???
:219: in _call_with_frames_removed
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
from __future__ import absolute_import

import re

from django import http
from django.apps import apps
from django.utils.cache import patch_vary_headers
> from django.utils.six.moves.urllib.parse import urlparse
E ModuleNotFoundError: No module named 'django.utils.six.moves.urllib'; 
'django.utils.six.moves' is not a package
../../../../.virtualenvs/django/lib/python3.6/site-packages/corsheaders/middleware.py:8:
 ModuleNotFoundError


--
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/23957c7e-9aca-4494-a06a-20cbf0fc857b%40googlegroups.com.
For more options, visit 

Re: Help: 'django.utils.six.moves' is not a package

2018-04-10 Thread Derek Zeng
On Tue, Apr 10, 2018, 1:39 AM Babatunde Akinyanmi 
wrote:

>
>
> On Tue, 10 Apr 2018, 02:47 Derek Zeng,  wrote:
>
>> I'm using django 2.0.
>> What exactly is the purpose of django.utils.six.moves module?
>>
> Allowing a code base to be able to run on both python 2 and python 3
>

yeah, but what role does moves module play here? if an old module is not
found here, where does it look for it?


> I have read the source but don't quite understand. Seems like a poly-fill
>> of pre-existing libraries like urllib
>>
>>
>> On Mon, Apr 9, 2018 at 3:47 PM, Avraham Serour  wrote:
>>
>>> sounds like django 2 removed six and some library you are using still
>>> hopes it exists.
>>>
>>> what django version are you using?
>>>
>>> On Mon, Apr 9, 2018 at 3:39 AM, Derek Zeng  wrote:
>>>
 I got the following error when running pytest in django. Help is
 appreciated.

 This is the test I run

 import pytest
 from .factories import *

 @pytest.mark.django_db
 def test_with_client(client):
   PostFactory.create() # if commented out, the error is gone
   response = client.get('/')

   body = str(response.content)
   assert 'Mysite' in body

 PostFactory creates a Post object in the database


 apps/blog/tests/test_post.py:5 (test_with_client)
 client = 
 @pytest.mark.django_db
 def test_with_client(client):
 p = PostFactory.create()

 > response = client.get('/')
 blog/tests/test_post.py:10:
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 _ _ _ _
 ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:517:
 in get
 response = super().get(path, data=data, secure=secure, **extra)
 ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:332:
 in get
 return self.generic('GET', path, secure=secure, **r)
 ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:404:
 in generic
 return self.request(**r)
 ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:467:
 in request
 response = self.handler(environ)
 ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:125:
 in __call__
 self.load_middleware()
 ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/core/handlers/base.py:37:
 in load_middleware
 middleware = import_string(middleware_path)
 ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/utils/module_loading.py:17:
 in import_string
 module = import_module(module_path)
 ../../../../.virtualenvs/django/lib/python3.6/importlib/__init__.py:126:
 in import_module
 return _bootstrap._gcd_import(name[level:], package, level)
 :994: in _gcd_import
 ???
 :971: in _find_and_load
 ???
 :955: in _find_and_load_unlocked
 ???
 :665: in _load_unlocked
 ???
 :678: in exec_module
 ???
 :219: in _call_with_frames_removed
 ???
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 _ _ _ _
 from __future__ import absolute_import

 import re

 from django import http
 from django.apps import apps
 from django.utils.cache import patch_vary_headers
 > from django.utils.six.moves.urllib.parse import urlparse
 E ModuleNotFoundError: No module named 'django.utils.six.moves.urllib';
 'django.utils.six.moves' is not a package
 ../../../../.virtualenvs/django/lib/python3.6/site-packages/corsheaders/middleware.py:8:
 ModuleNotFoundError

 --
 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/23957c7e-9aca-4494-a06a-20cbf0fc857b%40googlegroups.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Django users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/django-users/EmfIjFICjyU/unsubscribe.
>>> To unsubscribe from this group and all its topics, 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 

[ANN]: django-todo 2.0

2018-04-10 Thread Scot Hacker
 

“django-todo is a *pluggable*, multi-user, multi-group, multi-list todo and 
ticketing system - a reusable app designed to be dropped into any existing 
Django project. Users can create tasks for themselves or for others, or 
create ”assigned tasks” that will be filed into a specific list (public 
tickets).”


That was the original project description, and it hasn’t changed in 10+ 
years.


When I first created django-todo, it was a simple “let’s learn Django” 
project idea. I open sourced it, it’s been relatively successful, and the 
project has received numerous contributions over the years (grateful!). 
When I heard that it wasn’t compatible with Django 2.0, I looked back on 
that dusty old code and realized it was time for a major refactor/upgrade. 


The update started small, but by the end, I had made 75 commits and written 
the first suite of working tests (finally!). Virtually every module and 
template has been refactored, I  adopted Bootstrap as the default layout 
engine, and finally got around to creating a live demo site for the project.


django-todo 2.0 requires Django 2.0 and Python 3.x  - no apologies. 
Unfortunately, this is a backwards-incompatible update (you’ll need to 
migrate old data manually, if you have any).


Hope it’s useful to a few teams or individuals out there. Contributions 
still very much welcome.


Demo site: http://django-todo.org/

Docs: http://django-todo.readthedocs.io/

Github: https://github.com/shacker/django-todo

Demo host site (which runs django-todo.org): https://github.com/shacker/gtd


-- 
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/4222bcad-bb6d-4406-936b-3d3e0cc37f06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django blocking on writing logs

2018-04-10 Thread Avraham Serour
it doesn't seem to have any relation to a synchronous logger

On Tue, Apr 10, 2018 at 1:16 AM, Ameni Bejaoui 
wrote:

> I face this problem when i want to test the django interface in the web
> browser local domain :/ what should i do ? i change even the port to 8080
> the same problem
>
> 2018-04-09 20:27 GMT+01:00 Avraham Serour :
>
>> It seems you are right, I found this SO thread dealing with the same
>> question: https://stackoverflow.com/questions/34349797/are-
>> log-statements-blocking-in-django-python
>>
>> In pratical terms I use sentry, the python client claims to use a
>> threaded async approach, I suggest taking a look at their implementation,
>> or just plugging sentry to your app.
>>
>> On Thu, Apr 5, 2018 at 7:51 PM, Daniel Arndt 
>> wrote:
>>
>>> Hi all,
>>>
>>> Although not explicitly mentioned anywhere, I've come to the conclusion
>>> Django blocks while writing logs with some handlers (it uses Python
>>> logging, https://docs.python.org/3/howto/logging-cookbook.ht
>>> ml#dealing-with-handlers-that-block).
>>>
>>> I can't find anything that explicitly states Django handles this already
>>> (in the code or documentation) and I believe it to be a problem in the
>>> platform I am working on. Justification for this belief is loose at best,
>>> but it's the best lead I have (specifically, the SysLogHandler seems like
>>> it might be blocking on sending to a UDP port, which seems crazy but
>>> apparently is possible)
>>>
>>> I'm setting trying to see if I can solve this, but there seems to be
>>> very little details on this subject, and that alone worries me. So I have a
>>> couple questions for anyone willing to entertain me:
>>>
>>>
>>>1. Is it silly to be worried about this? My gut says yes, simply
>>>because nobody else is. At the same time I see no real downside to 
>>> logging
>>>asynchronously (is that true?). There are potential upsides. It might not
>>>solve the real problem (what is causing buffers to back up in the first
>>>place? likely crazy I/O usage) but it might speed up handling of requests
>>>during heavy I/O.
>>>2. Have you done anything similar to this? How did you approach it?
>>>3. The QueueHandler suggested in the Python cookbook doesn't seem to
>>>be easy to stuff into Django. We have Django running behind Gunicorn, so 
>>> my
>>>thought was to have Gunicorn spin up a QueueListener process, and then 
>>> have
>>>Gunicorn pass the queue to each worker similar to this cookbook:
>>>https://docs.python.org/3/howto/logging-cookbook.h
>>>tml#logging-to-a-single-file-from-multiple-processes
>>>
>>> 
>>>-- I'm interested on any thoughts on this approach. Especially if there 
>>> is
>>>a better way.
>>>
>>> Cheers,
>>> Dan
>>>
>>> --
>>> 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/ce269c78-bd6b-4e06-b9de-2da6ccc79cd8%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/ms
>> gid/django-users/CAFWa6tKBZ5Nq8BwOVBWxpyg%3DS6nzV_%3DhXF_
>> km9A-bT_pFXfbtw%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/CAHBt3Ny%2BspWTP4-um4j%3DmtU1z-
> 

Re: username and allowed alphanumeric, why?

2018-04-10 Thread Avraham Serour
It seems you read that wrong, usernames may contain alphanumeric and other
characters.


On Tue, Apr 10, 2018 at 12:10 PM, Stefano Tranquillini <
stefano.tranquill...@gmail.com> wrote:

> Hi all,
>
> mostly curiosity, why does the username https://docs.djangoproject.
> com/en/1.11/ref/contrib/auth/#django.contrib.auth.models.User.username
> allow only _, @, +, . and - characters?
> is there a reason for that?
>
>
> --
> 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/62ca69fe-ca26-4b48-ac19-4f4887dce08a%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/CAFWa6t%2BU_gYm4ykyeQ9buUSgnkD0ZzD9oGOwdYwEFQkdiam8mg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to restrict Model.objects.all() to data pertaining to one organization

2018-04-10 Thread Gabriel - Iulian Dumbrava
I think django-multitenant  
gives you the best answer.

marți, 10 aprilie 2018, 14:04:03 UTC+3, Mauro Crociara a scris:
>
> Hi everyone,
>
> I posted this question 
> 
>  
> on Stackoverflow almost 4 months ago and asked a couple of times on #django 
> IRC channel on Freenode, but none gave me a suggestion about the problem. 
> Up to now I have no solution and no clue how to proceed. Maybe you can show 
> me the right direction. 
>
> Thanks for your time and support!
> Mauro
>

-- 
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/203a3d82-7aee-482d-a753-8520225b8217%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to restrict Model.objects.all() to data pertaining to one organization

2018-04-10 Thread Gabriel - Iulian Dumbrava
Please take a look at this 
 comparison grid. At 
least one of those packages allows automatic filtering of queries if you 
set it up properly. For example, each table must have that 'organisation' 
field to filter on it.

marți, 10 aprilie 2018, 14:04:03 UTC+3, Mauro Crociara a scris:
>
> Hi everyone,
>
> I posted this question 
> 
>  
> on Stackoverflow almost 4 months ago and asked a couple of times on #django 
> IRC channel on Freenode, but none gave me a suggestion about the problem. 
> Up to now I have no solution and no clue how to proceed. Maybe you can show 
> me the right direction. 
>
> Thanks for your time and support!
> Mauro
>

-- 
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/7a38587d-8f48-48ef-b61f-44c6157f6548%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django and Live Chat

2018-04-10 Thread Jason
check out django-channels.  but this is a pretty big feature you're looking 
into with lots of extra required infrastructure.

On Tuesday, April 10, 2018 at 1:53:29 AM UTC-4, Haroon Ahmed wrote:
>
> Hi,
>
> I am using Django 1.9.8 and Python 3.4.4, will upgrade my django to 
> 1.11,
> I want to create Chat functionality in my project, My requirement is 
> that application users can Live chat with Admin users and maintain chat 
> history of each user!
> Please suggest some packages or solution that i can customize 
> according to my requirement!
> 
> Any kind of hep will be appreciated in advance.
>
> Regards,
> Haroon Ahmed
>

-- 
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/0fde9b51-c4a1-4d27-b56f-8e5917033f82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to restrict Model.objects.all() to data pertaining to one organization

2018-04-10 Thread Jason
Looking at your SO question, seems to me you're expecting some magic to 
happen without any pertinent information available to execute that filter.

There are a couple things I can think of to add more information to the 
incoming request to help you use the custom model manager.  For example, 
when a user logs in, you specify an organization name that's included in 
all API requests as a query param, and said param is used to execute the db 
query.  

-- 
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/daf3a2e8-f4b5-4e15-a6fd-9791d71673af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to restrict Model.objects.all() to data pertaining to one organization

2018-04-10 Thread Jani Tiainen
Hi.

Model.objects.filter (organization=organization)

Or did you mean something else?

ti 10. huhtikuuta 2018 klo 14.03 Mauro Crociara 
kirjoitti:

> Hi everyone,
>
> I posted this question
> 
> on Stackoverflow almost 4 months ago and asked a couple of times on #django
> IRC channel on Freenode, but none gave me a suggestion about the problem.
> Up to now I have no solution and no clue how to proceed. Maybe you can show
> me the right direction.
>
> Thanks for your time and support!
> Mauro
>
> --
> 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/a9647aa9-4743-4bf3-9202-72329e4c38af%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/CAHn91oer%2BbFUCrGycAKXX6SWmy8cNDfJL%3DnOw4MBS3-aVU-%3Dyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to restrict Model.objects.all() to data pertaining to one organization

2018-04-10 Thread Mauro Crociara
Hi everyone,

I posted this question 

 
on Stackoverflow almost 4 months ago and asked a couple of times on #django 
IRC channel on Freenode, but none gave me a suggestion about the problem. 
Up to now I have no solution and no clue how to proceed. Maybe you can show 
me the right direction. 

Thanks for your time and support!
Mauro

-- 
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/a9647aa9-4743-4bf3-9202-72329e4c38af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


username and allowed alphanumeric, why?

2018-04-10 Thread Stefano Tranquillini
Hi all,

mostly curiosity, why does the username 
https://docs.djangoproject.com/en/1.11/ref/contrib/auth/#django.contrib.auth.models.User.username
 
allow only _, @, +, . and - characters?
is there a reason for that? 


-- 
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/62ca69fe-ca26-4b48-ac19-4f4887dce08a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.