2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-04-28 05:36:46 +00:00

Merge pull request #35 from SchrodingersGat/admin-info

Add documentation for error logging and command-line interface
This commit is contained in:
Oliver 2020-11-11 14:39:26 +11:00 committed by GitHub
commit 842ee59105
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 54 additions and 0 deletions

View File

@ -25,6 +25,9 @@ An adminstation panel will be presented as shown below:
{% include 'img.html' %}
{% endwith %}
!!! info "Admin URL"
To directly access the admin iterface, append /admin/ to the InvenTree site URL - e.g. http://localhost:8000/admin/
### View Database Objects
Database objects can be listed and filtered directly. The image below shows an example of displaying existing part categories.

25
docs/admin/logs.md Normal file
View File

@ -0,0 +1,25 @@
---
title: Admin Shell
---
## Error Logs
Any critical server error logs are recorded to the database, and can be viewed by staff users using the admin interface.
In the admin interface, select the "Errors" view:
{% with id="admin_error_link", url="admin/admin_errors_link.png", description="Admin errors" %}
{% include 'img.html' %}
{% endwith %}
!!! note "URL"
Alternatively, navigate to the error list view at /admin/error_report/error/
A list of error logs is presented.
{% with id="admin_error_logs", url="admin/admin_errors.png", description="Error logs" %}
{% include 'img.html' %}
{% endwith %}
!!! note "Deleting Logs"
Error logs should be deleted periodically

24
docs/admin/shell.md Normal file
View File

@ -0,0 +1,24 @@
---
title: Admin Shell
---
## Python Shell
A Python shell interface is provided at /admin/shell/.
This interface allows advanced users direct access to the underlying database objects using Python.
!!! warning "Danger"
The scripting shell interface should only ever be used by advanced users. It requires intimate knowledge of the underlying InvenTree code, and improper use could easily result in corruption of data
!!! warning "Seriously"
If you are not 100% sure of what you are doing, do not use the shell interface
!!! info "Enabling Shell Mode"
The admin shell is (by default) only enabled when InvenTree is running in DEBUG mode
The shell interface allows Python queries to be run by the admin user, as shown below:
{% with id="admin_shell", url="admin/shell.png", description="Admin shell interface" %}
{% include 'img.html' %}
{% endwith %}

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -74,6 +74,8 @@ nav:
- User Permissions: admin/permissions.md
- Export Data: admin/export.md
- Import Data: admin/import.md
- Python Shell: admin/shell.md
- Error Logs: admin/logs.md
- Extend:
- API: extend/api.md
- Python Interface: extend/python.md