How to use Informix database and run automated scripts in Django Framework?

2017-12-12 Thread kanika Gupta
Hi,

I am a newbie to Django and Python. 

I am trying to find out a way in which I can retrieve data from our 
Informix database and run my BDDs in Pycharm using Django Framework. 

At the moment we are using Mock data using SQLite and we want to use live 
data for our tests.

I was thinking PostgreSQL, is that a solution? If so, then why? And how do 
I use it? or anything else I can use?

Any pointers would be really helpful.

Thanks,

Kanika.

-- 
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/78961c82-4866-42c9-be2b-01f4b9dd7796%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


context must be a dict rather than Context.

2017-12-12 Thread Al Scham
*Hi,*

*Im a new user going through this tutorial at OverIQ 
: https://overiq.com/django/1.10/loading-templates-in-django*

*I've followed the instructions to the letter but it keep throwing the 
Typeerror you see in the subject.*

*Here is a copy paist of my views :*

from django.shortcuts import render
from django.http import HttpResponse
from django import template
import datetime

def index(request):
return HttpResponse("Hello Django")

def today_is(request):
now = datetime.datetime.now()
t = template.loader.get_template('blog/datetime.html')
c = template.Context({'now': now})
html = t.render(c)
return HttpResponse(html)

*and here is a copy paist of my template:*





Current Time



