Giter Club home page Giter Club logo

django-cprofile-middleware's People

Contributors

alexsanduk avatar alxfv avatar hannseman avatar hobbestigrou avatar josven avatar omarish avatar romack77 avatar skyl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

django-cprofile-middleware's Issues

TypeError: object() takes no parameters

in django 1.10.6, I got this error after inserting middleware at last index.

  File "/t/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 82, in load_middleware
    mw_instance = middleware(handler)
TypeError: object() takes no parameters

'NoneType' object has no attribute 'set_cookie'

Hi,

I'm getting the following error with Django 1.5, any ideas what it can be ?

Exception Type: AttributeError
Exception Value:
'NoneType' object has no attribute 'set_cookie'
Exception Location: /home/areski/.virtualenvs/cdrstats/local/lib/python2.7/site-packages/django/middleware/csrf.py in process_response, line 208

Full Paste
http://dpaste.com/1259400/

Support of django 1.8.

Currently the project don't support django 1.8. The project use MiddlewareMixin come with django 1.10. Django 1.8 is still used I would to know if you are ok to add the support of this django version.

New release to PyPI?

It would be nice to get a new release with the features added since 1.0.4.

Thanks for your library!

Python 3 support

The StringIO and cStringIO modules are gone. Instead, import the io module and use io.StringIO or io.BytesIO for text and data respectively.

Add a settings to by the can method.

I think it can be interesting to add a settings to bypass the can method. I think on the development mode it's not necessary to be staff to show the result of profiling. Maybe it can be interesting to add a settings to bypass the current condition.

'WSGIRequest' object has no attribute 'user'

When I try and use it as described in the README., Ijust get:

"'WSGIRequest' object has no attribute 'user'" at middleware.py in can, line 30,

If i use a trailing / on the url, i get a different error:

"'Person' object has no attribute 'is_staff' middleware.py in can, line 30"

Import fails

Hi,

While I follow the steps necessary to install the module, and load the application, I get the following error message:

Error importing module: 'Module "api.cache.middleware" does not define a "ProfilerMiddleware" attribute/class'.

Django 1.10 / Python 3.6.

i install it, but can't work!

description

  1. here is my log in /var/log/aio/message;
  2. django version is 1.8.10

log content:

