#4786 closed Uncategorized (duplicate)
Debug page traceback should highlight local code vs. framework code
| Reported by: | Owned by: | Kevin McConnell | |
|---|---|---|---|
| Component: | Core (Other) | Version: | dev | 
| Severity: | Normal | Keywords: | aug22sprint | 
| Cc: | kevin.mcconnell@… | Triage Stage: | Accepted | 
| Has patch: | yes | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
The debug traceback is very good.
But if the stacktrace
has many lines, it is hard to find your code.
Here is a simple patch, which guesses if the filename
is my code or djang/python code. If it is my code,
display the filename bold.
Since django and python code have no errors (simley),
I can see the buggy file quicker.
Attachments (4)
Change History (15)
by , 18 years ago
| Attachment: | views_debug_py.diff added | 
|---|
comment:1 by , 18 years ago
| Component: | Uncategorized → Metasystem | 
|---|---|
| Owner: | changed from to | 
| Triage Stage: | Unreviewed → Design decision needed | 
by , 18 years ago
| Attachment: | views_debug_py.2.diff added | 
|---|
comment:2 by , 18 years ago
| Has patch: | set | 
|---|---|
| Patch needs improvement: | set | 
| Triage Stage: | Design decision needed → Accepted | 
I like this idea a lot, but the patch uses a hackish way to determine which code is Django vs. your own code. Could this be improved? Also, the design should be improved -- we should get Wilson's thoughts on this.
comment:3 by , 18 years ago
| Component: | Metasystem → Core framework | 
|---|---|
| Summary: | debug template: Display my files bigger → Debug page traceback should highlight local code vs. framework code | 
comment:4 by , 18 years ago
| Cc: | added | 
|---|
comment:5 by , 17 years ago
| Owner: | changed from to | 
|---|
by , 17 years ago
| Attachment: | views_debug_py.3.diff added | 
|---|
Show bold filenames where file in INSTALLED_APPS
comment:6 by , 17 years ago
| Cc: | added | 
|---|---|
| Keywords: | aug22sprint added | 
| Patch needs improvement: | unset | 
The attachment views_debug_py.3.diff has a different way of deciding whether a file is "application code" vs. code from Django (and other libs, etc).  It gets the load path for each item in INSTALLED_APPS (excluding django.* items), and considers a file to be application code if it falls under one of those paths.  
I discussed this with Malcolm during the sprint and he felt this was a reasonable approach.  (After all, once you get outside the INSTALLED_APPS directories, it's pretty hard to decide what else to count as part of the application.)
Matching filenames are shown in bold.
comment:7 by , 17 years ago
| milestone: | → post-1.0 | 
|---|
comment:8 by , 17 years ago
thank you kevin for imporving my patch. I took your solution and changed only a bit:
- If the application model is defined in app/models/ instead of app/models.py, an other dirname() call is needed.
 - Bold line number and code line
 
by , 17 years ago
| Attachment: | views_debug_py.4.diff added | 
|---|
comment:10 by , 16 years ago
| Resolution: | → duplicate | 
|---|---|
| Status: | new → closed | 
#11834 has a more simple way to check for django vs. application code.
comment:11 by , 14 years ago
| Cc: | removed | 
|---|---|
| Easy pickings: | unset | 
| Severity: | → Normal | 
| Type: | → Uncategorized | 
| UI/UX: | unset | 
Better patch.