{#This is a comment #}
{check the existence of now variable in the template using if tag #}
{% if now %}
Current date and time is {{ now }}
{% else %}
now variable is not available
{% endif %}




*Any help would be greatly appreciated.*

*Thanks*
*Allon*


-- 
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/67a732ee-ba22-4386-9241-1bd6c362885d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


unable to combine two forms in a single form

2017-12-12 Thread nishant sharma
I need to combine two forms into a single form
I want to store user profile info and user details. 
i created a signup page so that's why i needed to combine both user and 
profile form

-- 
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/9b90171c-a7e2-4825-b063-88d990ddb44e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


typeerror : context must be a dict rather than Context.

2017-12-12 Thread Al Scham
Hi,

I'm am new to django and am workng through the OverIQ tutoiral at 
: https://overiq.com/django/1.10/loading-templates-in-django

I have followed the instructions to the letter but am getting the typeerror 
every time (see subject).

Heres is my views.py

from django.shortcuts import render
from django.http import HttpResponse
from django import template
import datetime

def index(request):
return HttpResponse("Hello Django")

def today_is(request):
now = datetime.datetime.now()
t = template.loader.get_template('blog/datetime.html')
c = template.Context({'now': now})
html = t.render(c)
return HttpResponse(html)

*and here is my template:*






Current Time



{#This is a comment #}
{check the existence of now variable in the template using if tag #}
{% if now %}
Current date and time is {{ now }}
{% else %}
now variable is not available
{% endif %}




*Any help would be aprreciated.*

*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/bfcbafcb-c748-4a7b-8594-eb22e701b256%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: typeerror : context must be a dict rather than Context.

2017-12-12 Thread pradam programmer
c = template.Context({'now': now})
html = t.render(c) # Just pass {'now': now} instead of c

On Tue, Dec 12, 2017 at 5:08 PM, Al Scham  wrote:

> Hi,
>
> I'm am new to django and am workng through the OverIQ tutoiral at :
> https://overiq.com/django/1.10/loading-templates-in-django
>
> I have followed the instructions to the letter but am getting the
> typeerror every time (see subject).
>
> Heres is my views.py
>
> from django.shortcuts import render
> from django.http import HttpResponse
> from django import template
> import datetime
>
> def index(request):
> return HttpResponse("Hello Django")
>
> def today_is(request):
> now = datetime.datetime.now()
> t = template.loader.get_template('blog/datetime.html')
> c = template.Context({'now': now})
> html = t.render(c)
> return HttpResponse(html)
>
> *and here is my template:*
>
>
> 
> 
> 
> 
> Current Time
> 
> 
>
> {#This is a comment #}
> {check the existence of now variable in the template using if tag #}
> {% if now %}
> Current date and time is {{ now }}
> {% else %}
> now variable is not available
> {% endif %}
>
> 
> 
>
> *Any help would be aprreciated.*
>
> *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/bfcbafcb-c748-4a7b-8594-eb22e701b256%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/CAGGVXBPgKDBfDtKSVSxvn9pkWBeK-m2%2BeO4PGHAeSkBdEPqm_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: unable to combine two forms in a single form

2017-12-12 Thread Jani Tiainen

Hi,

There is a really simple solution:

http://musings.tinbrain.net/blog/2015/jun/10/updating-two-models-single-post/


On 12.12.2017 9.46, nishant sharma wrote:

I need to combine two forms into a single form
I want to store user profile info and user details.
i created a signup page so that's why i needed to combine both user 
and profile form

--
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/9b90171c-a7e2-4825-b063-88d990ddb44e%40googlegroups.com 
.

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


--
Jani Tiainen

--
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/faffc59f-66c6-84a4-5ea9-b05858e81a9b%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [OT] Is Trump planning to break the Internet?

2017-12-12 Thread mccc
I agree with Matthew's sentiment;

also, I'd like to point out that the words you (Larry) posted are not your 
own but are literally coming off of foxnews.com 

 (found 
also on telecoms.com 
,
 
by means of a "feature article" from a not-so-trustworthy consultancy 
group).
I do agree that the topic and the approach to the issue are not adequate 
for the group, but your (Larry's) attempt to "gain the high ground" fell 
_very_ short.

All the best,
Michele

On Monday, December 11, 2017 at 3:52:51 PM UTC+1, larry@gmail.com wrote:
>
> On Mon, Dec 11, 2017 at 9:24 AM, Matthew Pava  > wrote: 
> >>> Please keep your political rhetoric and irresponsible scaremongering 
> off this list. 
> > 
> >>> All the net neutrality repeal will do is restore some of the 
> permissionless innovation that allowed the internet to blossom in the first 
> place. 
> > 
> > Dear Larry, 
> > Please read what you just wrote.  On the one hand, you asked Etienne not 
> to share political rhetoric, and then you called Etienne's act one of 
> irresponsible scaremongering.  And then you had to have the last word in 
> this discussion by sharing your own political rhetoric about the topic. 
>  That's not right, and I'm not going to sit by and let that happen. 
> > 
> > The better way to handle it would have been a personal message to 
> Etienne asking that user not to post political rhetoric (in a nicer way 
> than you just did) and not make that message public. 
> > 
> > So here's an article about Net Neutrality: 
> > https://www.savetheinternet.com/net-neutrality-what-you-need-know-now 
>
> That article is from freepress.net, a very far left, statist group, 
> that feels the government should regulate, control and tax every 
> aspect of your lives. We do not need more government regulation, we 
> need less. A free market is always better. Net Neutrality is 
> censorship, and it's crony capitalism. 
>

-- 
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/80893af4-a5a6-494a-9829-5975ed48d7c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [OT] Is Trump planning to break the Internet?

2017-12-12 Thread Larry Martell
I did not read what I wrote on neither foxnews.com nor on telecoms.com
(the latter site I have never even heard of).

On Tue, Dec 12, 2017 at 8:14 AM, mccc  wrote:
> I agree with Matthew's sentiment;
>
> also, I'd like to point out that the words you (Larry) posted are not your
> own but are literally coming off of foxnews.com (found also on telecoms.com,
> by means of a "feature article" from a not-so-trustworthy consultancy
> group).
> I do agree that the topic and the approach to the issue are not adequate for
> the group, but your (Larry's) attempt to "gain the high ground" fell _very_
> short.
>
> All the best,
> Michele
>
> On Monday, December 11, 2017 at 3:52:51 PM UTC+1, larry@gmail.com wrote:
>>
>> On Mon, Dec 11, 2017 at 9:24 AM, Matthew Pava  wrote:
>> >>> Please keep your political rhetoric and irresponsible scaremongering
>> >>> off this list.
>> >
>> >>> All the net neutrality repeal will do is restore some of the
>> >>> permissionless innovation that allowed the internet to blossom in the 
>> >>> first
>> >>> place.
>> >
>> > Dear Larry,
>> > Please read what you just wrote.  On the one hand, you asked Etienne not
>> > to share political rhetoric, and then you called Etienne's act one of
>> > irresponsible scaremongering.  And then you had to have the last word in
>> > this discussion by sharing your own political rhetoric about the topic.
>> > That's not right, and I'm not going to sit by and let that happen.
>> >
>> > The better way to handle it would have been a personal message to
>> > Etienne asking that user not to post political rhetoric (in a nicer way 
>> > than
>> > you just did) and not make that message public.
>> >
>> > So here's an article about Net Neutrality:
>> > https://www.savetheinternet.com/net-neutrality-what-you-need-know-now
>>
>> That article is from freepress.net, a very far left, statist group,
>> that feels the government should regulate, control and tax every
>> aspect of your lives. We do not need more government regulation, we
>> need less. A free market is always better. Net Neutrality is
>> censorship, and it's crony capitalism.

-- 
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/CACwCsY6tFqn_EQX%2Bcbyh%3DuvzEofYmXFGQ7M%2ByFVNXOdyvDZEjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


What would be the best approach to implementing a paywall?

2017-12-12 Thread Roy Shillingburg
Should I simply add a flag on each user model to check if subscribed and 
restrict access to certain views/apps?

A middleware approach?


-- 
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/f8450f67-3d32-4fc8-a630-8f9d648a4c56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [OT] Is Trump planning to break the Internet?

2017-12-12 Thread Jason
Larry, you're undermining your own position of keeping politics off this 
list.  If you disagree, fine.  But assuming its fine for you to spout your 
own political beliefs while claiming everything else doesn't belong here 
doesn't pass the smell test.

-- 
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/e881d786-67e9-4ff3-af20-27ab192333f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What would be the best approach to implementing a paywall?

2017-12-12 Thread Egor Smolyakov
You can extend your User's model with a new option like
"is_subscribed" and check it via middleware or your mixin.


On 12/12/2017, Roy Shillingburg  wrote:
> Should I simply add a flag on each user model to check if subscribed and
> restrict access to certain views/apps?
>
> A middleware approach?
>
>
> --
> 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/f8450f67-3d32-4fc8-a630-8f9d648a4c56%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Kind Regards, Egor Smolyakov.

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


Re: Please explain "TypeError: handle_404() got an unexpected keyword argument 'exception'"

2017-12-12 Thread Chris Seberino

>
>
>>
>> Please explain "TypeError: handle_404() got an unexpected keyword 
>> argument 'exception'"
>>
>
> It means literally that "handle_404() got an unexpected keyword argument 
> 'exception'", how are you calling handle_404()?
>
>
Thanks for your help.  In my urls.py I have this...

django.conf.urls.handler404 = "main.controllers.controllers.handle_404"

I believe that invokes the handle_404 function in the 
main/controllers/controllers.py file?

cs 

-- 
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/4b16d282-9310-48bb-9195-03ae1b00cbd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Channels alongside Django Rest Framework

2017-12-12 Thread Alexandre Verri
Hi Adam, 

are you using Django REST Framework? 

I was using it, but after introducing Django Channels the REST endpoints 
stopped to work. 

Regards,
Alexandre

Em sexta-feira, 3 de fevereiro de 2017 15:07:18 UTC, 
adam@hedgehoglab.com escreveu:
>
> Hi Andrew,
>
> Thanks for the reply.
>
> I've managed to get it working running Daphne serving both HTTP and 
> WebSocket requests. Your reply prompted me to look into what I was 
> currently doing, and it crossed my mind that I was running via Gunicorn 
> which from now reading the deployment documentation for Django Channels 
> states WebSockets won't work via Gunicorn. 
>
> I'm now running it via a systemctl script using -
>
> ExecStart=/var/www/myproject/env/bin/daphne -b 0.0.0.0 -p 8000 -u 
> /tmp/myproject.sock myproject.asgi:channel_layer
> ExecStartPost=/var/www/myproject/env/bin/python3 manage.py runworker
>
> This is then reverse proxied through nginx.
>
> Hopefully this is the best way to go about it when running inside of a 
> systemctl service, although I couldn't find any documentation on this so I 
> adapted how tutorials / examples use a systemctl service for Django with 
> Gunicorn.
>
> Thanks for the prompt response and appreciate the work done for Django!
>
> Adam
>
> On Tuesday, 31 January 2017 12:09:17 UTC, adam@hedgehoglab.com wrote:
>>
>> Hi everyone,
>>
>> We are currently considering using Django Channels for implementing 
>> WebSockets into a project. I am wondering if it is known that Django 
>> Channels runs perfectly within the same Django project as DRF? 
>>
>> I have spent a little time investigating this myself and could manage to 
>> get DRF working on its own, but channels not working, and channels working 
>> on its own but not DRF (in the same project), depending on whether I ran 
>> the daphne server or 'runserver' which I assume runs WSGI. Couldn't find 
>> anything online about getting these two side by side.
>>
>> Thanks,
>> Adam
>>
>> ==
>>
>> hedgehog lab is a limited company registered in England and Wales. 
>> Registered number: 05993194. Registered office: Generator Studios, 
>> Trafalgar Street, Newcastle Upon Tyne, NE1 2LA
>>
>>

-- 
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/353a6e14-536c-4480-82c7-39a23e7a9180%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


nginx error in Digital Ocean

2017-12-12 Thread Coqui
I am trying to deploy to digital ocean but when I run 

sudo nginx -t

I get : nginx: [emerg] open() "... /logs/nginx-access.log" failed (2: No 
such file or directory)

-- 
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/48496a0d-60c8-41f1-8721-4b379bf47d92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: context must be a dict rather than Context.

2017-12-12 Thread Constantine Covtushenko
Hi Al,

I believe that an error you mentioned is thrown from line:

html = t.render(c)

As said in the error: context must be a dict
So just change

c = template.Context({'now': now})
to be
c = {'now': now}

For more information please check that documentation page


I hope that makes sense.

Regards,
Constantine C.

On Tue, Dec 12, 2017 at 6:25 AM, Al Scham  wrote:

> *Hi,*
>
> *Im a new user going through this tutorial at OverIQ
> : https://overiq.com/django/1.10/loading-templates-in-django
> *
>
> *I've followed the instructions to the letter but it keep throwing the
> Typeerror you see in the subject.*
>
> *Here is a copy paist of my views :*
>
> from django.shortcuts import render
> from django.http import HttpResponse
> from django import template
> import datetime
>
> def index(request):
> return HttpResponse("Hello Django")
>
> def today_is(request):
> now = datetime.datetime.now()
> t = template.loader.get_template('blog/datetime.html')
> c = template.Context({'now': now})
> html = t.render(c)
> return HttpResponse(html)
>
> *and here is a copy paist of my template:*
>
> 
> 
> 
> 
> Current Time
> 
> 
>
> {#This is a comment #}
> {check the existence of now variable in the template using if tag #}
> {% if now %}
> Current date and time is {{ now }}
> {% else %}
> now variable is not available
> {% endif %}
>
> 
> 
>
> *Any help would be greatly appreciated.*
>
> *Thanks*
> *Allon*
>
>
> --
> 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/67a732ee-ba22-4386-9241-1bd6c362885d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Sincerely yours,
Constantine C

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


Channels: starting Daphne in production

2017-12-12 Thread Filbert
Trying to come up with the proper command line to start Daphne in 
production.  It seems when I start, it heads off into a repeated processing 
loop, my thought is that it should just be pending on a websocket 
connection. Using asgi_rabbitmq.

daphne -u /opt/daphne.sock  --ws-protocol "graphql-ws" --proxy-headers -v 2 
asgi:channel_layer

Seems to be repeated logging:

Calling (
'127.0.0.1', 5672) params=>>> for "2:Queue.DeclareOk"
0 blocked frames
Calling functools.partial(>, {
'daphne.response.yLFVcixMCk!'}, set(), ['daphne.response.yLFVcixMCk!'], 
False) for "2:Queue.DeclareOk"
Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': functools.
partial(>, []), 'one_shot': True}
Processing 2:Basic.GetEmpty
Processing use of oneshot callback
0 registered uses left


Any debugging ideas?

Entering IOLoop
Connecting to 127.0.0.1:5672
Processing 0:Connection.Start
Processing use of oneshot callback
0 registered uses left
Removing callback #0: {'arguments': None, 'only': None, 'calls': 0, 
'callback': ('127.0.0.1', 5672) 
params=>>, 
'one_shot': True}
Calling ('127.0.0.1', 5672) 
params=>> 
for "0:Connection.Start"
Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': ('127.0.0.1', 5672) params=>>, 'one_shot': True}
Processing 0:Connection.Tune
Processing use of oneshot callback
0 registered uses left
Removing callback #0: {'arguments': None, 'only': None, 'calls': 0, 
'callback': ('127.0.0.1', 5672) 
params=>>, 
'one_shot': True}
Calling ('127.0.0.1', 5672) 
params=>> 
for "0:Connection.Tune"
Creating a HeartbeatChecker: 600
add_timeout: added timeout -1786684229378238513; deadline=600 at 
1513095706.3193622
Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': ('127.0.0.1', 5672) params=>>, 'one_shot': True}
Processing 0:Connection.OpenOk
Processing use of oneshot callback
0 registered uses left
Removing callback #0: {'arguments': None, 'only': None, 'calls': 0, 
'callback': ('127.0.0.1', 5672) 
params=>>, 
'one_shot': True}
Calling ('127.0.0.1', 5672) params
=>> for 
"0:Connection.OpenOk"
Processing 0:_on_connection_open
Calling > for 
"0:_on_connection_open"
Added: {'arguments': None, 'only': ('127.0.0.1', 5672) 
params=>>, 
'calls': 1, 'callback': ('127.0.0.1', 5672) 
params=>>, 
'one_shot': True}
Added: {'arguments': None, 'only': None, 'callback': ('127.0.0.1', 5672) 
params=>>>, 
'one_shot': False}
Added: {'arguments': None, 'only': None, 'callback': ('127.0.0.1', 5672) params
=>>>, 
'one_shot': False}
Added: {'arguments': None, 'only': None, 'callback': ('127.0.0.1', 5672) 
params=>>>, 
'one_shot': False}
Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': ('127.0.0.1', 5672) params
=>>>, 
'one_shot': True}
Entering blocking state on frame ; 
acceptable_replies=[]
Adding on_synchronous_complete callback
Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': ('127.0.0.1', 5672) params=>>>, 'one_shot': True}
Adding passed-in callback
Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': ('127.0.0.1', 5672) params
=>>>, 
'one_shot': True}
Added: {'arguments': None, 'only': ('127.0.0.1', 5672) 
params=>>, 
'calls': 1, 'callback': ('127.0.0.1', 5672) 
params=>>, 
'one_shot': True}
Added: {'arguments': None, 'only': None, 'callback': ('127.0.0.1', 5672) 
params=>>>, 
'one_shot': False}
Added: {'arguments': None, 'only': None, 'callback': ('127.0.0.1', 5672) params
=>>>, 
'one_shot': False}
Added: {'arguments': None, 'only': None, 'callback': ('127.0.0.1', 5672) 
params=>>>, 
'one_shot': False}
Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': ('127.0.0.1', 5672) params
=>>>, 
'one_shot': True}
Entering blocking state on frame ; 
acceptable_replies=[]
Adding on_synchronous_complete callback
Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': ('127.0.0.1', 5672) params=>>>, 'one_shot': True}
Adding passed-in callback
Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': ('127.0.0.1', 5672) params
=>>>, 
'one_shot': True}
Processing 1:Channel.OpenOk
Processing use of oneshot callback
0 registered uses left
Removing callback #0: {'arguments': None, 'only': None, 'calls': 0, 
'callback': ('127.0.0.1', 5672) params=>>>, 'one_shot': True}
Processing use of oneshot callback
0 registered uses left
Removing callback #0: {'arguments': None, 'only': None, 'calls': 0, 
'callback': ('127.0.0.1', 5672) params=>>>, 'one_shot': True}
Calling (
'127.0.0.1', 5672) params=>>> for "1:Channel.OpenOk"
0 blocked frames
Calling ('127.0.0.1', 5672) params=>>> for "1:Channel.OpenOk"
Entering blocking state on frame ; acceptable_replies=[]
Adding on_synchronous_complete callback
Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': ('127.0.0.1', 5672) 
params=>>>, 
'one_shot': True}

