Re: Channels websocket disconnecting after ~1min

2018-02-04 Thread Andrew Godwin
That would be me trying to move deployment to Travis. I'll push it up now.

Andrew

On Sun, Feb 4, 2018 at 5:47 PM, Ahmed Magdy  wrote:

> Thanks!
>
> I don't know if it was on purpose but you forgot to update the pypi
> package.
>
> On Monday, February 5, 2018 at 1:59:45 AM UTC+2, Andrew Godwin wrote:
>>
>> Hi there,
>>
>> This is a bug that should be fixed in the latest release of Daphne that I
>> put out a few hours ago.
>>
>> Andrew
>>
>> On Sun, Feb 4, 2018 at 3:49 PM, Ahmed Magdy  wrote:
>>
>>> Hello, and sorry for lots of questions about channels.
>>>
>>> I can connect to the websocket from JavaScript and send/receive normally
>>> for exactly 60~61sec after that the HTTP request is repeated on it's own
>>> and the websocket disconnects.
>>> Sometimes the HTTP get request is repeated more than once before the
>>> websocket disconnection.
>>>
>>> Even just connecting and waiting for 60~61secs result in the same thing.
>>>
>>> Terminal log
>>>
>>> Django version 2.0.2, using settings 'husite.settings'
 Starting ASGI/Channels development server at http://127.0.0.1:8000/
 Quit the server with CTRL-BREAK.
 2018-02-05 01:35:22,350 - INFO - server - HTTP/2 support not enabled
 (install the http2 and tls Twisted extras)
 2018-02-05 01:35:22,351 - INFO - server - Listening on endpoint
 tcp:port=8000:interface=127.0.0.1
 [2018/02/05 01:35:27] HTTP GET /sessions/24/ 200 [0.05, 127.0.0.1:9066]
 [2018/02/05 01:35:27] WebSocket HANDSHAKING /sessions/24 [
 127.0.0.1:9067]
 [2018/02/05 01:35:27] WebSocket CONNECT /sessions/24 [127.0.0.1:9067]
 [2018/02/05 01:36:28] HTTP GET /sessions/24 503 [61.05, 127.0.0.1:9067]
 [2018/02/05 01:36:28] WebSocket DISCONNECT /sessions/24 [127.0.0.1:9067
 ]

>>>
>>> # settings.py
>>> # ...
>>> ASGI_APPLICATION = "husite.routing.application"
>>> CHANNEL_LAYERS = {
>>>"default": {
>>>"BACKEND": "channels_redis.core.RedisChannelLayer",
>>>"CONFIG": {
>>>"hosts": [("localhost", 6379)],
>>>},
>>>},
>>> }
>>>
>>> class MyConsumer(WebsocketConsumer):
>>>def connect(self):
>>>self.accept()
>>>
>>> // Javascript code
>>> ws = new WebSocket(`${protocol}://${location.host}/sessions/{{session.id
>>> }}`)
>>>
>>>
>>> --
>>> 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/ms
>>> gid/django-users/63f72d2c-c5b7-4729-9d85-d4b1bcbe7e6e%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/d3d44ca9-515b-4f42-b239-907150a0ae8f%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/CAFwN1uqBx7kL5GGEz1%2B5jQD9g8ccHRuekZNu2v%3Ds9CyQ_JsyJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels websocket disconnecting after ~1min

2018-02-04 Thread Ahmed Magdy
Thanks!

I don't know if it was on purpose but you forgot to update the pypi package.

