Re: Possible bug with transaction.on_commit

2016-05-16 Thread Carl Meyer
Hi Bart, On 05/16/2016 02:10 PM, barthel...@infobart.com wrote: > I believe that I encountered a bug or at least a serious limitation with > transaction.on_commit in Django 1.9.x. Essentially, the on_commit hooks > seem to be tied to the database connection instead of the transaction. > This

Re: Proxy in front of django app

2016-05-16 Thread Maks Materkov
Thank you for answer. Unfortunately, I don't have any control on the client side. All requests are coming to something like "api.example.com" and I need route requests on the server side. Recently I've found another option. Some "api managment tools" like http://www.openrepose.org

Re: django tutorial part 2: clarification about INSTALLED APPS

2016-05-16 Thread Mike Dewhirst
On 17/05/2016 1:42 AM, Asi Dimbez wrote: Hi, I'm a newbie, there is thing not clear to me in the tutorial, part 2. I left part 1 with poll app working ok. In the tutorial, part 2, I read about INSTALLED_APPS :" That holds the names of all Django applications that are activated in this Django

Re: Possible bug with transaction.on_commit

2016-05-16 Thread barthelemy
The callbacks are indeed run when autocommit is restored, but they are not executed one after the other, i.e., they are not **all** executed when autocommit is restored. The relevant code in Django: # Called by set_autocommit(...) def run_and_clear_commit_hooks(self):

Re: Possible bug with transaction.on_commit

2016-05-16 Thread Stephen J. Butler
I believe that's as designed. There's this part in the documentation of "Database transactions": Callbacks are not run until autocommit is restored on the connection following the commit (because otherwise any queries done in a callback would open an implicit transaction, preventing the

Re: Proxy in front of django app

2016-05-16 Thread Erik Cederstrand
> Den 16. maj 2016 kl. 20.48 skrev Maks Materkov : > > Hi everyone! > > i' ve got an unusual question, that is probably not very specific to django. > We have a large multi-tenant django app, and we want to split all traffic > between two tenants (tenant 1 and tenant 2,

Possible bug with transaction.on_commit

2016-05-16 Thread barthelemy
Hi, I believe that I encountered a bug or at least a serious limitation with transaction.on_commit in Django 1.9.x. Essentially, the on_commit hooks seem to be tied to the database connection instead of the transaction. This means that unrelated transactions may trigger on_commit hooks, which

Proxy in front of django app

2016-05-16 Thread Maks Materkov
Hi everyone! i' ve got an unusual question, that is probably not very specific to django. We have a large multi-tenant django app, and we want to split all traffic between two tenants (tenant 1 and tenant 2, for now). This tenant will be connected to different databases. Our django app is 100%

Re: How to flush/clear database for single app, i.e. NOT the Project?

2016-05-16 Thread Erik Cederstrand
> Den 16. maj 2016 kl. 19.16 skrev JoeCodeswell : > > How can I flush/clear database for single app, i.e. NOT the Project? > > I have a multi-app project. > In a particular app I created my model with single class. > I populated the db for that model with the Admin

How to flush/clear database for single app, i.e. NOT the Project?

2016-05-16 Thread JoeCodeswell
How can I flush/clear database for single app, i.e. NOT the Project? I have a multi-app project. In a particular app I created my model with single class. I populated the db for that model with the Admin Interface. Now i have changed the model to have 2 classes related by a ForeignKey. I ran

django tutorial part 2: clarification about INSTALLED APPS

2016-05-16 Thread Asi Dimbez
Hi, I'm a newbie, there is thing not clear to me in the tutorial, part 2. I left part 1 with poll app working ok. In the tutorial, part 2, I read about INSTALLED_APPS :" That holds the names of all Django applications that are activated in this Django instance.." Now, poll app worked from part