-- 
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 th

Re: Channels: starting Daphne in production

2017-12-12 Thread Andrew Godwin
Hm, that looks to be like logging from asgi_rabbitmq - could you post your
settings configuration? And have you tried running with a different channel
layer?

Andrew

On Tue, Dec 12, 2017 at 10:14 AM, Filbert  wrote:

> Trying to come up with the proper command line to start Daphne in
> production.  It seems when I start, it heads off into a repeated processing
> loop, my thought is that it should just be pending on a websocket
> connection. Using asgi_rabbitmq.
>
> daphne -u /opt/daphne.sock  --ws-protocol "graphql-ws" --proxy-headers -v
> 2 asgi:channel_layer
>
> Seems to be repeated logging:
>
> Calling  LayerChannel number=2 OPEN conn= 34690)->('127.0.0.1', 5672) params= virtual_host=/ ssl=False for "2:Queue.DeclareOk"
> 0 blocked frames
> Calling functools.partial( asgi_rabbitmq.core.Protocol object at 0x7f1cd01f6a20>>, {
> 'daphne.response.yLFVcixMCk!'}, set(), ['daphne.response.yLFVcixMCk!'],
> False) for "2:Queue.DeclareOk"
> Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': functools
> .partial( object at 0x7f1cd01f6a20>>, []), 'one_shot': True}
> Processing 2:Basic.GetEmpty
> Processing use of oneshot callback
> 0 registered uses left
>
>
> Any debugging ideas?
>
> Entering IOLoop
> Connecting to 127.0.0.1:5672
> Processing 0:Connection.Start
> Processing use of oneshot callback
> 0 registered uses left
> Removing callback #0: {'arguments': None, 'only': None, 'calls': 0,
> 'callback':  ('127.0.0.1', 5672)
> params=>>,
> 'one_shot': True}
> Calling  LayerConnection PROTOCOL socket=('127.0.0.1', 34690)->('127.0.0.1', 5672)
> params=>>
> for "0:Connection.Start"
> Added: {'arguments': None, 'only': None, 'calls': 1, 'callback':  method LayerConnection._on_connection_tune of  socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) params= host=rabbitmq port=5672 virtual_host=/ ssl=False>>>, 'one_shot': True}
> Processing 0:Connection.Tune
> Processing use of oneshot callback
> 0 registered uses left
> Removing callback #0: {'arguments': None, 'only': None, 'calls': 0,
> 'callback':  ('127.0.0.1', 5672)
> params=>>,
> 'one_shot': True}
> Calling  LayerConnection START socket=('127.0.0.1', 34690)->('127.0.0.1', 5672)
> params=>>
> for "0:Connection.Tune"
> Creating a HeartbeatChecker: 600
> add_timeout: added timeout -1786684229378238513; deadline=600 at
> 1513095706.3193622
> Added: {'arguments': None, 'only': None, 'calls': 1, 'callback':  method LayerConnection._on_connection_open of  socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) params= host=rabbitmq port=5672 virtual_host=/ ssl=False>>>, 'one_shot': True}
> Processing 0:Connection.OpenOk
> Processing use of oneshot callback
> 0 registered uses left
> Removing callback #0: {'arguments': None, 'only': None, 'calls': 0,
> 'callback':  ('127.0.0.1', 5672)
> params=>>,
> 'one_shot': True}
> Calling  LayerConnection TUNE socket=('127.0.0.1', 34690)->('127.0.0.1', 5672)
> params=>>
> for "0:Connection.OpenOk"
> Processing 0:_on_connection_open
> Calling   object at 0x7f1cbcf349b0>> for "0:_on_connection_open"
> Added: {'arguments': None, 'only':  conn=('127.0.0.1', 5672)
> params=>>,
> 'calls': 1, 'callback':  of ('127.0.0.1', 5672)
> params= ssl=False>>>, 'one_shot': True}
> Added: {'arguments': None, 'only': None, 'callback':  LayerChannel._on_getempty of  conn=('127.0.0.1', 5672)
> params= , 'one_shot': False}
> Added: {'arguments': None, 'only': None, 'callback':  LayerChannel._on_cancel of  LayerConnection OPEN socket=('127.0.0.1', 34690)->('127.0.0.1', 5672)
> params= ssl=False, 'one_shot': False}
> Added: {'arguments': None, 'only': None, 'callback':  LayerChannel._on_flow of  conn=('127.0.0.1', 5672)
> params= , 'one_shot': False}
> Added: {'arguments': None, 'only': None, 'calls': 1, 'callback':  method LayerChannel._on_close of  LayerConnection OPEN socket=('127.0.0.1', 34690)->('127.0.0.1', 5672)
> params= ssl=False, 'one_shot': True}
> Entering blocking state on frame ;
> acceptable_replies=[]
> Adding on_synchronous_complete callback
> Added: {'arguments': None, 'only': None, 'calls': 1, 'callback':  method LayerChannel._on_synchronous_complete of  OPENING conn= 34690)->('127.0.0.1', 5672) params= virtual_host=/ ssl=False, 'one_shot': True}
> Adding passed-in callback
> Added: {'arguments': None, 'only': None, 'calls': 1, 'callback':  method LayerChannel._on_openok of  LayerConnection OPEN socket=('127.0.0.1', 34690)->('127.0.0.1', 5672)
> params= ssl=False, 'one_shot': True}
> Added: {'arguments': None, 'only':  conn=('127.0.0.1', 5672)
> params=>>,
> 'calls': 1, 'callback':  of ('127.0.0.1', 5672)
> params= ssl=False>>>, 'one_shot': True}
> Added: {'arguments': None, 'only': None, 'callback':  LayerChannel._on_getempty of  conn=('127.0.0.1', 5672)
> params= , 'one_shot': False}
> Added: {'arguments': None, 'only': None, 'callback':  LayerChannel._on_cancel of  LayerConnection OPEN socket=('127.0.0.1', 34690)->('127.0.0.1', 5672)
> params= ssl=False, 'one_shot': False}
> Added: {'arguments': N

Re: nginx error in Digital Ocean

2017-12-12 Thread Etienne Robillard

Hi,

Have you tried to compile nginx from source and specify the log 
directory with --http-log-path=/var/log/nginx/access.log ?


Etienne


Le 2017-12-12 à 10:17, Coqui a écrit :

I am trying to deploy to digital ocean but when I run

sudo nginx -t

I get : nginx: [emerg] open() "... /logs/nginx-access.log" failed (2: 
No such file or directory)


--
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/48496a0d-60c8-41f1-8721-4b379bf47d92%40googlegroups.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 
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/f3e7b06a-e3e0-630a-f128-69af566fc88c%40yandex.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels: starting Daphne in production

2017-12-12 Thread Filbert
Yes, using rabbit...

CHANNEL_LAYERS = {
'default': {
'BACKEND': 'asgi_rabbitmq.RabbitmqChannelLayer',
'ROUTING': 'toogo.routing.channel_routing',
'CONFIG': {
'url': 'amqp://foo:bar@{0}:5672/%2F'.format(RABBITMQ_NODE),
},
},
}



This of course works fine (but we are clustering web servers):
 
   CHANNEL_LAYERS = {
"default": {
"BACKEND": "asgiref.inmemory.ChannelLayer",
"ROUTING": "toogo.routing.channel_routing",
},
}


On Tuesday, December 12, 2017 at 1:33:55 PM UTC-5, Andrew Godwin wrote:
>
> Hm, that looks to be like logging from asgi_rabbitmq - could you post your 
> settings configuration? And have you tried running with a different channel 
> layer?
>
> Andrew
>
> On Tue, Dec 12, 2017 at 10:14 AM, Filbert > 
> wrote:
>
>> Trying to come up with the proper command line to start Daphne in 
>> production.  It seems when I start, it heads off into a repeated processing 
>> loop, my thought is that it should just be pending on a websocket 
>> connection. Using asgi_rabbitmq.
>>
>> daphne -u /opt/daphne.sock  --ws-protocol "graphql-ws" --proxy-headers -v 
>> 2 asgi:channel_layer
>>
>> Seems to be repeated logging:
>>
>> Calling > LayerChannel number=2 OPEN conn=> , 34690)->('127.0.0.1', 5672) params=> 5672 virtual_host=/ ssl=False for "2:Queue.DeclareOk"
>> 0 blocked frames
>> Calling functools.partial(> asgi_rabbitmq.core.Protocol object at 0x7f1cd01f6a20>>, {
>> 'daphne.response.yLFVcixMCk!'}, set(), ['daphne.response.yLFVcixMCk!'], 
>> False) for "2:Queue.DeclareOk"
>> Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': 
>> functools.partial(> core.Protocol object at 0x7f1cd01f6a20>>, []), 'one_shot': True}
>> Processing 2:Basic.GetEmpty
>> Processing use of oneshot callback
>> 0 registered uses left
>>
>>
>> Any debugging ideas?
>>
>> Entering IOLoop
>> Connecting to 127.0.0.1:5672
>> Processing 0:Connection.Start
>> Processing use of oneshot callback
>> 0 registered uses left
>> Removing callback #0: {'arguments': None, 'only': None, 'calls': 0, 
>> 'callback': > ('127.0.0.1', 5672) 
>> params=>>, 
>> 'one_shot': True}
>> Calling > LayerConnection PROTOCOL socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) 
>> params=> ssl=False>>> for "0:Connection.Start"
>> Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': > method LayerConnection._on_connection_tune of > socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) params=> host=rabbitmq port=5672 virtual_host=/ ssl=False>>>, 'one_shot': True}
>> Processing 0:Connection.Tune
>> Processing use of oneshot callback
>> 0 registered uses left
>> Removing callback #0: {'arguments': None, 'only': None, 'calls': 0, 
>> 'callback': > ('127.0.0.1', 5672) 
>> params=>>, 
>> 'one_shot': True}
>> Calling > LayerConnection START socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) 
>> params=> ssl=False>>> for "0:Connection.Tune"
>> Creating a HeartbeatChecker: 600
>> add_timeout: added timeout -1786684229378238513; deadline=600 at 
>> 1513095706.3193622
>> Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': > method LayerConnection._on_connection_open of > socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) params=> host=rabbitmq port=5672 virtual_host=/ ssl=False>>>, 'one_shot': True}
>> Processing 0:Connection.OpenOk
>> Processing use of oneshot callback
>> 0 registered uses left
>> Removing callback #0: {'arguments': None, 'only': None, 'calls': 0, 
>> 'callback': > ('127.0.0.1', 5672) 
>> params=>>, 
>> 'one_shot': True}
>> Calling > LayerConnection TUNE socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) 
>> params=> ssl=False>>> for "0:Connection.OpenOk"
>> Processing 0:_on_connection_open
>> Calling > > for 
>> "0:_on_connection_open"
>> Added: {'arguments': None, 'only': > conn=('127.0.0.1', 5672) 
>> params=> >>>, 'calls': 1, 'callback': > >>>LayerConnection._on_channel_cleanup 
>> of ('127.0.0.1', 5672) 
>> params=> ssl=False>>>, 'one_shot': True}
>> Added: {'arguments': None, 'only': None, 'callback': > LayerChannel._on_getempty of > conn=('127.0.0.1', 5672) 
>> params=> , 'one_shot': False}
>> Added: {'arguments': None, 'only': None, 'callback': > LayerChannel._on_cancel of > LayerConnection OPEN socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) 
>> params=> ssl=False, 'one_shot': False}
>> Added: {'arguments': None, 'only': None, 'callback': > LayerChannel._on_flow of > conn=('127.0.0.1', 5672) 
>> params=> , 'one_shot': False}
>> Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': > method LayerChannel._on_close of > LayerConnection OPEN socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) 
>> params=> ssl=False, 'one_shot': True}
>> Entering blocking state on frame ; 
>> acceptable_replies=[]
>> Adding on_synchronous_complete callback
>> Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': > method LayerChannel._on_synchronous_complete of > OPENING conn=> 34690)->('127.0.0.1', 5672) params=> virt

