-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAEBAgAGBQJSIdKGAAoJEJ9WpvTpw+EqHA8P/REuYNqd06ZmvZ8QaW61St2w
dt9PgK1obiSTy5/pffSuCL8PNz+AukLKNeM3ZLlB3j9iEYYOEBPhnM3cOh3t1ljd
QKxZqmhk/Y/akS+VEcrgZX+rix9lHBj8HYOLeTfdmY4VqUqZHRpHYU/ED/1nBQOO
7Dg9oLgJlfYnQKfBI6eWFndvG1tF5q0n20YSz1RHX5aJraY4RBaDRxnGUHQZF0C3
Rp1H7U17XS3fsb+k23Jh954Yyh7OAezkzicpsXpuaEH5bstHcJs7MJ5eTe8RB4m8
aqrtThCZv7L8+mjV9Ue0Da1Qbc6CFC7oQyrG84C/ReoWZkrVmGbVhrO9kIzf4cn8
ewF96bJ60+NSXsFuRD/M/oALyBWimTifd8UPVvWqhXtfGQyJ/0bt2Suhaoq49BgI
k8kXxhvf5bUmXAzFGML2aFdxPNFYcpxh7GqIisCH7KXrmoyBQlXNA+k4h8eVHmtM
sqg3/kw86y2o74JB4C8fySBHOa/Y41785D2WA35/KyAj4KDzqfAFSoBxnuFbvI0O
ZdY6FCbkY8ap8gzh/xWh9GefgjZdAttds0X05zPAzlOIC/pgGM4KBBByxSEQZgOZ
x8atp/kzmQccuVZGdmkjZlmYAUVRLVLIrkacVY+PH4LC7YLjA4KGdqQz/FSsURYo
42mLc37guDzhQt6LDRWR
=s2R/
-----END PGP SIGNATURE-----
Hi,
disable Template panel in debug_toolbar and try again.
Debug toolbar hits database when evaluating template context.
Cheers,
Tom
Dne Sat, 31 Aug 2013 12:09:00 +0100
Marcin Szamotulski <mszamot@gmail.com> napsal(a):
> Hello,
>
> I am using django-1.6.b2 on a localserver (./manage.py runserver) and
> for every request I have the chain of db lookups made twice. For
> example my log looks something like this (after enabling
> django.db.backands logger):
>
> # HERE VIEW IS CALLED
> (0.001) SELECT "django_session"."session_key", "django_session"."session_data", "django_session"."expire_date" FROM "django_session" WHERE ("django_session"."session_key" = '2dh8ly6cfqkyiauv8co5h1vossjg70ru' AND "django_session"."expire_date" > '2013-08-31 11:04:33.597734+00:00' ); args=('2dh8ly6cfqkyiauv8co5h1vossjg70ru', u'2013-08-31 11:04:33.597734+00:00')
> (0.001) SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login", "auth_user"."is_superuser", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."date_joined" FROM "auth_user" WHERE "auth_user"."id" = 1 ; args=(1,)
>
> #... (AND SO ON)
>
> # HERE VIEW CALL IS FINISHED
> [31/Aug/2013 12:04:33] "GET /coot/ HTTP/1.1" 200 220974
> [31/Aug/2013 12:04:34] "GET /site_media/static/css/style.css HTTP/1.1" 304 0
> [31/Aug/2013 12:04:34] "GET /site_media/static/js/jquery.js HTTP/1.1" 304 0
> [31/Aug/2013 12:04:34] "GET /site_media/static/js/jquery-ui.js HTTP/1.1" 304 0
> [31/Aug/2013 12:04:34] "GET /site_media/static/js/posts.js HTTP/1.1" 304 0
> [31/Aug/2013 12:04:34] "GET /site_media/static/js/confirm.js HTTP/1.1" 304 0
> [31/Aug/2013 12:04:34] "GET /site_media/static/css/posts.css HTTP/1.1" 304 0
> [31/Aug/2013 12:04:34] "GET /site_media/static/debug_toolbar/css/toolbar.min.css HTTP/1.1" 304 0
> [31/Aug/2013 12:04:34] "GET /site_media/static/debug_toolbar/js/toolbar.min.js HTTP/1.1" 304 0
> [31/Aug/2013 12:04:34] "GET /site_media/static/pics/django_logo.png HTTP/1.1" 304 0
> [31/Aug/2013 12:04:34] "GET /site_media/static/pics/python_logo.png HTTP/1.1" 304 0
> [31/Aug/2013 12:04:34] "GET /site_media/static/css/whitey.png HTTP/1.1" 304 0
> [31/Aug/2013 12:04:34] "GET /site_media/static/css/stressed_linen.png HTTP/1.1" 304
>
> # DB LOOKUPS ONCE AGAIN:
> (0.001) SELECT "django_session"."session_key", "django_session"."session_data", "django_session"."expire_date" FROM "django_session" WHERE ("django_session"."session_key" = '2dh8ly6cfqkyiauv8co5h1vossjg70ru' AND "django_session"."expire_date" > '2013-08-31 11:04:33.597734+00:00' ); args=('2dh8ly6cfqkyiauv8co5h1vossjg70ru', u'2013-08-31 11:04:33.597734+00:00')
> (0.001) SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login", "auth_user"."is_superuser", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."date_joined" FROM "auth_user" WHERE "auth_user"."id" = 1 ; args=(1,)
>
> ... (AND SO ON)
>
>
> any ideas why?
>
> The views (as it is not just one) returns using render(). This also
> happens when using DetailedView cbv.
>
> I also setup looking on postgres (which I use) and indeed the queries
> are made twice.
>
> Thanks for ideas,
> Marcin
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment