Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double saving when using django_debug_toolbar #318

Closed
hisie opened this issue Aug 30, 2012 · 8 comments
Closed

Double saving when using django_debug_toolbar #318

hisie opened this issue Aug 30, 2012 · 8 comments
Labels

Comments

@hisie
Copy link

hisie commented Aug 30, 2012

I have just installed the debug toolbar and i have see that when i activate it and i do a method save from a ModelForm it execute two times the create query, while wihtout the debug toolbar is working fine.
I am using:
Python 2.7.2
Django 1.4.1
Debug toolbar 0.9.4
Registration 0.8

This is the debug_toolbar sqk panel:
Query Timeline Time (ms) Acción
+
SELECT ••• FROM django_session WHERE (django_session.session_key = 'f3ade7ddf8f20fd0485e53fa9569231a' AND django_session.expire_date > '2012-08-30 20:12:22' )
28,7429378531%
0,81 Sel Expl
+
SELECT ••• FROM auth_user WHERE auth_user.id = 1
20,3389830508%
0,58 Sel Expl
+
INSERT INTO evento_evento (nombre, descripcion, lugar, fecha_inicio, fecha_fin, numero_dias, tematica_id, privacidad, creador_id, fecha_creaccion, fecha_modificacion, fecha_en_votacion, lugar_en_votacion) VALUES ('Prueba github', '', '', NULL, NULL, NULL, NULL, 'semi', 1, '2012-08-30', '2012-08-30', 0, 0)
26,3771186441%
0,75
+
INSERT INTO evento_evento (nombre, descripcion, lugar, fecha_inicio, fecha_fin, numero_dias, tematica_id, privacidad, creador_id, fecha_creaccion, fecha_modificacion, fecha_en_votacion, lugar_en_votacion) VALUES ('Prueba github', '', '', NULL, NULL, NULL, NULL, 'semi', 1, '2012-08-30', '2012-08-30', 0, 0)
24,540960452%
0,70

And this is the progiling part:

Call CumTime Per TotTime Per Count

  • /home/hisie/workspace-python/preparala/evento/views.py in evento_form(8)
    0,034 0,034 0,000 0,000 1
  • /django/forms/models.py in save(351)
    0,009 0,009 0,000 0,000 1
  • /django/forms/models.py in save_instance(58)
    0,009 0,009 0,000 0,000 1
  • /django/db/models/base.py in save(452)
    0,009 0,009 0,000 0,000 1
  • /django/db/models/base.py in save_base(467)
    0,009 0,009 0,000 0,000 1
  • /django/db/models/manager.py in _insert(202)
    0,007 0,007 0,000 0,000 1
  • /django/db/models/query.py in insert_query(1568)
    0,007 0,007 0,000 0,000 1
  • /django/db/models/sql/compiler.py in execute_sql(905)
    0,007 0,007 0,000 0,000 1
  • /debug_toolbar/utils/tracking/db.py in execute(85)
    0,007 0,007 0,000 0,000 1
  • /debug_toolbar/utils/init.py in tidy_stacktrace(22)
    0,015 0,005 0,000 0,000 3
    /home/hisie/workspace-python/preparala/../django14/lib/python2.7/posixpath.py in realpath(355)
    0,014 0,000 0,001 0,000 84
  • /debug_toolbar/utils/init.py in get_stack(143)
    0,007 0,002 0,000 0,000 3
    /debug_toolbar/utils/init.py in getframeinfo(101)
    0,007 0,000 0,001 0,000 84
@kkumler
Copy link

kkumler commented Sep 19, 2012

@hisie Was the profiling panel enabled?

@hisie
Copy link
Author

hisie commented Sep 21, 2012

Sorry kkumler i have just deactivate it. I will send you a copy of the settings.py when i can.

@kunitoki
Copy link

kunitoki commented Nov 2, 2012

Yes, i'm experimenting the same behaviour. The profiler module executes the page two times (and when submitting forms that produces 2 subsequent form submit).

@Uznick
Copy link

Uznick commented Jun 14, 2013

Strange problem here -- when I use the profiler module -- all sql requests and templates in other debug panels are doubled.

@kunitoki
Copy link

any news on this problem ?

@aaugustin
Copy link
Contributor

#348 is probably a duplicate.

@aaugustin
Copy link
Contributor

Oops.

@aaugustin
Copy link
Contributor

This was fixed in c9d3f34. I added a test in 8a591b8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants