Re: Simultaneous Web Requests appending responses in function based views

2016-05-30 Thread Stephen J. Butler
Ohhh... you're looking at the server logs? Those are never going to be sequential. Your requests operate in parallel. That's why you see interleaved outputs. Modify your print statement like this to see what's happening: print " {1}".format(id(request), func) You should see the proper results,

Re: Simultaneous Web Requests appending responses in function based views

2016-05-30 Thread James Schneider
On Mon, May 30, 2016 at 7:16 PM, cr katz wrote: > The code I shared is where the problem is. Here is the output once again > from the server logs. It is evident that the second request is running into > the first and appending the responses. > > The text in BOLD 'Entered

Re: Simultaneous Web Requests appending responses in function based views

2016-05-30 Thread cr katz
The code I shared is where the problem is. Here is the output once again from the server logs. It is evident that the second request is running into the first and appending the responses. The text in BOLD 'Entered Search' is the entry point for each request. I suspect a problem with looping

Re: Simultaneous Web Requests appending responses in function based views

2016-05-30 Thread Stephen J. Butler
I don't see anything in your pasted code that would cause that in the browser. Have you provided us a complete example that exhibits that behavior? Reduce your project down to the smallest set of code that exhibits the problem and then upload it somewhere we can see it. On Mon, May 30, 2016 at

ImageField | error

2016-05-30 Thread Erick Brockes
Folks, I'm using django 1.9. I'm having the following problem. When I update the object of Pessoa, described below, I receive the following error message: "i/o operation on closed file". Does anyone have any solution. Thanks. Erick models.py class Pessoa(models.Model): ...

Re: Simultaneous Web Requests appending responses in function based views

2016-05-30 Thread cr katz
Single request from the user gives the correct output as below. Please see the appended response further below when a user submits 2 requests from 2 different browsers on the same dev machine. I don't want the users to see appended responses, rather, each request must return response as

Re: Simultaneous Web Requests appending responses in function based views

2016-05-30 Thread Stephen J. Butler
What's your actual output vs. what's your desired output? Also, the RequestContext is meant for the render() function. If you just want to access request.GET then you can do it directly (request is passed in as the first parameter to your view func). You also don't need to pre-assign qList and

Re: Simultaneous Web Requests appending responses in function based views

2016-05-30 Thread cr katz
Hello James, Here below is my code: qList in the code below, actually take a list of functions and uses the parameters received thru the request, processes and appends the response to 'p'. In this code, I eliminated those functions and hardcoded with a list of strings. def

Re: ProgrammingError: relation "django_content_type" already exists

2016-05-30 Thread 'Lenz' via Django users
Thanks Tim! Running manage.py migrate --fake-initial solved the problem! Am Freitag, 10. April 2015 02:40:56 UTC+2 schrieb Tim Graham: > > Hi Mike, > > Take a look at the migrate --fake-initial option. It's new in 1.8. In 1.7, > --fake-initial was an implicit default, but we decided to make it

Adding view permission by default to auth_permission

2016-05-30 Thread Ander Ustarroz
I am surprised this feature is not implemented yet, at the moment when we create a new model three permissions are created automatically: - - *add_permission* - *change_permission* - *delete_permission * We really missing the *view_permission* here, when we want staff to be able

Re: Reverse for 'reg/{{post.pk}}/' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

2016-05-30 Thread Florian Schweikert
On 24/05/16 08:46, meInvent bbird wrote: > onClick="window.location.href='{% url 'reg/{{post.pk}}' %}'">Save You cannot access a variable like this in a template. There is also no point in trying to access an url using url providing an url. Your url pattern is called 'post_detail'. Try

Re: Choice fields not validated while saving to database

2016-05-30 Thread Jani Tiainen
On 30.05.2016 13:33, Vinayak Kaniyarakkal wrote: On Monday, 30 May 2016 15:24:57 UTC+5:30, Jani Tiainen wrote: Django doesn't validate models automatically. You can validate model manually as per docs:

Re: Choice fields not validated while saving to database

2016-05-30 Thread Vinayak Kaniyarakkal
On Monday, 30 May 2016 15:24:57 UTC+5:30, Jani Tiainen wrote: > > Django doesn't validate models automatically. You can validate model > manually as per docs: > > > >

Re: Choice fields not validated while saving to database

2016-05-30 Thread Jani Tiainen
Django doesn't validate models automatically. You can validate model manually as per docs: On 30.05.2016 12:38, Vinayak Kaniyarakkal wrote: The following code is "failing silently" class

Choice fields not validated while saving to database

2016-05-30 Thread Vinayak Kaniyarakkal
The following code is "failing silently" > class MyModel(models.Model): > CHOICES = ((0, 'Inactive'), (1, 'Active'),) > my_field = models.PositiveIntegerField(choices=ACTIVE_CHOICES, > default=2) > > obj = MyModel.objects.all()[0] > obj.my_field=100 > obj.save() Should I raise a bug

Re: Drawing simple objects in Django using canvas

2016-05-30 Thread James Schneider
On May 29, 2016 4:23 PM, "Nemanja Milosavljevic" wrote: > > > > down votefavorite > > I am trying to draw simple objects on HTML canvas with Django as my backend. Objects are simple geometrical shapes. I find a Fabric.js java script but it is complicated and I am trying to

Re: Simultaneous Web Requests appending responses in function based views

2016-05-30 Thread James Schneider
On May 29, 2016 4:23 PM, "cr katz" wrote: > > Hello, > I am new to django. I developed a web application using form based views. When I submit a single web request from the dev env, the response is returned correctly. When submit 2 simultaneously from 2 browsers, I

Re: TemplateSyntax Error - Invalid block tag '<span'.

2016-05-30 Thread James Schneider
On May 29, 2016 4:23 PM, "Joseph Mitchell" wrote: > > Hi, newbie here. While going through https://docs.djangoproject.com/en/1.9/intro/tutorial03/ and I get the following: > >> TemplateSyntaxError at /polls/ >> Invalid block tag on line 23: '