Re: Can not read request.body from a POST request

2016-04-20 Thread Gergely Polonkai
Vijay: They are not the same thing. request.POST, .GET and .FILES are exactly that, POST and GET data and the optional uploaded files. However, in e.g. a RESTful environment it is possible to have something else in the request body. Mihai, what else do you do with the request before trying to read

Re: Any way to tolerate Unicode w/o changing '' to u''?...

2016-04-20 Thread Fred Stluka
Tim, Excellent response, thanks!  The link to the doc is just what I needed. One more question.  I'm still getting UnicodeEncodeError on some calls to str() because I should now be calling unicode() instead.  Any easy way to map all of my str() calls to uni

Check for A Message When Testing with Selenium

2016-04-20 Thread Austin West
I'm attempting to write a Selenium test for my django app that performs a custom action in the admin page. If the action is successful, the i use the message_user function to send a success message back to the user, e.g. "Action successful!". It appears that this message doesn't appear in the r

admin popup + button help

2016-04-20 Thread Giuseppe
I am trying to get a pop up that will let me create a new object to associate to a many to many relationship on a form/model. In the same way that it works in django-admin. I have been followed the instructions from here , and its no

implement django-admin + button popup

2016-04-20 Thread Giuseppe Smith
I have been trying to get a + button beside my many to many list that will give me a popup to a form to create a new related object to associate. I have followed the instructions at this link http://www.hoboes.com/Mimsy/hacks/replicating-djangos-admin/ but it will not work. whenever I click the

Re: Can not read request.body from a POST request

2016-04-20 Thread Vijay Khemlani
Why would you want to access request.body directly? You should use request.POST, request.GET, request.FILES. On Wed, Apr 20, 2016 at 5:27 PM, Mihai Corciu wrote: > Is there a method to access request.body from a POST request in Django, > without disabling 'django.middleware.csrf.CsrfViewMiddlewa

Can not read request.body from a POST request

2016-04-20 Thread Mihai Corciu
Is there a method to access request.body from a POST request in Django, without disabling 'django.middleware.csrf.CsrfViewMiddleware' ? CsrfViewMiddleware is causing: Exception Type: RawPostDataException Exception Value: You cannot access body after reading from request's data stream w

Re: Spatialite for GeoDjango can't be loaded on Ubuntu Wily Werewolf

2016-04-20 Thread Giorgos Ouzounoudis
I had the exactly same error on Ubuntu 16.04. -- 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 group, s

Re: Why when I call a method within a middleware does not return an HttpResponse?

2016-04-20 Thread 술욱
because from the exception you return to process_request() and if you don't return anything None in implied. 2016-04-20 15:10 GMT-03:00 Neto : > The problem is that when happens the exception, the redirect does not work, > only if I put return before is_authenticated_user(), like this: > > > cla

Re: No Downtime Code Releases

2016-04-20 Thread Alex Heyden
I wouldn't recommend tying your repository structure to your deployment needs. Put that in the deployment script instead. You can see if any migrations are pending with manage.py migrate --list On Wed, Apr 20, 2016 at 1:59 PM, wrote: > My thought process for separating the models into a separate

Re: No Downtime Code Releases

2016-04-20 Thread bliyanage
My thought process for separating the models into a separate repo is something like this: I am predominately putting up our (heroku) maintenace page when migrations are run If the models are in separte repo, I only need to run migrations when that repo is deployed. If migrations are not deploy

Re: Why when I call a method within a middleware does not return an HttpResponse?

2016-04-20 Thread Neto
The problem is that when happens the exception, the redirect does not work, only if I put return before is_authenticated_user(), like this: class Check(object): """ Check """ @staticmethod def process_request(request): def is_authenticated_user():

Re: Issue with Django Password Normalization