On Monday, February 5, 2018 at 1:59:45 AM UTC+2, Andrew Godwin wrote:
>
> Hi there,
>
> This is a bug that should be fixed in the latest release of Daphne that I 
> put out a few hours ago.
>
> Andrew
>
> On Sun, Feb 4, 2018 at 3:49 PM, Ahmed Magdy  > wrote:
>
>> Hello, and sorry for lots of questions about channels. 
>>
>> I can connect to the websocket from JavaScript and send/receive normally 
>> for exactly 60~61sec after that the HTTP request is repeated on it's own 
>> and the websocket disconnects.
>> Sometimes the HTTP get request is repeated more than once before the 
>> websocket disconnection.
>>
>> Even just connecting and waiting for 60~61secs result in the same thing.
>>
>> Terminal log
>>
>> Django version 2.0.2, using settings 'husite.settings'
>>> Starting ASGI/Channels development server at http://127.0.0.1:8000/
>>> Quit the server with CTRL-BREAK.
>>> 2018-02-05 01:35:22,350 - INFO - server - HTTP/2 support not enabled 
>>> (install the http2 and tls Twisted extras)
>>> 2018-02-05 01:35:22,351 - INFO - server - Listening on endpoint 
>>> tcp:port=8000:interface=127.0.0.1
>>> [2018/02/05 01:35:27] HTTP GET /sessions/24/ 200 [0.05, 127.0.0.1:9066]
>>> [2018/02/05 01:35:27] WebSocket HANDSHAKING /sessions/24 [127.0.0.1:9067
>>> ]
>>> [2018/02/05 01:35:27] WebSocket CONNECT /sessions/24 [127.0.0.1:9067]
>>> [2018/02/05 01:36:28] HTTP GET /sessions/24 503 [61.05, 127.0.0.1:9067]
>>> [2018/02/05 01:36:28] WebSocket DISCONNECT /sessions/24 [127.0.0.1:9067]
>>>
>>
>> # settings.py
>> # ...
>> ASGI_APPLICATION = "husite.routing.application"
>> CHANNEL_LAYERS = {
>>"default": {
>>"BACKEND": "channels_redis.core.RedisChannelLayer",
>>"CONFIG": {
>>"hosts": [("localhost", 6379)],
>>},
>>},
>> }
>>
>> class MyConsumer(WebsocketConsumer):
>>def connect(self):
>>self.accept()
>>
>> // Javascript code
>> ws = new WebSocket(`${protocol}://${location.host}/sessions/{{session.id
>> }}`)
>>
>>
>> -- 
>> 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/63f72d2c-c5b7-4729-9d85-d4b1bcbe7e6e%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/d3d44ca9-515b-4f42-b239-907150a0ae8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels websocket disconnecting after ~1min

2018-02-04 Thread Andrew Godwin
Hi there,

This is a bug that should be fixed in the latest release of Daphne that I
put out a few hours ago.

Andrew

On Sun, Feb 4, 2018 at 3:49 PM, Ahmed Magdy  wrote:

> Hello, and sorry for lots of questions about channels.
>
> I can connect to the websocket from JavaScript and send/receive normally
> for exactly 60~61sec after that the HTTP request is repeated on it's own
> and the websocket disconnects.
> Sometimes the HTTP get request is repeated more than once before the
> websocket disconnection.
>
> Even just connecting and waiting for 60~61secs result in the same thing.
>
> Terminal log
>
> Django version 2.0.2, using settings 'husite.settings'
>> Starting ASGI/Channels development server at http://127.0.0.1:8000/
>> Quit the server with CTRL-BREAK.
>> 2018-02-05 01:35:22,350 - INFO - server - HTTP/2 support not enabled
>> (install the http2 and tls Twisted extras)
>> 2018-02-05 01:35:22,351 - INFO - server - Listening on endpoint
>> tcp:port=8000:interface=127.0.0.1
>> [2018/02/05 01:35:27] HTTP GET /sessions/24/ 200 [0.05, 127.0.0.1:9066]
>> [2018/02/05 01:35:27] WebSocket HANDSHAKING /sessions/24 [127.0.0.1:9067]
>> [2018/02/05 01:35:27] WebSocket CONNECT /sessions/24 [127.0.0.1:9067]
>> [2018/02/05 01:36:28] HTTP GET /sessions/24 503 [61.05, 127.0.0.1:9067]
>> [2018/02/05 01:36:28] WebSocket DISCONNECT /sessions/24 [127.0.0.1:9067]
>>
>
> # settings.py
> # ...
> ASGI_APPLICATION = "husite.routing.application"
> CHANNEL_LAYERS = {
>"default": {
>"BACKEND": "channels_redis.core.RedisChannelLayer",
>"CONFIG": {
>"hosts": [("localhost", 6379)],
>},
>},
> }
>
> class MyConsumer(WebsocketConsumer):
>def connect(self):
>self.accept()
>
> // Javascript code
> ws = new WebSocket(`${protocol}://${location.host}/sessions/{{session.id
> }}`)
>
>
> --
> 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/63f72d2c-c5b7-4729-9d85-d4b1bcbe7e6e%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/CAFwN1uqywU967ZSC19T7KT0rgH-m83e31HvGYxuG%2BRXdp5LRWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Channels websocket disconnecting after ~1min

