Django app to explore directory.
Project description
Django File Explorer
A django app to explore the host machine directory.
It will provide following features:
- Allow user login
- Allow to set roles for user to delete and download directories.
- Allow user to upload single file.
Installation
Following command will help to install the package.
pip install django-file-explorer
Setup
- Add the app to setting.py file in INSTALLED_APPS section.
INSTALLED_APPS = [
...
'explorer.apps.ExplorerConfig',
]
- If logging is required then add the following information to settings.py file:
EXPLORER = {
'log_dir': MEDIA_ROOT / 'logs',
'log_file': MEDIA_ROOT / 'logs' / 'access.log'
}
log_dir: This is the path where multiple user log files will be created. Each file contain information about the single user.
log_file: Path to a file containing log information.
Following is the example of single log line.
[25/Feb/2023 12:44:43:PM] GET | 200 | <<username>> | <<action>> | <<volume>> | <<pageNumber>> | <<location>> | <<checkboxIdx>> |
- Migrate the changes
python manage.py migrate
I you are managing DB separate then make following tables in database:
explorer_action
| Name | Position | Data type | Length | Relation | Not NULL? | Type |
|---|---|---|---|---|---|---|
| id | 1 | bigint | PK | true | None | |
| name | 2 | character varying | 120 | true | None | |
| creation_date | 3 | timestamp with time zone | true | None |
Add following actions to table:
- download
- delete
- upload
- unzip
Note: All PK are auto incremental.
explorer_volume
| Name | Position | Data type | Length | Relation | Not NULL? | Type |
|---|---|---|---|---|---|---|
| id | 1 | bigint | PK | true | None | |
| name | 2 | character varying | 120 | true | None | |
| path | 3 | character varying | 2048 | true | None | |
| active | 4 | boolean | true | None | ||
| creation_date | 5 | timestamp with time zone | true | None |
explorer_userrole
| Name | Position | Data type | Length | Relation | Not NULL? | Type |
|---|---|---|---|---|---|---|
| id | 1 | bigint | PK | true | None | |
| creation_date | 2 | timestamp with time zone | true | None | ||
| user_id | 3 | integer | FK | true | None | |
| volume_id | 4 | bigint | FK | true | None |
Foreign Key Constraints
| Name | Columns | Referenced Table |
|---|---|---|
| user_id | (user_id) -> (id) | auth_user |
| volume_id | (volume_id) -> (id) | explorer_volume |
explorer_userrole_actions
| Name | Position | Data type | Length | Relation | Not NULL? | Type |
|---|---|---|---|---|---|---|
| id | 1 | bigint | PK | true | None | |
| userrole_id | 2 | bigint | FK | true | None | |
| action_id | 3 | bigint | FK | true | None |
Foreign Key Constraints
| Name | Columns | Referenced Table |
|---|---|---|
| userrole_id | (userrole_id) -> (id) | explorer_userrole |
| action_id | (action_id) -> (id) | explorer_action |
- Add URL to urls.py file.
from django.urls import include
urlpatterns = [
...
path('explorer/', include('explorer.urls'), name='explorer')
]
Add volumes to database by specifying its name and path. After that define the user roles for specific volume in user roles table.
Run
Go to explorer url SERVER:PORT/explorer and explore the volumes.
Author
Tahir Rafique
Releases
| Date | Version | Summary |
|---|---|---|
| 12-Jul-23 | v1.6.1 | Adding local bootstrap 4.6.2 files. This will correct the wrong appearance of UI when there is no Internet connection. |
| 4-Jul-23 | v1.6.0 | Adding file unzip option. |
| 16-Jun-23 | v1.5.0 | Separating vscode icons from this app. |
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 django-file-explorer-1.6.1.tar.gz.
File metadata
- Download URL: django-file-explorer-1.6.1.tar.gz
- Upload date:
- Size: 69.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67d42f5fb6ea407bfc53465bffe9c183f36d18f981edd8f228fa5de334562681
|
|
| MD5 |
2150f2bd57a90105fe9b6b84fa91a44e
|
|
| BLAKE2b-256 |
18f5aa71f6842ee4f5389bd113a5369df4d073903484c14ae82fc982c33e052c
|
File details
Details for the file django_file_explorer-1.6.1-py3-none-any.whl.
File metadata
- Download URL: django_file_explorer-1.6.1-py3-none-any.whl
- Upload date:
- Size: 83.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcabb5bc96bc2b394692c7043b0343a3ed6a12190fabdab190200fc9c978a8ce
|
|
| MD5 |
3bcff9012004f3d0840aaf07b7d7bd08
|
|
| BLAKE2b-256 |
bc39d4f4ad19d99897195b92334ac1bec15a74eebd8d8823721e3005d2dca77e
|