Re: [OT] Is Trump planning to break the Internet?

2017-12-12 Thread Mike Morris

May I suggest:

http://www.politicalforum.com/index.php

Would *insist* help??? 



On 12/12/2017 05:14 AM, mccc wrote:

I agree with Matthew's sentiment;

also, I'd like to point out that the words you (Larry) posted are not 
your own but are literally coming off of foxnews.com 
 (found 
also on telecoms.com 
, 
by means of a "feature article" from a not-so-trustworthy consultancy 
group).
I do agree that the topic and the approach to the issue are not 
adequate for the group, but your (Larry's) attempt to "gain the high 
ground" fell _very_ short.


All the best,
Michele

On Monday, December 11, 2017 at 3:52:51 PM UTC+1, larry@gmail.com 
wrote:


On Mon, Dec 11, 2017 at 9:24 AM, Matthew Pava > wrote:
>>> Please keep your political rhetoric and irresponsible
scaremongering off this list.
>
>>> All the net neutrality repeal will do is restore some of the
permissionless innovation that allowed the internet to blossom in
the first place.
>
> Dear Larry,
> Please read what you just wrote.  On the one hand, you asked
Etienne not to share political rhetoric, and then you called
Etienne's act one of irresponsible scaremongering.  And then you
had to have the last word in this discussion by sharing your own
political rhetoric about the topic.  That's not right, and I'm not
going to sit by and let that happen.
>
> The better way to handle it would have been a personal message
to Etienne asking that user not to post political rhetoric (in a
nicer way than you just did) and not make that message public.
>
> So here's an article about Net Neutrality:
>
https://www.savetheinternet.com/net-neutrality-what-you-need-know-now



That article is from freepress.net , a very
far left, statist group,
that feels the government should regulate, control and tax every
aspect of your lives. We do not need more government regulation, we
need less. A free market is always better. Net Neutrality is
censorship, and it's crony capitalism.

--
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/80893af4-a5a6-494a-9829-5975ed48d7c9%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/30585bca-5d1e-d1fa-68a9-d0a752fc2ad5%40musicplace.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels: starting Daphne in production

2017-12-12 Thread Filbert
Also, curiously, when I use Inmemory, it seems to connect and immediately 
disconnect. Hopefully my Nginx conf makes sense.

location /ws {
proxy_pass http://unix:/tmp/daphne.ws;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}


On Tuesday, December 12, 2017 at 2:01:18 PM UTC-5, Filbert wrote:
>
> Yes, using rabbit...
>
> CHANNEL_LAYERS = {
> 'default': {
> 'BACKEND': 'asgi_rabbitmq.RabbitmqChannelLayer',
> 'ROUTING': 'toogo.routing.channel_routing',
> 'CONFIG': {
> 'url': 'amqp://foo:bar@{0}:5672/%2F'.format(RABBITMQ_NODE),
> },
> },
> }
>
>
>
> This of course works fine (but we are clustering web servers):
>  
>CHANNEL_LAYERS = {
> "default": {
> "BACKEND": "asgiref.inmemory.ChannelLayer",
> "ROUTING": "toogo.routing.channel_routing",
> },
> }
>
>
> On Tuesday, December 12, 2017 at 1:33:55 PM UTC-5, Andrew Godwin wrote:
>>
>> Hm, that looks to be like logging from asgi_rabbitmq - could you post 
>> your settings configuration? And have you tried running with a different 
>> channel layer?
>>
>> Andrew
>>
>> On Tue, Dec 12, 2017 at 10:14 AM, Filbert  wrote:
>>
>>> Trying to come up with the proper command line to start Daphne in 
>>> production.  It seems when I start, it heads off into a repeated processing 
>>> loop, my thought is that it should just be pending on a websocket 
>>> connection. Using asgi_rabbitmq.
>>>
>>> daphne -u /opt/daphne.sock  --ws-protocol "graphql-ws" --proxy-headers 
>>> -v 2 asgi:channel_layer
>>>
>>> Seems to be repeated logging:
>>>
>>> Calling >> LayerChannel number=2 OPEN conn=>> '127.0.0.1', 34690)->('127.0.0.1', 5672) params=>> host=rabbitmq 
>>> port=5672 virtual_host=/ ssl=False for "2:Queue.DeclareOk"
>>> 0 blocked frames
>>> Calling functools.partial(>> asgi_rabbitmq.core.Protocol object at 0x7f1cd01f6a20>>, {
>>> 'daphne.response.yLFVcixMCk!'}, set(), ['daphne.response.yLFVcixMCk!'], 
>>> False) for "2:Queue.DeclareOk"
>>> Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': 
>>> functools.partial(>> core.Protocol object at 0x7f1cd01f6a20>>, []), 'one_shot': True}
>>> Processing 2:Basic.GetEmpty
>>> Processing use of oneshot callback
>>> 0 registered uses left
>>>
>>>
>>> Any debugging ideas?
>>>
>>> Entering IOLoop
>>> Connecting to 127.0.0.1:5672
>>> Processing 0:Connection.Start
>>> Processing use of oneshot callback
>>> 0 registered uses left
>>> Removing callback #0: {'arguments': None, 'only': None, 'calls': 0, 
>>> 'callback': >> ('127.0.0.1', 5672) 
>>> params=>>, 
>>> 'one_shot': True}
>>> Calling >> LayerConnection PROTOCOL socket=('127.0.0.1', 34690)->('127.0.0.1', 5672
>>> ) params=>> ssl=False>>> for "0:Connection.Start"
>>> Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': >> method LayerConnection._on_connection_tune of >> socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) params=>> host=rabbitmq port=5672 virtual_host=/ ssl=False>>>, 'one_shot': True}
>>> Processing 0:Connection.Tune
>>> Processing use of oneshot callback
>>> 0 registered uses left
>>> Removing callback #0: {'arguments': None, 'only': None, 'calls': 0, 
>>> 'callback': >> ('127.0.0.1', 5672) 
>>> params=>>, 
>>> 'one_shot': True}
>>> Calling >> LayerConnection START socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) 
>>> params=>> ssl=False>>> for "0:Connection.Tune"
>>> Creating a HeartbeatChecker: 600
>>> add_timeout: added timeout -1786684229378238513; deadline=600 at 
>>> 1513095706.3193622
>>> Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': >> method LayerConnection._on_connection_open of >> socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) params=>> host=rabbitmq port=5672 virtual_host=/ ssl=False>>>, 'one_shot': True}
>>> Processing 0:Connection.OpenOk
>>> Processing use of oneshot callback
>>> 0 registered uses left
>>> Removing callback #0: {'arguments': None, 'only': None, 'calls': 0, 
>>> 'callback': >> ('127.0.0.1', 5672) 
>>> params=>>, 
>>> 'one_shot': True}
>>> Calling >> LayerConnection TUNE socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) 
>>> params=>> ssl=False>>> for "0:Connection.OpenOk"
>>> Processing 0:_on_connection_open
>>> Calling >> > for 
>>> "0:_on_connection_open"
>>> Added: {'arguments': None, 'only': >> conn=('127.0.0.1', 5672) 
>>> params=>> >>>, 'calls': 1, 'callback': >> >>>LayerConnection._on_channel_cleanup 
>>> of ('127.0.0.1', 5672
>>> ) params=>> ssl=False>>>, 'one_shot': True}
>>> Added: {'arguments': None, 'only': None, 'callback': >> LayerChannel._on_getempty of >> conn=('127.0.0.1', 5672) 
>>> params=>> , 'one_shot': False}
>>> Added: {'arguments': None, 'only': None, 'callback': >> LayerChannel._on_cancel of >> LayerConnection OPEN socket=('127.0.0.1

Re: Channels: starting Daphne in production

2017-12-12 Thread Filbert
More specifically, it is logging:

None - - [12/Dec/2017:20:*06:39*] "WSCONNECTING /ws/" - -
DEBUG Upgraded connection daphne.response.HKlOHkryrd!VaSFKIooRZ to 
WebSocket daphne.response.HKlOHkryrd!XdRRyyAyVn
DEBUG WebSocket closed for daphne.response.HKlOHkryrd!XdRRyyAyVn
None - - [12/Dec/2017:20:*06:43*] "WSDISCONNECT /ws/" - -



On Tuesday, December 12, 2017 at 2:11:44 PM UTC-5, Filbert wrote:
>
> Also, curiously, when I use Inmemory, it seems to connect and immediately 
> disconnect. Hopefully my Nginx conf makes sense.
>
> location /ws {
> proxy_pass http://unix:/tmp/daphne.ws;
> proxy_set_header Upgrade $http_upgrade;
> proxy_set_header Connection "upgrade";
> proxy_http_version 1.1;
> proxy_set_header X-Forwarded-For 
> $proxy_add_x_forwarded_for;
> proxy_set_header Host $host;
> }
>
>
> On Tuesday, December 12, 2017 at 2:01:18 PM UTC-5, Filbert wrote:
>>
>> Yes, using rabbit...
>>
>> CHANNEL_LAYERS = {
>> 'default': {
>> 'BACKEND': 'asgi_rabbitmq.RabbitmqChannelLayer',
>> 'ROUTING': 'toogo.routing.channel_routing',
>> 'CONFIG': {
>> 'url': 'amqp://foo:bar@{0}:5672/%2F'.format(RABBITMQ_NODE),
>> },
>> },
>> }
>>
>>
>>
>> This of course works fine (but we are clustering web servers):
>>  
>>CHANNEL_LAYERS = {
>> "default": {
>> "BACKEND": "asgiref.inmemory.ChannelLayer",
>> "ROUTING": "toogo.routing.channel_routing",
>> },
>> }
>>
>>
>> On Tuesday, December 12, 2017 at 1:33:55 PM UTC-5, Andrew Godwin wrote:
>>>
>>> Hm, that looks to be like logging from asgi_rabbitmq - could you post 
>>> your settings configuration? And have you tried running with a different 
>>> channel layer?
>>>
>>> Andrew
>>>
>>> On Tue, Dec 12, 2017 at 10:14 AM, Filbert  wrote:
>>>
 Trying to come up with the proper command line to start Daphne in 
 production.  It seems when I start, it heads off into a repeated 
 processing 
 loop, my thought is that it should just be pending on a websocket 
 connection. Using asgi_rabbitmq.

 daphne -u /opt/daphne.sock  --ws-protocol "graphql-ws" --proxy-headers 
 -v 2 asgi:channel_layer

 Seems to be repeated logging:

 Calling >>> LayerChannel number=2 OPEN conn=>>> '127.0.0.1', 34690)->('127.0.0.1', 5672) params=>>> host=rabbitmq 
 port=5672 virtual_host=/ ssl=False for "2:Queue.DeclareOk"
 0 blocked frames
 Calling functools.partial(>>> asgi_rabbitmq.core.Protocol object at 0x7f1cd01f6a20>>, {
 'daphne.response.yLFVcixMCk!'}, set(), ['daphne.response.yLFVcixMCk!'], 
 False) for "2:Queue.DeclareOk"
 Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': 
 functools.partial(>>> core.Protocol object at 0x7f1cd01f6a20>>, []), 'one_shot': True}
 Processing 2:Basic.GetEmpty
 Processing use of oneshot callback
 0 registered uses left


 Any debugging ideas?

 Entering IOLoop
 Connecting to 127.0.0.1:5672
 Processing 0:Connection.Start
 Processing use of oneshot callback
 0 registered uses left
 Removing callback #0: {'arguments': None, 'only': None, 'calls': 0, 
 'callback': >>> ('127.0.0.1', 5672) 
 params=>>, 
 'one_shot': True}
 Calling >>> LayerConnection PROTOCOL socket=('127.0.0.1', 34690)->('127.0.0.1', 
 5672) params=>>> ssl=False>>> for "0:Connection.Start"
 Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': >>> method LayerConnection._on_connection_tune of >>> socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) params=>>> host=rabbitmq port=5672 virtual_host=/ ssl=False>>>, 'one_shot': True}
 Processing 0:Connection.Tune
 Processing use of oneshot callback
 0 registered uses left
 Removing callback #0: {'arguments': None, 'only': None, 'calls': 0, 
 'callback': >>> ('127.0.0.1', 5672) 
 params=>>, 
 'one_shot': True}
 Calling >>> LayerConnection START socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) 
 params=>>> ssl=False>>> for "0:Connection.Tune"
 Creating a HeartbeatChecker: 600
 add_timeout: added timeout -1786684229378238513; deadline=600 at 
 1513095706.3193622
 Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': >>> method LayerConnection._on_connection_open of >>> socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) params=>>> host=rabbitmq port=5672 virtual_host=/ ssl=False>>>, 'one_shot': True}
 Processing 0:Connection.OpenOk
 Processing use of oneshot callback
 0 registered uses left
 Removing callback #0: {'arguments': None, 'only': None, 'calls': 0, 
 'callback': >>> ('127.0.0.1', 5672) 
 params=>>, 
 'one_shot': True}
 Calling >>> LayerConnection TUNE socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) 
 params=>>> ssl=False>>> for "0:Connection.OpenOk"
 Processing 0:_on_connection_open
 Calling

