简单的django应用程序,用于通过http/https共享文件。
djangosmartshare的Python项目详细描述
Django智能共享
一个简单的django应用程序,用于通过http/https共享文件。
attention :
on test, not bug free. i just started this project for fun, so will be glad if you use and report issues on this project.
要求
- python>;=3.5
- django>;=2
安装
使用pip
:
pip install djangosmartshare
将smartshare
添加到INSTALLED_APPS
中的settings.py
:
INSTALLED_APPS=[...,'smartshare',...,]
在项目中包含smartshare.urls
urls.py
:
fromdjango.urlsimportpath,includeurlpatterns=[...,path('',include('smartshare.urls')),...,]
运行migrate
以生成相关数据库表:
python3 manage.py migrate
功能
简单地说,您可以通过http/https共享本地系统上的任何目录:就像文件浏览器一样。
<^ >在{{CD8}}模型中,通过添加一个新的位置,系统将检查路径是否存在,因此您可以为每个^ {STR 1 } $位置<强>对象分隔3个不同的用户类型的以下权限。admins,users(指普通用户)和anonymouse访问者(公共):attention :
- if you share a directory, inside another shared directory, neither Base Directory nor Sub Directory will not change each other permissions. the deepest available Sub Directory Location object permissions will be used for each directory.
- the root path
/
is not available.- only directories path are allowed to be shared, not files.
- commands will run as logged-in user on local system, so even if a permission like Can Delete be True, on a directory that need superuser sudo permission, the command will not effect, for security reasons.
permission | description |
---|---|
Active | wheather to show this directory for the allowed user or not. |
Show Files | user can view Files in directory. ( only view, nothing more ) |
Show Directories | user can view Directories in directory. |
Show Hidden Files | same as Files, fore Hidden Files. |
Show Hidden Directories | same as Directories, for Hidden Directories |
Can Download | if this permission be ^{ |
Can Upload | if this permission be ^{ |
Can Delete | if this permission be ^{ |
Can Create | if this permission be ^{ |
这个应用程序有一个简单的响应式前端设计,使用bootstrap 4框架创建。默认情况下,所需的静态文件位于app目录之外的static/css
和static/js
目录中,以避免重复。如果您计划使用此应用程序,请确保包含这些文件,或将share/templates/base.html
样式和脚本替换为bootstrap 4sdn。
添加此用户进行测试:
username | password | is superuser |
---|---|---|
admin | adminadmin | yes |
user | useruser | no |
待办事项
计划在下一版本中添加这些功能:
- []添加run命令功能。
- []添加copy和move。
- []添加multi upload。
- []添加多选文件和目录下载或删除功能。
- []添加preview和edit能力。
- []添加或上载时为重复的文件和目录添加权限。
- []更改dirs.html添加upload的模板,delete,add表单。
- []重写视图定义。
- []重写响应模板以获得更好的UX/UI。