Comments (6)
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.
@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.
Thanks @catcombo
Does speedinfo automatically profile all the views or do we have to set up any hooks?
from django-speedinfo.
@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.
@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.
@ChillarAnand Uncomment this line :)
from django-speedinfo.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-speedinfo.