Re: Limit a view to superuser only

2017-11-24 Thread Derek
Bear in mind that unless you are running Django's built-in dev server, you will need to restart your production server for changes to propagate. On Sunday, 19 November 2017 17:21:28 UTC+2, yingi keme wrote: > > All of a sudden and out of the blue, it just worked. I had the re-run my > server >

Re: Some newbie questions on CBVs and FBVs

2017-11-24 Thread 'Simon Connah' via Django users
Hi, First of all thank you very much for the reply. It was very useful. I'll re-read the documentation and see what I was missing out on. The get_queryset() method was a very useful hint. That may well solve the issue I was having. Simon.On Friday, 24 November 2017, 06:20:35 GMT, Matemática

Re: Django Channels and multi-tenant will this be a world of hurt?

2017-11-24 Thread Andrew Godwin
Your assumptions all seem correct. Also consider that the security model of WebSockets is... interesting, so securing a multi-tenant setup is going to require a bit more work than you would merely doing the same for HTTP requests. There are other non-Channels options around if you want to look

Django Channels and multi-tenant will this be a world of hurt?

2017-11-24 Thread Filbert
Running multi-tenant site using a fork of Django tenant schemas with tens of web servers and thousands of tenants Piloting a project to implement Channels for real-time notifications, etc. I want to confirm these assumptions: 1. Channels really has no support for multi-tenant, I will have

Re: Strange query when using annotate and count

2017-11-24 Thread Cristiano Coelho
Hello Simon, You are right, the score is really not meant to be attached so a custom lookup might work, if it wasn't for the issue that an order_by clause would fail without the annotation. So it seems it's either update and duplicate a lot of code or find a very ugly work around, I was

Re: How do I make Django show the "user already exists" message when someone tries to register with an existing username?

2017-11-24 Thread Tom Tanner
Thanks for replying. Looks like it'll be easier for me to combine these into one view. On Thursday, November 23, 2017 at 7:13:16 PM UTC-5, Tom Tanner wrote: > > My `urls.py` has this: > url("^login_register/$", views.login_register, name="login_register"), > url("^register/$", views.register,

Re: Strange query when using annotate and count

2017-11-24 Thread Simon Charette
Hello Cristiano, If you are solely using this annotation for querying purpose, that means you are not expecting a `score` attribute to be attached to your `Vulnerability` instances, you could try defining your function as a lookup on CharField/TextField instead. You could then use it only

Re: Blue colored python file in Django Project structure.

2017-11-24 Thread Unnati C
Yup, This is pycharm IDE, and thanks for guidlines. On Friday, November 24, 2017 at 10:53:40 PM UTC+5:30, Dylan Reinhold wrote: > > This has nothing to do with django or python. This is your IDE using > colors to give you status information. Looking like you are using pycharm. > By default

Re: Blue colored python file in Django Project structure.

2017-11-24 Thread Dylan Reinhold
This has nothing to do with django or python. This is your IDE using colors to give you status information. Looking like you are using pycharm. By default (which you can change) blue just means the file has been updated. https://www.jetbrains.com/help/pycharm/file-status-highlights.html Dylan On

Blue colored python file in Django Project structure.

2017-11-24 Thread Unnati C
hello, While working on Django project, suddenly one of my python file name in structure changed to blue. Till now it does not raise any error, but I am shock why it happened. Is anybody have idea regarding this change in django project directory.. -- You received this message because you

Re: Django Development server inaccessible from the browser

2017-11-24 Thread Dylan Reinhold
Is your development server the same machine you are running your browser from? If not you don't want to use localhost, you need to user the IP/domain name of the development server. What is the error you get in the browser? Dylan On Fri, Nov 24, 2017 at 2:47 AM, Harish Oraon

Re: Django Development server inaccessible from the browser

2017-11-24 Thread Harish Oraon
This might be your settings, please confirm DEBUG=False ALLOWED_HOST = [] Try these two a) DEBUG = True ALLOWED_HOST = [] b) DEBUG = False ALLOWED_HOST = ['localhost', '127.0.0.1',] On Friday, 24 November 2017 15:42:22 UTC+5:30, ngn zone wrote: > > Hello all, > > I have a

Re: Strange query when using annotate and count

2017-11-24 Thread Cristiano Coelho
Hello Simon, That private API is good to know, but now that I think of it would still not work for me, since my queryset is passed to a paginator and that's the class that does both the count and actual queryset execution, so need a queryset that can have both the annotation but also clears it

Re: Django 2.0 tutorial

2017-11-24 Thread Carl Brubaker
I figured it out. I had a space in between the "path(' '," single quotes in the polls.urls and there isn't supposed to be one. Thanks for all of your help. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: django 1.11 run error

2017-11-24 Thread ngn
Thanks Jason, That solved the problem. I am grateful On 11/23/2017 02:43 PM, Jason wrote: If this is a new environment with existing source code, did you install all the requirements? eg, is there a requirements.txt file in the project root, and did you execute pip install -r

Re: AttributeError: 'TemplateResponse' object has no attribute '_reason_phrase'

2017-11-24 Thread Web Architect
Figured out why the issue was occurring. I had written a cache decorator to cache based on per user: def cache_per_user_method(ttl=None, prefix=None, cache_post=False): ''' Decorator which caches the view for each User * ttl - the cache lifetime, do not send this parameter means