Re: Please explain "TypeError: handle_404() got an unexpected keyword argument 'exception'"

2017-12-12 Thread Daniel Roseman
On Tuesday, 12 December 2017 17:27:03 UTC, Chris Seberino wrote:
>
>
>>>
>>> Please explain "TypeError: handle_404() got an unexpected keyword 
>>> argument 'exception'"
>>>
>>
>> It means literally that "handle_404() got an unexpected keyword argument 
>> 'exception'", how are you calling handle_404()?
>>
>>
> Thanks for your help.  In my urls.py I have this...
>
> django.conf.urls.handler404 = "main.controllers.controllers.handle_404"
>
> I believe that invokes the handle_404 function in the 
> main/controllers/controllers.py file?
>
> cs 
>

And what does your handle_404 function look like? As the error says, it 
needs to accept an "exception" keyword argument.

Note also that overriding the 404 handler is a very specialized thing to do 
and is almost always not required. Why are you doing this?
--
DR.

-- 
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/d9c81d2b-6834-4774-81ca-1e4473b8c5ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels: starting Daphne in production

2017-12-12 Thread Filbert
Worried I am connecting, but some initial negotiation isn't occurring when 
I am using Daphne vs. runserver. I even proved this by starting runserver 
with --noasgi and running daphne by hand on my desktop and I get the same 
connect/disconnect pattern.

