Move ProfileMiddleware to another file to get rid of python-profile dependency

Issue #196 resolved
Dmitry Chaplinsky
created an issue

python-profile isn't listed under django-lfs dependencies but lfs requires it once you have 'lfs.utils.middleware.RedirectFallbackMiddleware' added to your middleware.

So it's a bit strange that you should install module for things that you wouldn't use anyway.

As alternative you can move imports into the middleware methods.

Comments (4)

  1. Kai Diefenbach repo owner


    first, from which version are you talking about? lfs-installer or lfs-development-buildout? Which version branch?

    I'm asking because within lfs-installer "lfs.utils.middleware.RedirectFallbackMiddleware" is added to "MIDDLEWARE_CLASSES" by default.

    Why do one have to install python-profile in the first place? Isn't this part of the standard library? I can't remember that I have to install it to one of my systems?

    And as a side note, I have no idea why "lfs.utils.middleware.RedirectFallbackMiddleware" exist at all. Seems not very different from Django's default one. Maybe we can remove it completely. Any idea?


  2. Dmitry Chaplinsky reporter


    I'm talking about version 0.7.1 and I've installed it via lfs-installer. So it automatically added this to my default

    Then I took generated code and after some modifications integrated it with my project and rolled it out on our staging server where I installed LFS via pip.

    And then I ran into issue because python-profile isn't standard library (at least in 2.6.6 on debian squeeze) and it wasn't listed in dependencies at all.

    I also don't know why this middleware exists, I thought it was your code :) I'm happy with any solution: remove it at all, move profiling extension into another file or add python-profile to list of dependencies.

  3. Log in to comment