2018-02-04 Thread Ahmed Magdy
Hello, and sorry for lots of questions about channels. 

I can connect to the websocket from JavaScript and send/receive normally 
for exactly 60~61sec after that the HTTP request is repeated on it's own 
and the websocket disconnects.
Sometimes the HTTP get request is repeated more than once before the 
websocket disconnection.

Even just connecting and waiting for 60~61secs result in the same thing.

Terminal log

Django version 2.0.2, using settings 'husite.settings'
> Starting ASGI/Channels development server at http://127.0.0.1:8000/
> Quit the server with CTRL-BREAK.
> 2018-02-05 01:35:22,350 - INFO - server - HTTP/2 support not enabled 
> (install the http2 and tls Twisted extras)
> 2018-02-05 01:35:22,351 - INFO - server - Listening on endpoint 
> tcp:port=8000:interface=127.0.0.1
> [2018/02/05 01:35:27] HTTP GET /sessions/24/ 200 [0.05, 127.0.0.1:9066]
> [2018/02/05 01:35:27] WebSocket HANDSHAKING /sessions/24 [127.0.0.1:9067]
> [2018/02/05 01:35:27] WebSocket CONNECT /sessions/24 [127.0.0.1:9067]
> [2018/02/05 01:36:28] HTTP GET /sessions/24 503 [61.05, 127.0.0.1:9067]
> [2018/02/05 01:36:28] WebSocket DISCONNECT /sessions/24 [127.0.0.1:9067]
>

# settings.py
# ...
ASGI_APPLICATION = "husite.routing.application"
CHANNEL_LAYERS = {
   "default": {
   "BACKEND": "channels_redis.core.RedisChannelLayer",
   "CONFIG": {
   "hosts": [("localhost", 6379)],
   },
   },
}

class MyConsumer(WebsocketConsumer):
   def connect(self):
   self.accept()

// Javascript code
ws = new WebSocket(`${protocol}://${location.host}/sessions/{{session.id}}`)


-- 
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/63f72d2c-c5b7-4729-9d85-d4b1bcbe7e6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tutorial 2 - Ver2.0 - python manage.py makemigrations polls - Error message when running

2018-02-04 Thread Daniel Hepper
Hi, you have a typo in your models.py in this line:

 votes = models.InterferField(default=0)

It should be IntegerField.

Cheers,
Daniel

CanuckT  schrieb am So. 4. Feb. 2018 um 21:06:

