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',
]
- 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
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
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
django-file-explorer-1.2.2.tar.gz
(20.2 kB
view hashes)
Built Distribution
Close
Hashes for django-file-explorer-1.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f68e3948a6be38456d96ff8935db331174da96db143f39213b363de3c9fc1d8f |
|
MD5 | 12c1ab94c3dc86deb2a3f794c2004e68 |
|
BLAKE2b-256 | 7acb7da6613ca8a5f575fab8af8ab3e4e74bc0242d88246d5175cec695049e3a |
Close
Hashes for django_file_explorer-1.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d88a824196b939878207cc85eaa93cd455052bbe2e3d35a96101191c4132bda8 |
|
MD5 | 55eefac0f2b02ccd226d59991e1aa499 |
|
BLAKE2b-256 | b765f3fd2ce2ce90d5e026d140c2667bdf6904bc1a102da630f700243b39e947 |