Re: Django channels, running uwsgi and awsgi

2017-01-19 Thread Dev App
Thank you for the answers. It helps me immensely. So in theory, if client doesn't need to send data to server (something which runworker needs to work on), I only need nginx --- wsgi -- django / nginx --- asgi redis ---/ where Dja

Re: readonly and autofocus support in form fields?

2017-01-19 Thread jorrit787
I think the problem here is with ModelForms. Where would you define these properties for ModelForms? Putting them in your Model classes doesn't make sense because it violates loose coupling between models and forms/templates. It's already quite peculiar that Model fields can have a blank=True a

makemessages for js templates

2017-01-19 Thread Nacharov Mikhail
Hello, does somebody know how can I use makemessages commad to collect translation strings from js templates? For example, in mustache(handlebars) templates I would like to have something like this: {{#baggage}} {{#gettext}}{{ num }} bag{{/gettext}} {{/baggage}} Where gettext is the jav

Re: Django channels, running uwsgi and awsgi

2017-01-19 Thread Dev App
> > There's not individual documentation for every situation because people's > choice of webserver and their OS versions and environments differ. If you > tell me what you're using I can try and provide some hints or links to > examples. I thought it would be easy now, since I understand t

RedirectView failing silently on NoReverseMatch is confusing

2017-01-19 Thread Grzegorz Tężycki
Hi everyone. Tim Graham told me that problem with ticet: #26911 should be discuss on mailing list. Details of ticket are here : https://code.djangoproject.com/ticket/26911 When developer set 'pattern_name' in RedirectView and this pattern is incorrect, then method catch NoReverseMatch exceptio

Re: A Backup Model in Django?

2017-01-19 Thread Bernd Wechner
I'm finally round to implementing this, and so wanted to send a warm thanks to those that contributes their thoughts and ideas. I think I'm on a winner with an abstract class and two children, one the backup of the other. To those you recommended full database backup and/or transaction, my apol

Re: prepopulate form with model instance values using UpdateView and ModelForm

2017-01-19 Thread Benjamin Dauer
Hi Sergiy, Thanks for your help! 1) I tried overriding the GET request as you suggested and the print statement never went through. It looks like by default it calls `get_object()`, and my `get_object()` code is running, so I'm not sure why it doesn't appear. 2) The form is appearing with the co

Re: prepopulate form with model instance values using UpdateView and ModelForm

2017-01-19 Thread Benjamin Dauer
Hi Sergiy, Thanks for your help! 1) I tried overriding the GET request as you suggested and the print statement never went through. It looks like by default it calls `get_object()`, and my `get_object()` code is running, so I'm not sure why it doesn't appear. 2) The form is appearing with the co

Re: Django channels, running uwsgi and awsgi

2017-01-19 Thread Avraham Serour
I think you can do conditionals on your server block and proxy pass to the correct upstream depending on your logic On Thu, Jan 19, 2017 at 2:18 PM, Dev App wrote: > There's not individual documentation for every situation because people's >> choice of webserver and their OS versions and envir

RE: RedirectView failing silently on NoReverseMatch is confusing

2017-01-19 Thread Matthew Pava
It looks like Tim wanted you to talk to the Django Developers list. This is the Django Users list. Stating that, I think the NoReverseMatch exception should not be caught. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Grzegorz Tezycki Sent: Thursday, J

Django-channels save reply channel to django model field?

2017-01-19 Thread Nikoleta Misheva
Hello, sorry to bother you but how do you make a django-channels Channel field in a Django model? I tried to use ForeignKey and ForeignObject but doesn't do the work. Thank you in advance :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Django-channels and JSON-RPC

2017-01-19 Thread Fabien Millerand
Hi everyone, I am looking to implement a websocket server based on Django using JSON-RPC protocol. I have been looking around for a pre-made solution without success. I am also a newbie in Django so I am a little bit lost... Did anyone try to develop something like that? -- You received

Re: Django channels, running uwsgi and awsgi

2017-01-19 Thread Andrew Godwin
Nginx can't (to my knowledge) easily switch on the Upgrade header without extra modules as you need to take the header, lowercase it, and check it equals "websocket", and Nginx if statements are weird and limited in some important ways. Instead, I recommend you do prefix-based proxying, like this:

Re: Django-channels save reply channel to django model field?

2017-01-19 Thread Andrew Godwin
Hi, Channel isn't a field type - it's a separate datastructure entirely from a database/Django models and is powered by its own code and servers (the channel layer). If you want to persist the name of a reply_channel for use later, like knowing what channel connections are on to send information

Re: Django-channels and JSON-RPC

2017-01-19 Thread Andrew Godwin
I haven't seen anything like that personally, but I also don't see all of the Channels stuff going on, so maybe there is one. It would be relatively easy to implement as a single class-based consumer that dispatches to RPC handlers based on method name, though, as it matches the consumer pattern v

Re: Django-channels save reply channel to django model field?

2017-01-19 Thread Nikoleta Misheva
So for example when I need the reply channel in the ws recieve method I need to create the Channel again and it will be the same channel referring to the same user? And do I have to delete the newly created channel after each ws recieve method? четвъртък, 19 януари 2017 г., 20:25:41 UTC+2, Andr

"Polls" app in Django Beginners' Tutorial

2017-01-19 Thread David Manlove
I have a question about the "Polls" app, as described in the Django Beginners' Tutorial, https://docs.djangoproject.com/en/1.10/intro/. In tutorial 3, the index view contains the following code: latest_question_list = Question.objects.order_by('-pub_date')[:5] It is stated that this pr

Django Tutorial Part 5, Test detail view with a past question failure.

2017-01-19 Thread Vpeguero
I'm currently working through the django tutorial for v1.10. On part 5 the final test that is created is raising an assertion error as follows: Creating test database for alias 'default'... .F == FAIL: test_detail_view_wi

Re: Django-channels save reply channel to django model field?

2017-01-19 Thread Andrew Godwin
Channels don't need to be deleted, they're just pointers. And yes, if you make a channel with the same name as a reply channel, it will function the same - all channels are, are strings put onto messages as a sort of header for routing and queuing purposes. Andrew On Thu, Jan 19, 2017 at 10:52 AM

urls with https and s3:// as parameters

2017-01-19 Thread Ramon Ramirez-Linan
Hi I am building a django app which urls take 2 parameters a source and destination. The source is either a url for a file http://something.com/file.jpg or an s3 arn s3://bucketname/key.jpg I am having difficulties creating a regex expression that matches that to route it to my view The firs

Re: urls with https and s3:// as parameters

2017-01-19 Thread Vijay Khemlani
Shouldn't the paths be passed as GET or POST arguments instead of part of the URL path? Why would you need the regex then? On 1/19/17, Ramon Ramirez-Linan wrote: > Hi > > I am building a django app which urls take 2 parameters a source and > destination. > The source is either a url for a file ht

Re: What is the fate of closed database connections?

2017-01-19 Thread Michael Grundler
It looks like the source of this error is related to a spatialite internal connection leak (discussed in this post: https://groups.google.com/forum/#!topic/spatialite-users/xrV7CA_GlwM) Each time Django requests a connection to the database sqlite loads the spatialite extension module, which cr