Giter Club home page Giter Club logo

Comments (6)

ChillarAnand avatar ChillarAnand commented on May 22, 2024 1

My bad :)

May be a simple check can be added to prevent this. Debug toolbar includes an error message.

ERRORS:
?: debug_toolbar.middleware.DebugToolbarMiddleware is missing from MIDDLEWARE.
        HINT: Add debug_toolbar.middleware.DebugToolbarMiddleware to MIDDLEWARE.

Thanks @catcombo

from django-speedinfo.

catcombo avatar catcombo commented on May 22, 2024

@ChillarAnand That was an interesting case :) The problem is in this loop in book/admin.py:

models = apps.get_models()
for model in models:
    admin_class = type('AdminClass', (ListAdminMixin, admin.ModelAdmin), {})
    try:
        admin.site.register(model, admin_class)
    except admin.sites.AlreadyRegistered:
        pass

In the loop you get the list of a registered models including speedinfo.models.ViewProfiler and register admin class for it. Then Django tries to register the model for the second time in speedinfo.admin. This is where you got the error. I comment out the loop and error disappears.

from django-speedinfo.

ChillarAnand avatar ChillarAnand commented on May 22, 2024

Thanks @catcombo

Does speedinfo automatically profile all the views or do we have to set up any hooks?

from django-speedinfo.

catcombo avatar catcombo commented on May 22, 2024

@ChillarAnand speedinfo profiles all views by default, but you can customize the behaviour by providing SPEEDINFO_EXCLUDE_URLS or even write custom profiling condition.

from django-speedinfo.

ChillarAnand avatar ChillarAnand commented on May 22, 2024

@catcombo I have set it up as per https://github.com/catcombo/django-speedinfo#installation. It created a cache file at /tmp/django_cache/c53e40b02d369922232dca8eecbb3fd9.djcache but in admin nothing is showing up after browsing multiple pages. Any suggestions on what can be wrong?

from django-speedinfo.

catcombo avatar catcombo commented on May 22, 2024

@ChillarAnand Uncomment this line :)

from django-speedinfo.

Related Issues (8)

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.