May  4 16:48:52 localhost uwsgi: Traceback (most recent call last):
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/site-packages/django/core/handlers/wsgi.py", line 170, in __call__
May  4 16:48:52 localhost uwsgi: self.load_middleware()
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/site-packages/django/core/handlers/base.py", line 50, in load_middleware
May  4 16:48:52 localhost uwsgi: mw_class = import_string(middleware_path)
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/site-packages/django/utils/module_loading.py", line 26, in import_string
May  4 16:48:52 localhost uwsgi: module = import_module(module_path)
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/importlib/__init__.py", line 109, in import_module
May  4 16:48:52 localhost uwsgi: return _bootstrap._gcd_import(name[level:], package, level)
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 1129, in _exec
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 1471, in exec_module
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/site-packages/django_cprofile_middleware/middleware.py", line 14, in <module>
May  4 16:48:52 localhost uwsgi: from django.utils.deprecation import MiddlewareMixin
May  4 16:48:52 localhost uwsgi: ImportError: cannot import name 'MiddlewareMixin'
May  4 16:48:52 localhost uwsgi: [pid: 6550|app: 0|req: 22/22] 172.16.6.20 () {44 vars in 837 bytes} [Fri May  4 16:48:52 2018] GET /xdashboard/home/?prof => generated 0 bytes in 9 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 42)
May  4 16:48:52 localhost uwsgi: Traceback (most recent call last):
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/site-packages/django/core/handlers/wsgi.py", line 170, in __call__
May  4 16:48:52 localhost uwsgi: self.load_middleware()
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/site-packages/django/core/handlers/base.py", line 50, in load_middleware
May  4 16:48:52 localhost uwsgi: mw_class = import_string(middleware_path)
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/site-packages/django/utils/module_loading.py", line 26, in import_string
May  4 16:48:52 localhost uwsgi: module = import_module(module_path)
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/importlib/__init__.py", line 109, in import_module
May  4 16:48:52 localhost uwsgi: return _bootstrap._gcd_import(name[level:], package, level)
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 1129, in _exec
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 1471, in exec_module
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/site-packages/django_cprofile_middleware/middleware.py", line 14, in <module>
May  4 16:48:52 localhost uwsgi: from django.utils.deprecation import MiddlewareMixin
May  4 16:48:52 localhost uwsgi: ImportError: cannot import name 'MiddlewareMixin'
May  4 16:48:52 localhost uwsgi: [pid: 6550|app: 0|req: 23/23] 172.16.6.20 () {42 vars in 768 bytes} [Fri May  4 16:48:52 2018] GET /nginx-logo.png => generated 0 bytes in 5 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 46)
May  4 16:48:52 localhost uwsgi: Traceback (most recent call last):
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/site-packages/django/core/handlers/wsgi.py", line 170, in __call__
May  4 16:48:52 localhost uwsgi: self.load_middleware()
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/site-packages/django/core/handlers/base.py", line 50, in load_middleware
May  4 16:48:52 localhost uwsgi: mw_class = import_string(middleware_path)
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/site-packages/django/utils/module_loading.py", line 26, in import_string
May  4 16:48:52 localhost uwsgi: module = import_module(module_path)
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/importlib/__init__.py", line 109, in import_module
May  4 16:48:52 localhost uwsgi: return _bootstrap._gcd_import(name[level:], package, level)
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 1129, in _exec
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 1471, in exec_module
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/site-packages/django_cprofile_middleware/middleware.py", line 14, in <module>
May  4 16:48:52 localhost uwsgi: from django.utils.deprecation import MiddlewareMixin
May  4 16:48:52 localhost uwsgi: ImportError: cannot import name 'MiddlewareMixin'
May  4 16:48:52 localhost uwsgi: [pid: 6550|app: 0|req: 24/24] 172.16.6.20 () {42 vars in 766 bytes} [Fri May  4 16:48:52 2018] GET /poweredby.png => generated 0 bytes in 5 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 11)
May  4 16:48:52 localhost uwsgi: Traceback (most recent call last):
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/site-packages/django/core/handlers/wsgi.py", line 170, in __call__
May  4 16:48:52 localhost uwsgi: self.load_middleware()
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/site-packages/django/core/handlers/base.py", line 50, in load_middleware
May  4 16:48:52 localhost uwsgi: mw_class = import_string(middleware_path)
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/site-packages/django/utils/module_loading.py", line 26, in import_string
May  4 16:48:52 localhost uwsgi: module = import_module(module_path)
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/importlib/__init__.py", line 109, in import_module
May  4 16:48:52 localhost uwsgi: return _bootstrap._gcd_import(name[level:], package, level)
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 1129, in _exec
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 1471, in exec_module
May  4 16:48:52 localhost uwsgi: File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
May  4 16:48:52 localhost uwsgi: File "/root/.pyenv/versions/3.4.4/lib/python3.4/site-packages/django_cprofile_middleware/middleware.py", line 14, in <module>
May  4 16:48:52 localhost uwsgi: from django.utils.deprecation import MiddlewareMixin
May  4 16:48:52 localhost uwsgi: ImportError: cannot import name 'MiddlewareMixin'
May  4 16:48:52 localhost uwsgi: [pid: 6550|app: 0|req: 25/25] 172.16.6.20 () {46 vars in 815 bytes} [Fri May  4 16:48:52 2018] GET /favicon.ico => generated 0 bytes in 7 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 1)

Need basic test coverage.

We need some basic test coverage to make sure that the library functions as expected. Is anybody interested in helping out by creating some basic tests?

pip install fails

pip install django-cprofile-middleware
Collecting django-cprofile-middleware
Using cached https://files.pythonhosted.org/packages/3b/c2/0cb878b0018b54444849d4569c6b36e0688eb1316e363e356228bb5d1b0f/django-cprofile-middleware-1.0.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/c4/8qchc1vj479_9v7h_xm8ztw5hj2xk1/T/pip-install-UPHoZq/django-cprofile-middleware/setup.py", line 10, in
with open(path.join(project_path, 'README.md')) as f:
IOError: [Errno 2] No such file or directory: '/private/var/folders/c4/8qchc1vj479_9v7h_xm8ztw5hj2xk1/T/pip-install-UPHoZq/django-cprofile-middleware/README.md'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.