8👍
Django debug toolbar chokes when using S3BotoStorage. I mostly wanted SQL logging, so adding this code to settings.py to disable the StaticFilesPanel was a workaround for me:
DEBUG_TOOLBAR_PANELS = [
'debug_toolbar.panels.versions.VersionsPanel',
'debug_toolbar.panels.timer.TimerPanel',
'debug_toolbar.panels.settings.SettingsPanel',
'debug_toolbar.panels.headers.HeadersPanel',
'debug_toolbar.panels.request.RequestPanel',
'debug_toolbar.panels.sql.SQLPanel',
# 'debug_toolbar.panels.staticfiles.StaticFilesPanel',
'debug_toolbar.panels.templates.TemplatesPanel',
'debug_toolbar.panels.cache.CachePanel',
'debug_toolbar.panels.signals.SignalsPanel',
'debug_toolbar.panels.logging.LoggingPanel',
'debug_toolbar.panels.redirects.RedirectsPanel',
]
0👍
This django-debug-toolbar explicit-setup
Says something about:
from django.conf import settings
from django.conf.urls import include, patterns, url
if settings.DEBUG:
import debug_toolbar
urlpatterns += patterns('',
url(r'^__debug__/', include(debug_toolbar.urls)),
)
Have you tried?
- [Django]-How to assign GROUP to user from a registration form (for user) in Django?
- [Django]-Validation Error with Multiple File Uploads in Django via Ajax
0👍
I had encountered the same error when I created custom storage using lambda:
StaticRootS3BotoStorage = lambda: S3Boto3Storage(bucket_name='example-name')
Changing it to class solved the problem:
class StaticRootS3BotoStorage(S3Boto3Storage):
bucket_name='example-name'
- [Django]-Match an alternative url – regular expression django urls
- [Django]-Django: posting a template value to a view
- [Django]-How to get the length of a TextField in Django?
- [Django]-Why am getting a MultipleObjectsReturned error inside a try block?
0👍
pip install django-debug-toolbar
check your settings.py file :
INSTALLED_APPS = [
'django.contrib.staticfiles',
'debug_toolbar',
...
MIDDLEWARE = [
"debug_toolbar.middleware.DebugToolbarMiddleware",
...
]
...
INTERNAL_IPS = [
"127.0.0.1",
]
...
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_URL = '/static/'
# Extra places for collectstatic to find static files.
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static/'),
)
urls.py
path("__debug__/", include(debug_toolbar.urls)),
And run this command : python manage.py collectstatic
👤Ayse
- [Django]-Send real time data to Django frontend
- [Django]-How to test celery with django on a windows machine
- [Django]-How to format a number with specific number of digits?
Source:stackexchange.com