I saw this note, but I am not sure why this isn't failing under runserver 
as well. Running latest Channels BTW.

*WebSocket accept/reject flow*

*Rather than be immediately accepted, WebSockets now pause during the 
handshake while they send over a message on websocket.connect, and your 
application must either accept or reject the connection before the 
handshake is completed and messages can be received.*

*You must update Daphne to at least 1.0.0 to make this work correctly.*



On Tuesday, December 12, 2017 at 3:08:08 PM UTC-5, Filbert wrote:
>
> More specifically, it is logging:
>
> None - - [12/Dec/2017:20:*06:39*] "WSCONNECTING /ws/" - -
> DEBUG Upgraded connection daphne.response.HKlOHkryrd!VaSFKIooRZ to 
> WebSocket daphne.response.HKlOHkryrd!XdRRyyAyVn
> DEBUG WebSocket closed for daphne.response.HKlOHkryrd!XdRRyyAyVn
> None - - [12/Dec/2017:20:*06:43*] "WSDISCONNECT /ws/" - -
>
>
>
> On Tuesday, December 12, 2017 at 2:11:44 PM UTC-5, Filbert wrote:
>>
>> Also, curiously, when I use Inmemory, it seems to connect and immediately 
>> disconnect. Hopefully my Nginx conf makes sense.
>>
>> location /ws {
>> proxy_pass http://unix:/tmp/daphne.ws;
>> proxy_set_header Upgrade $http_upgrade;
>> proxy_set_header Connection "upgrade";
>> proxy_http_version 1.1;
>> proxy_set_header X-Forwarded-For 
>> $proxy_add_x_forwarded_for;
>> proxy_set_header Host $host;
>> }
>>
>>
>> On Tuesday, December 12, 2017 at 2:01:18 PM UTC-5, Filbert wrote:
>>>
>>> Yes, using rabbit...
>>>
>>> CHANNEL_LAYERS = {
>>> 'default': {
>>> 'BACKEND': 'asgi_rabbitmq.RabbitmqChannelLayer',
>>> 'ROUTING': 'toogo.routing.channel_routing',
>>> 'CONFIG': {
>>> 'url': 'amqp://foo:bar@{0}:5672/%2F'.format(RABBITMQ_NODE),
>>> },
>>> },
>>> }
>>>
>>>
>>>
>>> This of course works fine (but we are clustering web servers):
>>>  
>>>CHANNEL_LAYERS = {
>>> "default": {
>>> "BACKEND": "asgiref.inmemory.ChannelLayer",
>>> "ROUTING": "toogo.routing.channel_routing",
>>> },
>>> }
>>>
>>>
>>> On Tuesday, December 12, 2017 at 1:33:55 PM UTC-5, Andrew Godwin wrote:

 Hm, that looks to be like logging from asgi_rabbitmq - could you post 
 your settings configuration? And have you tried running with a different 
 channel layer?

 Andrew

 On Tue, Dec 12, 2017 at 10:14 AM, Filbert  wrote:

> Trying to come up with the proper command line to start Daphne in 
> production.  It seems when I start, it heads off into a repeated 
> processing 
> loop, my thought is that it should just be pending on a websocket 
> connection. Using asgi_rabbitmq.
>
> daphne -u /opt/daphne.sock  --ws-protocol "graphql-ws" --proxy-headers 
> -v 2 asgi:channel_layer
>
> Seems to be repeated logging:
>
> Calling  LayerChannel number=2 OPEN conn= '127.0.0.1', 34690)->('127.0.0.1', 5672) params= host=rabbitmq 
> port=5672 virtual_host=/ ssl=False for "2:Queue.DeclareOk"
> 0 blocked frames
> Calling functools.partial( asgi_rabbitmq.core.Protocol object at 0x7f1cd01f6a20>>, {
> 'daphne.response.yLFVcixMCk!'}, set(), ['daphne.response.yLFVcixMCk!'
> ], False) for "2:Queue.DeclareOk"
> Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': 
> functools.partial( core.Protocol object at 0x7f1cd01f6a20>>, []), 'one_shot': True}
> Processing 2:Basic.GetEmpty
> Processing use of oneshot callback
> 0 registered uses left
>
>
> Any debugging ideas?
>
> Entering IOLoop
> Connecting to 127.0.0.1:5672
> Processing 0:Connection.Start
> Processing use of oneshot callback
> 0 registered uses left
> Removing callback #0: {'arguments': None, 'only': None, 'calls': 0, 
> 'callback':  ('127.0.0.1', 
> 5672) 
> params= ssl=False>>>, 
> 'one_shot': True}
> Calling  LayerConnection PROTOCOL socket=('127.0.0.1', 34690)->('127.0.0.1', 
> 5672) params= ssl=False>>> for "0:Connection.Start"
> Added: {'arguments': None, 'only': None, 'calls': 1, 'callback': 
>  START 
> socket=('127.0.0.1', 34690)->('127.0.0.1', 5672) params= host=rabbitmq port=5672 virtual_host=/ ssl=False>>>, 'one_shot': True}
> Processing 0:Connection.Tune
> Processing use of oneshot callback
> 0 registered uses left
> Removing callback #0: {'arguments': None, 'only': None, 'calls': 0, 
> 'callback':  ('127.0.0.1', 5672) 
> 

