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

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

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

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

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

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

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

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

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() "...

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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