> Hi,  new to programming and trying the tutorial out for Django.
>
> Using this guide:  https://docs.djangoproject.com/en/2.0/intro/tutorial02/
>
> Running this command:  python manage.py makemigrations polls
>
> I get this output - way over my head. Any ideas?
> (I have tried changing the settings.py INSTALLED_APPS to just 'polls' as
> suggested in some other posts, same results.
>
> Thanks!
>
>
> Traceback (most recent call last):
>
>   File "manage.py", line 15, in 
>
> execute_from_command_line(sys.argv)
>
>   File
> "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/management/__init__.py",
> line 371, in execute_from_command_line
>
> utility.execute()
>
>   File
> "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/management/__init__.py",
> line 347, in execute
>
> django.setup()
>
>   File
> "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/__init__.py",
> line 24, in setup
>
> apps.populate(settings.INSTALLED_APPS)
>
>   File
> "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/apps/registry.py",
> line 112, in populate
>
> app_config.import_models()
>
>   File
> "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/apps/config.py",
> line 198, in import_models
>
> self.models_module = import_module(models_module_name)
>
>   File
> "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py",
> line 126, in import_module
>
> return _bootstrap._gcd_import(name[level:], package, level)
>
>   File "", line 994, in _gcd_import
>
>   File "", line 971, in _find_and_load
>
>   File "", line 955, in
> _find_and_load_unlocked
>
>   File "", line 665, in _load_unlocked
>
>   File "", line 678, in exec_module
>
>   File "", line 219, in
> _call_with_frames_removed
>
>   File "/Users/tdehnke/djlearn/mysite/polls/models.py", line 9, in 
>
> class Choice(models.Model):
>
>   File "/Users/tdehnke/djlearn/mysite/polls/models.py", line 12, in Choice
>
> votes = models.InterferField(default=0)
>
> AttributeError: module 'django.db.models' has no attribute 'InterferField'
>
> --
> 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/aa4a1ae5-8dfa-4eab-a739-14ed87ec5f05%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/CAHEnUVXS3aEOAjBJDZEGL3F-NBOQL%3D7ivPjtR-odp2kVerxZNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Tutorial 2 - Ver2.0 - python manage.py makemigrations polls - Error message when running

2018-02-04 Thread CanuckT
Hi,  new to programming and trying the tutorial out for Django.

Using this guide:  https://docs.djangoproject.com/en/2.0/intro/tutorial02/

Running this command:  python manage.py makemigrations polls

I get this output - way over my head. Any ideas?
(I have tried changing the settings.py INSTALLED_APPS to just 'polls' as 
suggested in some other posts, same results.

Thanks!


Traceback (most recent call last):

  File "manage.py", line 15, in 

execute_from_command_line(sys.argv)

  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/management/__init__.py",
 
line 371, in execute_from_command_line

utility.execute()

  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/management/__init__.py",
 
line 347, in execute

django.setup()

  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/__init__.py",
 
line 24, in setup

apps.populate(settings.INSTALLED_APPS)

  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/apps/registry.py",
 
line 112, in populate

app_config.import_models()

  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/apps/config.py",
 
line 198, in import_models

self.models_module = import_module(models_module_name)

  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py",
 
line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

  File "", line 994, in _gcd_import

  File "", line 971, in _find_and_load

  File "", line 955, in _find_and_load_unlocked

  File "", line 665, in _load_unlocked

  File "", line 678, in exec_module

  File "", line 219, in 
_call_with_frames_removed

  File "/Users/tdehnke/djlearn/mysite/polls/models.py", line 9, in 

class Choice(models.Model):

  File "/Users/tdehnke/djlearn/mysite/polls/models.py", line 12, in Choice

votes = models.InterferField(default=0)

AttributeError: module 'django.db.models' has no attribute 'InterferField'

-- 
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/aa4a1ae5-8dfa-4eab-a739-14ed87ec5f05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels v2.0 - 'RedisChannelLayer' object has no attribute 'ChannelFull'

2018-02-04 Thread Andrew Godwin
Hi,

Sorry about this, it was a bug in the group_send method. It's been fixed in
channels_redis version 2.0.2.

Andrew

On Sun, Feb 4, 2018 at 4:19 AM, Ahmed Magdy  wrote:

> Sending 10~12 messages to the websocket raises an exception
>
> 'RedisChannelLayer' object has no attribute 'ChannelFull'
>>
>
> Trace
>
> ERROR:root:Exception inside application: 'RedisChannelLayer' object has no
>> attribute 'ChannelFull'
>>   File "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-
>> packages\channels\consumer.py", line 51, in __call__
>> await await_many_dispatch([receive, self.channel_receive],
>> self.dispatch)
>>   File 
>> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\channels\utils.py",
>> line 48, in await_many_dispatch
>> await dispatch(result)
>>   File 
>> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\asgiref\sync.py",
>> line 99, in inner
>> return await async_func(*args, **kwargs)
>>   File 
>> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\asgiref\sync.py",
>> line 79, in __call__
>> return await asyncio.wait_for(future, timeout=None)
>>   File "C:\Python36\lib\asyncio\tasks.py", line 339, in wait_for
>> return (yield from fut)
>>   File "C:\Python36\lib\concurrent\futures\thread.py", line 56, in run
>> result = self.fn(*self.args, **self.kwargs)
>>   File 
>> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\asgiref\sync.py",
>> line 91, in thread_handler
>> raise e
>>   File 
>> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\asgiref\sync.py",
>> line 89, in thread_handler
>> self.func(*args, **kwargs)
>>   File "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-
>> packages\channels\consumer.py", line 93, in dispatch
>> handler(message)
>>   File "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-
>> packages\channels\generic\websocket.py", line 40, in websocket_receive
>> self.receive(text_data=message["text"])
>>   File "D:\Programming\DjangoWebsite\MigratingHUsite\husite\
>> GraduationProject\sessionManagerApp\consumers.py", line 28, in receive
>> self.send_message('[{0}] {1}'.format(self.get_user_fullname(),
>> text_data))
>>   File "D:\Programming\DjangoWebsite\MigratingHUsite\husite\
>> GraduationProject\sessionManagerApp\consumers.py", line 36, in
>> send_message
>> "text": text_data,
>>   File 
>> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\asgiref\sync.py",
>> line 45, in __call__
>> call_result.result()
>>   File "C:\Python36\lib\concurrent\futures\_base.py", line 432, in result
>> return self.__get_result()
>>   File "C:\Python36\lib\concurrent\futures\_base.py", line 384, in
>> __get_result
>> raise self._exception
>>   File 
>> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\asgiref\sync.py",
>> line 53, in main_wrap
>> result = await self.awaitable(*args, **kwargs)
>>   File "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-
>> packages\channels_redis\core.py", line 326, in group_send
>> except self.ChannelFull:
>>   'RedisChannelLayer' object has no attribute 'ChannelFull'
>>
>
> Here's the function that raises the exception.
>
> def send_message(self, text_data):
>session_id = self.scope['url_route']['kwargs']['session_id']
>AsyncToSync(self.channel_layer.group_send)(
>'chat-{0}'.format(session_id),
>{
>"type": "chat.message",
>"text": text_data,
>},
>)
>
> --
> 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/e05542a0-43e1-42ec-bc92-6861565f5e91%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/CAFwN1uqVXbWZKjyuX19CO6SytWuCWPrE0-HPWtqsWz9nFqDgww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Channels v2.0 - 'RedisChannelLayer' object has no attribute 'ChannelFull'

2018-02-04 Thread Ahmed Magdy
Sending 10~12 messages to the websocket raises an exception

'RedisChannelLayer' object has no attribute 'ChannelFull'
>

Trace

ERROR:root:Exception inside application: 'RedisChannelLayer' object has no 
> attribute 'ChannelFull'
>   File 
> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\channels\consumer.py",
>  
> line 51, in __call__
> await await_many_dispatch([receive, self.channel_receive], 
> self.dispatch)
>   File 
> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\channels\utils.py",
>  
> line 48, in await_many_dispatch
> await dispatch(result)
>   File 
> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\asgiref\sync.py",
>  
> line 99, in inner
> return await async_func(*args, **kwargs)
>   File 
> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\asgiref\sync.py",
>  
> line 79, in __call__
> return await asyncio.wait_for(future, timeout=None)
>   File "C:\Python36\lib\asyncio\tasks.py", line 339, in wait_for
> return (yield from fut)
>   File "C:\Python36\lib\concurrent\futures\thread.py", line 56, in run
> result = self.fn(*self.args, **self.kwargs)
>   File 
> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\asgiref\sync.py",
>  
> line 91, in thread_handler
> raise e
>   File 
> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\asgiref\sync.py",
>  
> line 89, in thread_handler
> self.func(*args, **kwargs)
>   File 
> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\channels\consumer.py",
>  
> line 93, in dispatch
> handler(message)
>   File 
> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\channels\generic\websocket.py",
>  
> line 40, in websocket_receive
> self.receive(text_data=message["text"])
>   File 
> "D:\Programming\DjangoWebsite\MigratingHUsite\husite\GraduationProject\sessionManagerApp\consumers.py",
>  
> line 28, in receive
> self.send_message('[{0}] {1}'.format(self.get_user_fullname(), 
> text_data))
>   File 
> "D:\Programming\DjangoWebsite\MigratingHUsite\husite\GraduationProject\sessionManagerApp\consumers.py",
>  
> line 36, in send_message
> "text": text_data,
>   File 
> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\asgiref\sync.py",
>  
> line 45, in __call__
> call_result.result()
>   File "C:\Python36\lib\concurrent\futures\_base.py", line 432, in result
> return self.__get_result()
>   File "C:\Python36\lib\concurrent\futures\_base.py", line 384, in 
> __get_result
> raise self._exception
>   File 
> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\asgiref\sync.py",
>  
> line 53, in main_wrap
> result = await self.awaitable(*args, **kwargs)
>   File 
> "D:\Programming\DjangoWebsite\MigratingHUsite\lib\site-packages\channels_redis\core.py",
>  
> line 326, in group_send
> except self.ChannelFull:
>   'RedisChannelLayer' object has no attribute 'ChannelFull'
>

Here's the function that raises the exception.

def send_message(self, text_data):
   session_id = self.scope['url_route']['kwargs']['session_id']
   AsyncToSync(self.channel_layer.group_send)(
   'chat-{0}'.format(session_id),
   {
   "type": "chat.message",
   "text": text_data,
   },
   )

-- 
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/e05542a0-43e1-42ec-bc92-6861565f5e91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Customizable Invoice

2018-02-04 Thread Derek
If you plan to use PDF in your solution, then this may help you:

https://www.kickstarter.com/projects/34257246/reportlab-pdf-processing-with-python
'

On Saturday, 3 February 2018 07:21:50 UTC+2, Rakhee Menon wrote:
>
> Oops!!I am sorry !! I got your question wrong.Yes I do have some knowledge 
> about django. Just wanted to know whether its possible and any solution if 
> u could suggest.
> Anways Thanks a lot :)
>
> On Friday, February 2, 2018 at 3:20:21 PM UTC+5:30, Andy wrote:
>>
>> Well since your answer is no, you should take you time and learn 
>> Python/Dajngo before asking anyone in here to basically write that invoice 
>> app for you. :)
>>
>> Basically Django can do what you are asking for, but i'd recommend you to 
>> use it only as a backend for this highly UI focused problem. Then think 
>> about what the frontend will be (web, app, mobile) and choose something 
>> that has the needed frontend components that you would like to use. 
>>
>> But let me tell you this: a totally customizable invoice with that shall 
>> still look pretty and can be printed out in any combination of item rows 
>> and extra details is probably one of the hardest tasks you can think of not 
>> having any programming background!
>> Having kinda done the above i can definitely recommend the awesome 
>> https://github.com/Kozea/WeasyPrint library for generating PDF files!
>>
>> But it sounds to me that you should do yourself a favour and read this 
>> before actually starting your project: 
>> https://www.twoscoopspress.com/products/two-scoops-of-django-1-11
>>
>> Have fun!
>>
>>  
>>
>> Am Freitag, 2. Februar 2018 10:24:31 UTC+1 schrieb Rakhee Menon:
>>>
>>>
>>>
>>> No...I wanted to know if i could do it using django and if yes...how to 
>>> do it??
>>>
>>

