Reduce number of calls to database

2015-06-02 Thread Cherie Pun
Hi, I am new to Django and I am performing some iteration on a queryset. When I use django_debug_toolbar to look at the SQL usage, I realised that Django is actually calling the database once in each iteration. Is there a way to make it call the database only once and somehow store it locally s

Reduce number of sql calls to database

2015-06-02 Thread Cherie Pun
Hi, I am new to Django and I am trying to reduce the number of calls to database as it's slowing down the app. I am performing iteration over the queryset and I used django_debug_toolbar to check the number of queries made, and the number is huge. It looks like django is making a query call to

Re: Reduce number of calls to database

2015-06-05 Thread Cherie Pun
; Cheers, > Simon > > Le mardi 2 juin 2015 11:42:19 UTC-4, Cherie Pun a écrit : >> >> Hi, >> >> I am new to Django and I am performing some iteration on a queryset. When >> I use django_debug_toolbar to look at the SQL usage, I realised that Django >> is

Re: Reduce number of calls to database

2015-06-05 Thread Cherie Pun
Thanks! On Friday, 5 June 2015 08:53:48 UTC+1, kel...@ist-total.org wrote: > > On Fri Jun 5 08:32:52 2015 GMT+0100, Cherie Pun wrote: > > > > Thanks! Would this still give 404 errors when a certain object does not > > exist? > > Nope, but if you really need

Squashed migration

2015-06-12 Thread Cherie Pun
Hi, I have trying to experiment with squashmigration to see if it will make it faster to build the database when running tests. So I have squashed the migrations following the instructions on the Django website. However when I run the tests, it still uses the original migrations. I thought Djan

Re: Squashed migration

2015-06-12 Thread Cherie Pun
may solve your problem: > https://github.com/henriquebastos/django-test-without-migrations/ > > On Fri, Jun 12, 2015 at 6:38 AM, Cherie Pun > wrote: > >> Hi, >> >> I have trying to experiment with squashmigration to see if it will make >> it faster to build th

Re: Squashed migration

2015-06-15 Thread Cherie Pun
Hi, So the original problem was that I was running in the repo which didn't have the squashed migration. Django does know when to switch to the squashed migrations when you have both squashed and unsquashed migration files coexist in the folder. As for the syntax error it was because python can

Diable basic auth on some pages

2015-06-30 Thread Cherie Pun
Hi, In the dev version of the website, we are using basic auth to limit access. However, we are currently developing an api for the website and I would like to use the api without going through the basic auth. Is it possible to disable basic auth for all the api urls? Cheers, Cherie -- You r

Re: Diable basic auth on some pages

2015-07-01 Thread Cherie Pun
n Django. Barring some > custom middleware, authentication checks are performed within the views > themselves or through something like the @login_required or > @user_passes_test decorators. Are you certain that authentication is what's > blocking your requests? > > On Tue

Re: Diable basic auth on some pages

2015-07-01 Thread Cherie Pun
Yes it is, would it be possible to disable it for a particular page? Cheers, Cherie On Wednesday, July 1, 2015 at 10:15:57 AM UTC+1, monoBOT monoBOT wrote: > > > 2015-07-01 8:51 GMT+01:00 Cherie Pun >: > >> >> We are using 'deploy.middleware.basicauth.BasicAut

Re: Diable basic auth on some pages

2015-07-01 Thread Cherie Pun
; configuration in the settings file and manually apply on the views you want > to. > > 2015-07-01 11:03 GMT+01:00 Cherie Pun >: > >> Yes it is, would it be possible to disable it for a particular page? >> >> Cheers, >> Cherie >> >> On W

Checking user permission denied in Django Selenium tests

2015-07-29 Thread Cherie Pun
On the local server that I start up, if the user does not have the required permission for a particular view, they will be redirected to the 403 page (I am using the permission_required decorator) However, in the selenium test, the PermissionDenied exception is thrown and the user is redirec