Re: Django channels on IIS

2017-01-26 Thread Алексей Кузуб
I have IIS, and i ran IIS in front of Daphne which handle SSL. But when i run daphne to listen port which support https in IIS, daphne tell me "2017-01-27 10:19:37,082 CRITICAL Unhandled error in Deferred: 2017-01-27 10:19:37,082 CRITICAL Traceback (most recent call last): File

Re: Django channels on IIS

2017-01-26 Thread Sgiath
Yes you can. daphne -e ssl:443:privateKey=key.pem:certKey=crt.pem django_project.asgi:channel_layer For more info look at the Daphne GitHub repo https://github.com/django/daphne/ But I would suggest run Nginx in front of the Daphne which will handle SSL. -- You received this message because

Re: Django channels on IIS

2017-01-26 Thread Алексей Кузуб
Thank you! Maybe i'll try it. One more question...can i use daphne by https? четверг, 26 января 2017 г., 14:59:37 UTC+3 пользователь Avraham Serour написал: > > if you are stuck on windows but not necessarily IIS you may try cygwin, I > once had to deploy on windows and after investigating some

result of filter query returning empty because of def __unicode__(self)

2017-01-26 Thread Mike08
Does adding a def __unicode__(self): method into a model affect the queries being returned ? I am currently experiencing a situation in which the presence of def __unicode__(self): in the model is interfering with the results being returned. These two are my models class

Re: Django-channels and JSON-RPC

2017-01-26 Thread Alexander Prokhorov
Dear Colleagues, I've made some fixes in the code (most of them concerns Python 3 compatibility). I also added a test showing a problem with some kind of name clash. пятница, 27 января 2017 г., 1:07:38 UTC+3 пользователь Fabien Millerand написал: > > Yes, that was my thought as well... > >

Re: Multiple (limited) Admin feature for each registered user - Best Approach.

2017-01-26 Thread Melvyn Sopacua
On Thursday 26 January 2017 12:10:07 Mike08 wrote: > Now each teacher (Teacher model) is assigned a Subject (subject > Model). Now each Teacher should have an admin section they should not > be able to change their name, they should not be able to change their > subject but they can create new

Re: Multiple (limited) Admin feature for each registered user - Best Approach.

2017-01-26 Thread Mike08
Quick Fix - The Teacher model had a typo. Here is the fix *class Teacher(models.Model):* *name = models.CharField(max_length=200)* *subject= models.ForeignKey('Subject')* *topic= models.ForeignKey('**Topic**')* *text = models.TextField()* *What I am trying to do or (would like

Re: Django channels deployment

2017-01-26 Thread Andrew Godwin
You can separate workers by channel name, but not by path. You're probably better off doing it further upstream with nginx as you said. You also can't just run one redis server per customer unless you move to separate installs for bigger customers, with their own Daphne, Redis and workers.

Re: Django channels deployment

2017-01-26 Thread Sgiath
And if I would like to separate some of the infrastructure - for example dedicate some resources just for one customer. Can I run some workers for the request based on the, for example, path? Example: I want 10 workers consume just messages from path example.com/customer1 and all messages from

Re: Django channels deployment

2017-01-26 Thread Andrew Godwin
Hi, Yes, you can run daphne with just an ASGI file that matches the Django settings. It's easier to just use the Django project for this, but you also don't need to update/restart it unless the CHANNEL_LAYERS setting changes. The conditions you put down are mostly correct, apart from 2), having

Re: Django-channels and JSON-RPC

2017-01-26 Thread Fabien Millerand
Yes, that was my thought as well... Will do and let you know. It could be good to add a link in your docs as a side note... If you get any feedback let me know... El 26 ene. 2017 22:38, "Andrew Godwin" escribió: > A quick read through and it looks roughly how I expect;

Django channels deployment

2017-01-26 Thread Sgiath
Hi I am working on some app with Django Channels and I am in the phase when I am looking for the best way how to deploy the Channel project (with scaling and smooth update in mind). I have this setup: 1. Nginx server handling SSL certificate, headers, etc. it will proxy to -> 2.

Multiple (limited) Admin feature for each registered user - Best Approach.

2017-01-26 Thread Mike08
Hello experts first time poster here, so I am not sure how to approach this issue. I am trying to restrict admin privileges of users. Let me explain a simple use case and then I could explain my objective. Consider the following example (model code below) there are 3 subjects(Subject Model) in

Re: Django-channels and JSON-RPC

2017-01-26 Thread Andrew Godwin
A quick read through and it looks roughly how I expect; I'm not an expert in JSON-RPC though so I'd want some other people to chime in. As for releasing it on PyPI, I think that's the best way; I don't want to roll something like this into Channels directly. I would suggest you turn it from a

Re: Comparing two lists

2017-01-26 Thread Richard Hall
Melvyn, thanks for looking at this. Despite my inept attempt at explanation you've understood what I am trying to do - I need to revisit my relationships and fully explore my options at the model level. Thanks again, Richard P.S. I'll try to use clearer analogies in the future - in my head

Re: audit trail functionality in database model

2017-01-26 Thread enrico baranski
@Fred: Thanks a lot, that really helped me! enrico -- 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

Re: Django-channels and JSON-RPC

2017-01-26 Thread Fabien Millerand
Andrew, I have finished to develop what I called the JsonRpcWebsocketConsumer: https://github.com/millerf/django-channels-jsonrpc/tree/master/django_channels_jsonrpc/django_channels_jsonrpc I was thinking of creating a pypy package, there is a little bit f more work to be done for that. But if

Re: Django-channels and JSON-RPC

2017-01-26 Thread Fabien Millerand
Alexander, What I am working on is not the client, but the server... I am not really sure what you are looking for exactly, but I have been working with websockets and json-rpc client-server structure for a few years now, so happy to fill you in with some infos if needed. Le mercredi 25

Re: Comparing two lists

2017-01-26 Thread Melvyn Sopacua
Hello, I don't know if you've changed names to protect the innocent, but conceptually, these models are hard to translate to the real world. This is the opposite of what object oriented programming is trying to accomplish and probably why you're having a hard time figuring it out and

Re: Multiple forms in the same template

2017-01-26 Thread schaf . mh
Ohh thanks that helped a lot. Now in one view I still have a problem. It uses the a formset and tries to give that back while overwriting the get_form function: views.py class LayoutFormView(LoginRequiredMixin, StaffuserRequiredMixin, UpdateView ): template_name = 'abc/layout.html'

Re: Django channels on IIS

2017-01-26 Thread Avraham Serour
if you are stuck on windows but not necessarily IIS you may try cygwin, I once had to deploy on windows and after investigating some possibilities I just installed cygwin and put nginx with uwsgi. On Thu, Jan 26, 2017 at 9:55 AM, Алексей Кузуб wrote: > Thank you for your

Re: Comparing two lists

2017-01-26 Thread ludovic coues
Building.objects.filter(addresses__street__pk=patientid) will return all buildings with an address in the same street as the patient. If I understand correctly, that is :) 2017-01-26 10:41 GMT+01:00 Richard Hall : > Thanks for replying, I need all the help I can get.

Re: Comparing two lists

2017-01-26 Thread Richard Hall
Thanks for replying, I need all the help I can get. What I'm trying to do is the opposite of what I seem to be doing. Rather than looking for an address without a building I am trying to see, from my list of all buildings, which one has an address (filtered by patientid). I can easily list all

Re: Comparing two lists

2017-01-26 Thread Richard Hall
Thanks for replying to my question. What I am trying to do is for each building in the list see if there is a corresponding address record for that building. Thus I'm trying to test the opposite of what you've pointed out i.e. not that there will be an address without a building, but if that

Re: Comparing two lists

2017-01-26 Thread ludovic coues
You are assuming you can have address without building. {% if x.building %} 2017-01-26 0:27 GMT+01:00 Richard Hall : > Hello, I've only just started with Django and need a bit of help steering > myself in the right direction. > > I want to create a page that has a list

Re: file fields

2017-01-26 Thread ludovic coues
If you want a fixed set of file field, you declare multiple file field, each with a different name. For exemple: class UserProfile(models.Model): photo_front = models.FileField(...) photo_side = models.FileField(...) If you want a list of photo, you don't know yet how many,