An addon for Django Debug Toolbar that allows for directly opening templates and views in your IDE
Project description
MrBenn Toolbar Plugin
Saving you 10 seconds, 100 times a day.
Docs | Install | Contribute
The MrBenn Toolbar Plugin is an addon for the Django Debug Toolbar which allows you to quickly open template files and views in your IDE.
Installation
To install the MrBenn, you can use pip! Simply follow the command below:
pip install mrbenn-toolbar-plugin
After the package has been installed, head over to your settings.py. You need to add the following:
-
in
INSTALLED_APPSaddmrbenn_panel -
under
DEBUG_TOOLBARSaddmrbenn_panel.panel.MrBennPanel. We recommend you removedebug_toolbar.panels.staticfiles.StaticFilesPanel. -
you need to add the location of the IDE you would like to use to open files with an option called
DJANGO_WINDOWS_IDEin your settings. For example, the setting for the PyCharm Interpreter would beDJANGO_WINDOWS_IDE="C:/Program Files/JetBrains/PyCharm 2023.1.1/bin/pycharm64.exe. -
MAC USERS: you will need to tell your operating system to use your IDE to open python and html files by default. This guide could be helpful.
-
LINUX USERS: we've not tested this yet. We assume the same steps for MAC USERS.
Limitations and next steps
Do not use this package in production. Do not use Django-Debug-Toolbar in production either!
This package opens files on the machine running the dev server, driven by HTTP requests, so its endpoints are guarded:
- they only respond when the Django Debug Toolbar would be shown (same
SHOW_TOOLBAR_CALLBACK/INTERNAL_IPS/DEBUGgate); - they are
POST-only and CSRF-protected, so another site open in your browser cannot trigger them; - the file to open is resolved server-side (templates via Django's loaders, views via the URLconf), never taken as a raw path, and its existence is checked before the OS is asked to open it. Django's template loaders reject
..and absolute paths.
Keep in mind this is still a development-only convenience: run your dev server on localhost, not on a shared/public interface.
Requirements
On top of Django, MrBenn requires the Django Debug Toolbar package found here.
How to contribute?
All contributions are appreciated! To contribute, simply create a new branch with your contribution and raise a PR! You can ping @andytwoods should any issues arise!
Should you get stuck on something, we also have a contributing section in our wiki! LINK TBD
What's with the name?
Mr Benn was a kids UK TV show from the 70s (wikipedia). The main character, Mr Benn, on each episode walked through a magical door which took him on different adventures. Perhaps I was thinking that this package in a similar fashion performs a little IDE magic, transporting you to the right file, each time you click the link to your current view or template. #ModernKidsTVshowsSuck #CBEEBIESthoughRocks
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mrbenn_toolbar_plugin-0.0.3.tar.gz.
File metadata
- Download URL: mrbenn_toolbar_plugin-0.0.3.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c500750150dc9fa32b02bf5ee2334d3c325199b7fa3015434716949ea90d303
|
|
| MD5 |
3859faa5d3b84e7dc457916aa95d06d5
|
|
| BLAKE2b-256 |
0b3ec41bcb02144492fed3c5602b7876b7089669259cfa16890bb3ad52316279
|
Provenance
The following attestation bundles were made for mrbenn_toolbar_plugin-0.0.3.tar.gz:
Publisher:
publish.yml on andytwoods/mrbenn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mrbenn_toolbar_plugin-0.0.3.tar.gz -
Subject digest:
9c500750150dc9fa32b02bf5ee2334d3c325199b7fa3015434716949ea90d303 - Sigstore transparency entry: 2063498928
- Sigstore integration time:
-
Permalink:
andytwoods/mrbenn@9d06774460e95785b0b91b88998e2607a240838f -
Branch / Tag:
refs/tags/0.0.3 - Owner: https://github.com/andytwoods
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9d06774460e95785b0b91b88998e2607a240838f -
Trigger Event:
release
-
Statement type:
File details
Details for the file mrbenn_toolbar_plugin-0.0.3-py3-none-any.whl.
File metadata
- Download URL: mrbenn_toolbar_plugin-0.0.3-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7facdf2540e05274f7ae986fbcb2c294f0f81f3695bd364fc98bc34dafb8e5bc
|
|
| MD5 |
215ba37001bf9b0ce6f084aa856acdf1
|
|
| BLAKE2b-256 |
aae70d28f934136b8d68bcb924ec7bf670d5cc9ae9d9b3744c0a90b081650479
|
Provenance
The following attestation bundles were made for mrbenn_toolbar_plugin-0.0.3-py3-none-any.whl:
Publisher:
publish.yml on andytwoods/mrbenn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mrbenn_toolbar_plugin-0.0.3-py3-none-any.whl -
Subject digest:
7facdf2540e05274f7ae986fbcb2c294f0f81f3695bd364fc98bc34dafb8e5bc - Sigstore transparency entry: 2063498948
- Sigstore integration time:
-
Permalink:
andytwoods/mrbenn@9d06774460e95785b0b91b88998e2607a240838f -
Branch / Tag:
refs/tags/0.0.3 - Owner: https://github.com/andytwoods
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9d06774460e95785b0b91b88998e2607a240838f -
Trigger Event:
release
-
Statement type: