InviteBox / django-live-profiler

A database access profiler for Django-based applications that can be ran in production
194 stars 44 forks source link

transition to Django 1.5 #12

Closed ghost closed 11 years ago

ghost commented 11 years ago

I like to use django-live-profiler... when i passed to Django 1.5, it will break for 2 reasons :

  1. Django 1.5 does not have the compiler. "empty_iter" function, they directly use
"iter([])"
  1. template tags like {% url name %} change to {% url "name" %} on Django 1.3 with {% load url from future %} and was definitive on Django 1.5.

If you want to cover old Django version, i think the best way is firstly make unit tests and use tox or/and travis.ci...

precision : i test my patch on Django 1.4 and 1.5...

atereshkin commented 11 years ago

Thanks!

Before I merge, would you care to look into making it backward-compatible with 1.3? For the templates I believe you just need to add "{% load url from future %}", but the instrumentation needs to be checked (though it might just work as is).

No problem if not though - will do it myself. Just a bit busy right now.

rayhatfield commented 11 years ago

Ha. Was about to suggest the same changes. Thanks for your work on this.

brycenesbitt commented 11 years ago

I'd like to see this pulled also. I get:

File "PycharmProjects/virtualenvs/obviously/local/lib/python2.7/site-packages/profiler/instrument.py", ImportError: cannot import name empty_iter

From the line "django.db.models.sql.compiler import SQLCompiler, empty_iter" And 'url' requires a non-empty first argument. The syntax changed in Django 1.5, see the docs.

JustinSGray commented 11 years ago

I just ran into this issue as well... any plans to pull this in?

chrisspen commented 11 years ago

Just upgraded to 1.5. Found this bug is a blocker. Would love to see this fixed.

atereshkin commented 11 years ago

OK folks, you win. Guess we'll have to leave implementing 1.4 compatibility to whoever needs it.

aniketbehera commented 11 years ago

Any update on this please. I get the same error. Thanks

LucianU commented 11 years ago

Same here. Updates would be welcome. What I mean is that it looks like this recent merge hasn't been released on PyPI.

MRigal commented 10 years ago

True @atereshkin don't you want to make a release tag here, this would make it easy to get a new version from PyPI

MRigal commented 10 years ago

And just for info, adding {% load url from future %} fixes the bug on 1.3 - 1.4, indeed this should be added also

ghost commented 10 years ago

Still running this error with 1.5 when installing via pip.

from django.db.models.sql.compiler import SQLCompiler, empty_iter ImportError: cannot import name empty_iter

pip freeze | grep live django-live-profiler==0.0.9

illagrenan commented 10 years ago

Same error on Django 1.6:

File "C:\Users\xx\.virtualenvs\xx\lib\site-packages\profiler\instrument.py", line 3, in <module>
    from django.db.models.sql.compiler import SQLCompiler, empty_iter
ImportError: cannot import name empty_iter
tapia commented 10 years ago

Yep, same error with 1.6 here. Any news on this?

dhirajt commented 10 years ago

yep still getting this error.

marjoripomarole commented 10 years ago

Help! Same error here on Django 1.6 :)

tclancy commented 10 years ago

It looks like the version on Pypi (which you'd get if you just run pip install django-live-profiler) is out-of-date. You can install the current version with pip install -e git+git://github.com/InviteBox/django-live-profiler.git#egg=django-live-profiler. That seems to work for me on Django 1.5 (or at least gets around the empty_iter error.