Re: Django and Nginx through uwsgi is not working

2017-03-17 Thread valerio orfano
I want to thank Melvyn publicly, without his support i wouldn't succed! unix:/// in the uwsgi.ini file DOES NOT work (at least in Centos) insted unix:/ WORKS OUT Thanx you very much, i've spent days on this issue On Thursday, March 16, 2017 at 8:58:52 PM UTC+1, Melvyn Sopacua wrote: > > On Th

Re: new bee - starting to build web application based on python - Django - PostgreSQL (or) MYSQL

2017-03-17 Thread ludovic coues
+1 for doing the tutorial. If you need more information or if you have a hard time following the tutorial, there are really good third party tutorial. I personally learned about form with the django girls tutorial. On 17 Mar 2017 1:52 a.m., "Camilo Torres" wrote: I recommend you the django tuto

Re: Tweaking the admin title to display the model name

2017-03-17 Thread Andréas Kühne
You can override the admin change form for the model you want and then change the title. You can check here for some information: https://docs.djangoproject.com/en/1.10/ref/contrib/admin/#overriding-admin-templates Regards, Andréas 2017-03-17 5:21 GMT+01:00 Mike Dewhirst : > Currently in an ad

Re: superuser having all permissions makes perm checking messy

2017-03-17 Thread guettli
It's not a problem. It something else. I am missing the right words ... I know how to use conditions in python or the equivalent sql operations. I am sure that my code would be simpler if the superuser would not have all permissions. I am sure if I want to go this way, since django does it diff

Re: Questions on Django queryset iterator - wrt select_related and prefetch_related and how it works

2017-03-17 Thread Web Architect
Hi, Thanks for your response. But I have observed the following: Without Iterator: It takes a bit of a time before the for loop is executed and also the CPU spikes up during that period and so does the Memory - which implies the DB is accessed to fetch all the results. With iterator: The for l

Re: superuser having all permissions makes perm checking messy

2017-03-17 Thread Andréas Kühne
I also think you are talking about to different things. Thomas, I get a feeling you are not using the default permissions system built into django, but rather using your own. Regardless of how you do it - you could just add a method on the user object that is : def has_permission(self, permission

Re: Django and Nginx through uwsgi is not working

2017-03-17 Thread Antonis Christofides
> Thanx you very much, i've spent days on this issue I'm sorry to hear that, especially because when I was using uwsgi I was also spending days for various issues. All this pain went away when I started to use Gunicorn. You can read more about that in https://djangodeployment.com/2017/01/02/which-w

Re: superuser having all permissions makes perm checking messy

2017-03-17 Thread James Schneider
On Mar 17, 2017 1:53 AM, "guettli" wrote: It's not a problem. It something else. I am missing the right words ... I know how to use conditions in python or the equivalent sql operations. I am sure that my code would be simpler if the superuser would not have all permissions. If you're coding y

Django login implement using exisit mssql (MD5 hash password encode).

2017-03-17 Thread guoya
I am a starter of Django. I want to get my user profile(login_name and password) to login. 1.How to encode the password and compare the password in mssql db using *MD5* ? 2.How to implement login required without using Django build-in *login_required *? *forms.py* class LoginForm(forms.Form):

cannot get div to reload with ajax

2017-03-17 Thread Shezan Kazi
hi all, i am trying to reload a div that is in an {% include %} tag when a form is submitted. This is what i have so far: the page i am viewing: {% crispy note_form %} {% include 'item/item_notes.html' %} the included template: {% for note in object.itemnote_set.all reversed %} {

Re: Django login implement using exisit mssql (MD5 hash password encode).

2017-03-17 Thread Andréas Kühne
Hi, You shouldn't implement this yourself - use the existing authentication methods for this. See https://docs.djangoproject.com/en/1.10/topics/auth/ for more information on the subject. Also MD5 hashed passwords would be a very bad security decision - it's simply not safe enough. BUT if you stil

Re: Django and Nginx through uwsgi is not working

2017-03-17 Thread Vijay Khemlani
I fail to see what's so complex of uwsgi for a simple deploy, my typical configuration file has 8 lines On 3/17/17, Antonis Christofides wrote: >> Thanx you very much, i've spent days on this issue > I'm sorry to hear that, especially because when I was using uwsgi I was > also > spending days fo

Re: cannot get div to reload with ajax

2017-03-17 Thread Vijay Khemlani
And what error are you getting? The only weird thing I see at first is url: "{% url candidate_notes %}", If your JS file is a standalone file served as a static file then you have no "url" tag available inside it. On 3/17/17, Shezan Kazi wrote: > hi all, > > i am trying to reload a div that is

Re: Django login implement using exisit mssql (MD5 hash password encode).

2017-03-17 Thread ludovic coues
In fact, django provide both salted and non-salted md5 hash for password. If you want to use the built-in django auth method and have password hashed with MD5, add that to your settings.py file: PASSWORD_HASHERS = [ 'django.contrib.auth.hashers.MD5PasswordHasher', ] For the record

Re: cannot get div to reload with ajax

2017-03-17 Thread ludovic coues
That's your code $.ajax({ url: "{% url candidate_notes %}", success: function(data){ $('#notesColumn').html('data'); } }) I'm pretty sure you want to replace the content of notesColumn with the value of data and not the string data. I would also use t

Re: Questions on Django queryset iterator - wrt select_related and prefetch_related and how it works

2017-03-17 Thread knbk
Django uses client-side cursors. 1.11, which is currently in beta, switches to server-side cursors on PostgreSQL [1], but other databases still use client-side cursors. When a client-side cursor executes a query, it loads all results in memory before the results can be accessed. But that's just

Programming Error at admin

2017-03-17 Thread kessev
I used the sql sever to create model but when I want to open admin page it pop out this! What's wrong is it? -- You received this message

Re: Programming Error at admin

2017-03-17 Thread Andréas Kühne
Have you run the migrations for the project? It looks like you don't have the sessions table created? Regards, Andréas 2017-03-17 14:58 GMT+01:00 kessev : > I used the sql sever to create model but when I want to open admin page it > pop out this! > What's wrong is it? > > >

Re: Tweaking the admin title to display the model name

2017-03-17 Thread Mike Dewhirst
On 17/03/2017 7:49 PM, Andréas Kühne wrote: You can override the admin change form for the model you want and then change the title. You can check here for some information: https://docs.djangoproject.com/en/1.10/ref/contrib/admin/#overriding-admin-templates That's fantastic! Thanks Andréas

Re: Programming Error at admin

2017-03-17 Thread kessev
Yeah, it might be the problem, when I migrated it show these error. Andréas Kühne於 2017年3月18日星期六 UTC+8上午2時44分36秒寫道: > > Have you run th

Re: superuser having all permissions makes perm checking messy

2017-03-17 Thread Melvyn Sopacua
On Thursday 16 March 2017 02:29:21 guettli wrote: > In our custom code we already skip check1 and do only check2. Why do you even do these checks? There's a view decorator and class-based view mixin. All you need to do is make good groups and users and the rest follows. If you want to define a