-- 
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/39d4a3e1-8631-4a70-a04e-9f2420e2ce2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django-hotsauce: Current status and roadmap

2018-02-04 Thread Etienne Robillard

Hi,

Is wrk (https://github.com/wg/wrk) any better than ab for making HTTP 
benchmarks of django applications?


how should i collect wrk input to make graphs in Python?

Etienne


Le 2018-02-01 à 04:27, Etienne Robillard a écrit :


Hi,

Actually, I want to benchmark the WSGI application/handler of Django 
2.0.1.


And, I want to compare the Gevent loop engine with python based 
poll/epoll .


Do i really need to setup django with uwsgi to make theses 
tests/benchmarks?



Etienne


Le 2018-01-31 à 19:02, Etienne Robillard a écrit :


Hi,

Any ideas of good python library for benchmarking standalone Django 
2.0 http server?


Thanks in advance,

Etienne


Le 2018-01-31 à 07:38, Etienne Robillard a écrit :


Hi Avraham,


Le 2018-01-31 à 06:35, Avraham Serour a écrit :

Why do you call it microframework?


Because it still depends mostly on the core Django API.

You should prove it is high performance, benchmark, measure, 
compare and show some cool graphs


All right. I'm planning to benchmark the following:

Django-hotsauce 0.8.2 with Cython extensions
Django-hotsauce 0.8.2 with CPython 3.7
Django-hotsauce 0.8.2 with ZODB database
Django-hotsauce 0.9.0 with PyPy 5.9
Django-hotsauce 0.9.0 with CPython 3.7
Django-hotsauce 0.9.0 with ZODB database
Django 1.11.7 with SQLite database
Django 1.11.7 with CPython 3.7
Django 1.11.7 with PyPy 5.9
Django 2.0.1 with SQLite database
Django 2.0.1 with CPython 3.7
Django 2.0.1 with PyPy 5.9



I already have a Django project, is it a drop in replacement?


Technically, it is a full-scale web microframework on top of Django. 
You still need to install Django to run Django-hotsauce.


My project uses python 3.6 while you only have experimental support 
for 3.5. I'm not going back, you should have already experimental 
support for 3.7 at least


I don't expect huge differences between python 3.5 and 3.7. I will 
try to update in order to make cool benchmarks. :)


