django-debug-toolbar

Django Rest Framework debug post and put requests

[亡魂溺海] 提交于 2021-02-07 05:17:53
问题 I use DRF extension to se json list for model, and there i can debug with debug-toolbar that GET request, but how can i debug POST and PUT requests? I have this for settings in debug mode: INSTALLED_APPS += ('debug_toolbar',) MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',) DEBUG_TOOLBAR_PATCH_SETTINGS = False INTERNAL_IPS = ( '127.0.0.1' ) Now, when i try with Intercept redirects in debug-toolbar, it doesn't show me toolbar when i do POST . 回答1: I found django-silk

Django Rest Framework debug post and put requests

一曲冷凌霜 提交于 2021-02-07 05:16:00
问题 I use DRF extension to se json list for model, and there i can debug with debug-toolbar that GET request, but how can i debug POST and PUT requests? I have this for settings in debug mode: INSTALLED_APPS += ('debug_toolbar',) MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',) DEBUG_TOOLBAR_PATCH_SETTINGS = False INTERNAL_IPS = ( '127.0.0.1' ) Now, when i try with Intercept redirects in debug-toolbar, it doesn't show me toolbar when i do POST . 回答1: I found django-silk

Django give Error 500 for all static files like CSS and Images, when DEBUG is False

点点圈 提交于 2020-12-21 04:05:47
问题 I've tried different solutions already posted by users, but they didn't work for me. settings.py of Project BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) DEBUG = False ALLOWED_HOSTS = ["*"] STATIC_URL = '/static/' STATICFILES_DIRS=[ os.path.join(BASE_DIR,'static') ] STATIC_ROOT=os.path.join(BASE_DIR,'assets') MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR,'media') All my CSS files are in style folder inside the static folder. And all images are in the media

Django give Error 500 for all static files like CSS and Images, when DEBUG is False

旧城冷巷雨未停 提交于 2020-12-21 04:05:33
问题 I've tried different solutions already posted by users, but they didn't work for me. settings.py of Project BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) DEBUG = False ALLOWED_HOSTS = ["*"] STATIC_URL = '/static/' STATICFILES_DIRS=[ os.path.join(BASE_DIR,'static') ] STATIC_ROOT=os.path.join(BASE_DIR,'assets') MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR,'media') All my CSS files are in style folder inside the static folder. And all images are in the media

Django give Error 500 for all static files like CSS and Images, when DEBUG is False

痞子三分冷 提交于 2020-12-21 04:04:56
问题 I've tried different solutions already posted by users, but they didn't work for me. settings.py of Project BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) DEBUG = False ALLOWED_HOSTS = ["*"] STATIC_URL = '/static/' STATICFILES_DIRS=[ os.path.join(BASE_DIR,'static') ] STATIC_ROOT=os.path.join(BASE_DIR,'assets') MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR,'media') All my CSS files are in style folder inside the static folder. And all images are in the media

django_debug_toolbar and Docker

不羁岁月 提交于 2020-06-10 07:31:33
问题 So I got docker and Django to work locally, first by building an image from a Dockerfile, then using Fig to get postgres image, link it to the base image, and run the localserver. Everything works just fine, except for django_debug_toolbar. For some reason it just won't show up. Have the dockerhost ip as well in the internal_ips. Can anyone help me out with it? Docker is running on mac via boot2docker. Thanks! My settings: init .py import os if 'DEBUG' not in os.environ or not os.environ[

How to correctly set up internal ip for django-debug-toolbar

做~自己de王妃 提交于 2020-02-03 09:00:26
问题 First time i'm editing setting.py file in google cloud computing please forgive me for this silly Question ... I wanted to run django-debug-toolbar and followed every step in that tutorial. And the thing i want is the tool bar to be visible in ( our office ) only. So i just put our public address into INTERNAL_IPS like INTERNAL_IPS = ('182.74.xx.xx',) and i did restart run server. but the tool bar not visible. If changed back to 127.0.0.1 then tool bar visible again 回答1: It's should work.

How can django debug toolbar be set to work for just some users?

本秂侑毒 提交于 2019-12-31 08:43:10
问题 Right away: yes I know about INTERNAL_IPS. I'm about to have my django app opened up at work integration and testing. I know there will be debugging and plenty modifications and/or optimizations to be made so I'd love to have the Django Debug Toolbar. However, I'd prefer to not have it up for all of my co-workers (who are the 'clients'). The reason the INTERNAL_IP setting doens't work for just me (btw: I have a static IP on my development computer) is that I am using Nginx as a reverse-proxy

Capture SQL queries via Django debug toolbar

扶醉桌前 提交于 2019-12-25 02:24:44
问题 I'm calling my Django application from the command line with curl. I'm passing json in the request and collecting a response in json as well. I have the Django debug toolbar installed. Is there a way I could capture the SQL via the toolbar and return it with the rest of the json response? Something like @json_response def index(request): try: ids = json.loads(request.read())['ids'] except ValueError: return HttpResponseBadRequest listing = MyModel.public().filter(id__in=[c.split('-')[0] for c

django-debug-toolbar with django-cms and Django 1.3

吃可爱长大的小学妹 提交于 2019-12-24 10:12:20
问题 I keep hitting an error when trying to use django-debug-toolbar and django-cms together. "MpttMeta has no attribute ' class '" I have a feeling it's something to do with the Mptt app bundled with Django CMS, but I'm not sure, and I've seen this on a few projects but I'm surprised I can't find a direct hit for the error message in Google so I thought I'd post here. I've tried using latest released version of debug toolbar, also the develop branch, and also dcramer's fork, but it's making no