2016-04-20 Thread Michal Petrucha
On Wed, Apr 20, 2016 at 07:42:26AM -0700, Arun S wrote: > For ex, adding the Django Code Snippet for handling User names in the Login > Page : > > default_username = (unicodedata.normalize('NFKD', default_username) > So Django does follow Normalizing of Usernames usign NFKD Algorithm. > Then appl

Re: Why when I call a method within a middleware does not return an HttpResponse?

2016-04-20 Thread 술욱
What's the value of request.session['user'] when user is not logged in? My guess is it's an instance of AnonymousUser. 2016-04-20 11:43 GMT-03:00 Neto : > Hi, > > I have a middleware that checks whether the user is logged in. > > class Check(object): > > """ > Check > """ > >

Why when I call a method within a middleware does not return an HttpResponse?

2016-04-20 Thread Neto
Hi, I have a middleware that checks whether the user is logged in. class Check(object): """ Check """ @staticmethod def process_request(request): def is_authenticated_user(): try: request.session['user'] except KeyError:

Re: Issue with Django Password Normalization

2016-04-20 Thread Arun S
For ex, adding the Django Code Snippet for handling User names in the Login Page : default_username = (unicodedata.normalize('NFKD', default_username) So Django does follow Normalizing of Usernames usign NFKD Algorithm. Then applies Hashing Algorithms on this. *But the same is never followed for

Re: Issue with Django Password Normalization

2016-04-20 Thread Rick Leir
There is also a new issue in Trac on this topic. I added two links to Stackoverflow discussions there. The issue: supposing a password is mañana. Depending on what client you use, input methods can give you two different UTF8 characters for ñ. As a first step, let's add test case, and check wh

Re: Issue with Django Password Normalization

2016-04-20 Thread Michal Petrucha
> On Wed, Apr 20, 2016 at 4:16 PM, Arun S wrote: > > > let me try to clear my question. > > > > please correct me if am wrong. > > basically all I want to know is that there already exists a number of > > Unicode normalization forms. > > Reference > > > > Unicode normalization forms: http://unico

Re: Issue with Django Password Normalization

2016-04-20 Thread Avraham Serour
actually upon further reading the document it seems it specifies on how to handle unicode, it tells how unicode strings whould be stored. if that's the case then it is not a django problem but a python problem. if you are on python 3 then you are using unicode strings, python handles that for you

Re: Issue with Django Password Normalization

2016-04-20 Thread Arun S
Does that mean that Unicode Normalisation is a very weak and unsecure way for passwords? In this case, what is the actual Usage of Unicode Normalization ? Why exactly do we need something like a Unicode Normalization ? Offcourse django provides various ways to strengthen and vallidate the passw

Re: Turn off migrations completely in Django 1.7

2016-04-20 Thread Matt Schinckel
On Wednesday, December 2, 2015 at 6:31:31 PM UTC+10:30, john@gmail.com wrote: > > +1 for disabling migrations completely - for several reasons. > > 1. Right now, I'm trying to run tests against a production database with > runserver, in *read-only* mode - but it fails because it can't creat

Re: Issue with Django Password Normalization

2016-04-20 Thread Avraham Serour
in summary: "Unicode Normalization Forms are formally defined normalizations of Unicode strings which make it possible to determine whether any two Unicode strings are equivalent to each other" as I see this would be highly unsecure for passwords, this is something like converting special characte

Re: Issue with Django Password Normalization

2016-04-20 Thread Michal Petrucha
On Wed, Apr 20, 2016 at 03:02:06PM +0200, Erik Cederstrand wrote: > Do you want passwords to be case-insensitive? If so, you can > subclass AuthenticationForm and override clean_password(), and > set_password() on your user model, and put any transformations of > the raw password there. A more rob

Re: Issue with Django Password Normalization

2016-04-20 Thread Arun S
let me try to clear my question. please correct me if am wrong. basically all I want to know is that there already exists a number of Unicode normalization forms. Reference Unicode normalization forms: http://unicode.org/reports/tr15/#Norm_Forms so as I said as a part of a company norms, the pr

Re: Issue with Django Password Normalization

2016-04-20 Thread Simon Charette
Hi Arun, I'm not sure this is what you are referring to but Django 1.9 ships with password validation[1] which can be configured to: 1. Prevent field similarity (e.g. password == username) 2. Enforce minimum password length 3. Prevent usage of common password (e.g. "password") 4. Enf

Re: Issue with Django Password Normalization

2016-04-20 Thread Michal Petrucha
On Wed, Apr 20, 2016 at 05:41:37AM -0700, Arun S wrote: > basically I would like to know if the latest version of django > already supports any kind of normalization for the login passwords. Most of us probably have no idea what kind of normalization you are talking about. At least I know I don't.

Re: Issue with Django Password Normalization

2016-04-20 Thread Erik Cederstrand
> Den 20. apr. 2016 kl. 14.41 skrev Arun S : > > basically I would like to know if the latest version of django already > supports any kind of normalization for the login passwords. What exactly do you mean by "password normalization"? Do you want passwords to be case-insensitive? If so, you ca

Issue with Django Password Normalization

2016-04-20 Thread Arun S
basically I would like to know if the latest version of django already supports any kind of normalization for the login passwords. -- 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,

Re: request user

2016-04-20 Thread Avraham Serour
if you can get the request object you can get the current user with request.user On Mon, Apr 18, 2016 at 9:38 PM, Elias Coutinho wrote: > Good afternoon people, > > I am using django material, LayoutMixin > > My view is: > > class NewProfissoesPessoaView (LoginRequiredMixin, LayoutMixin, >

Issue with Django Password Normalization

2016-04-20 Thread Arun S
Hi, As a Part of a very big project for a Company, we follow CSDL rules and we use Django Extensively. As a part of Django, we would like to Follow certain Normalisation Process for all the Passwords during User Login. In the Django Documentation, there isn’t any information on whether Django

Re: Turn off migrations completely in Django 1.7

2016-04-20 Thread marcin . j . nowak
On Wednesday, August 26, 2015 at 1:08:51 PM UTC+2, grzegorz.stalmierski wrote: > > > With current architecture around migrations Django > is database owner, not one of the database services. > > Application layer is chaning over time and its lifetime is a way shorter than database and data. Mi

Re: No Downtime Code Releases

2016-04-20 Thread Daniel Chimeno
This can help you. https://medium.com/@healthchecks/deploying-a-django-app-with-no-downtime-f4e02738ab06#.dmyf7lk8y El martes, 19 de abril de 2016, 3:37:19 (UTC+2), bliy...@rentlytics.com escribió: > > Hey, > > I have two issues I'm looking at solving at work, and I'm looking for a > couple sugg