Issue #196 resolved

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

Dmitry Chaplinsky avatarDmitry 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


    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


    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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.