Many thanks for your input!

Etienne



On 31 Jan 2018 12:35, "Etienne Robillard" > wrote:


Hi everyone,

This is a quick post to present the current state of
development in Django-hotsauce, a high-performance and scalable
WSGI microframework on top of Django and others.

Django-hotsauce has now reached the 0.9 milestone. New major
features now supported includes:

  * uWSGI support with Gevent loop engine
  * Full ZODB databases support through the Schevo DBMS
  * OAuth2 authentication and authorization support with
thread-local request storage based on Werkzeug
  * Experimental PyPy 5.9 and CPython 3.5 support
  * Backward compatibility with Django 1.4 and Django 1.11

What should be done next? How can Django-hotsauce attract a
larger audience?


Best regards,

Etienne



-- 
Etienne Robillard

tkad...@yandex.com 
https://www.isotopesoftware.ca/ 

-- 
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/680aff87-b96d-7a55-4515-a1762e02f5de%40yandex.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/CAFWa6tLoNEdTwg39nWdR2N6XxQN4PLy%2BpWve0UwKwakJen1FAA%40mail.gmail.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Etienne Robillard
tkad...@yandex.com
https://www.isotopesoftware.ca/
--
You received this message because you are subscribed to the Google 
Groups "Django hotsauce" group.
To unsubscribe from this group and stop receiving emails from it,