Re: Please explain "TypeError: handle_404() got an unexpected keyword argument 'exception'"

2017-12-12 Thread Chris Seberino

>
>
>
> And what does your handle_404 function look like? As the error says, it 
> needs to accept an "exception" keyword argument.
>
> Note also that overriding the 404 handler is a very specialized thing to 
> do and is almost always not required. Why are you doing this?
>
>
Here it is. The date is just to provide the current date at bottom for 
the copyright footer.  Are you saying views like this
are rare?

 def handle_404(request):
"""
Handles 404 errors.
"""

year = datetime.date.today().year

return django.shortcuts.render(request,
   "handle_404.html",
   {"year" : year})

-- 
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/1e0f4922-112d-418c-9d56-be84dbb644bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Please explain "TypeError: handle_404() got an unexpected keyword argument 'exception'"

2017-12-12 Thread Dylan Reinhold
Your handle_404(request): needs to accept request, exception and template.

But if what you want this for is the current Year.
Just create a 404 template file in your template root named 404.html.
In the template use
{% now 'Y' %}
To get the current year.

The just let the default django 404 error process pick it up that as it's
the default template to use for 404..

Make sure you have DEBUG=False for your testing.

Dylan

On Tue, Dec 12, 2017 at 4:09 PM, Chris Seberino  wrote:

>
>>
>> And what does your handle_404 function look like? As the error says, it
>> needs to accept an "exception" keyword argument.
>>
>> Note also that overriding the 404 handler is a very specialized thing to
>> do and is almost always not required. Why are you doing this?
>>
>>
> Here it is. The date is just to provide the current date at bottom for
> the copyright footer.  Are you saying views like this
> are rare?
>
>  def handle_404(request):
> """
> Handles 404 errors.
> """
>
> year = datetime.date.today().year
>
> return django.shortcuts.render(request,
>"handle_404.html",
>{"year" : year})
>
> --
> 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/1e0f4922-112d-418c-9d56-be84dbb644bf%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/CAHtg44AWwfDZfWs7AZtSzjNmiwxoA5o9dsQ%2B8ZnoK9TT6zHHuA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.