简单的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.urlsurls.py

fromdjango.urlsimportpath,includeurlpatterns=[...,path('',include('smartshare.urls')),...,]

运行migrate以生成相关数据库表:

python3 manage.py migrate

功能

简单地说,您可以通过http/https共享本地系统上的任何目录:就像文件浏览器一样。

<^ >在{{CD8}}模型中,通过添加一个新的位置,系统将检查路径是否存在,因此您可以为每个^ {STR 1 } $位置<强>对象分隔3个不同的用户类型的以下权限。adminsusers(指普通用户)和anonymouse访问者(公共):

attention :

  1. 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.
  2. the root path / is not available.
  3. only directories path are allowed to be shared, not files.
  4. 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.
permissiondescription
Activewheather to show this directory for the allowed user or not.
Show Filesuser can view Files in directory. ( only view, nothing more )
Show Directoriesuser can view Directories in directory.
Show Hidden Filessame as Files, fore Hidden Files.
Show Hidden Directoriessame as Directories, for Hidden Directories
Can Downloadif this permission be ^{}, user can download shared directory and it's subdirectories in compressed files as zip, tar, tar.gz and tar.bz2. an also user allowed to download any Files in directory and it's subdirectories.
Can Uploadif this permission be ^{}, user can upload Files in directory and it's subdirectories.
Can Deleteif this permission be ^{}, a Delete button will be showed for each subdirectories and files in directory, so user can delete them.
Can Createif this permission be ^{}, an Add button will be showed for Directories and Files, so user can add new directory, or a file with it's content.

这个应用程序有一个简单的响应式前端设计,使用bootstrap 4框架创建。默认情况下,所需的静态文件位于app目录之外的static/cssstatic/js目录中,以避免重复。如果您计划使用此应用程序,请确保包含这些文件,或将share/templates/base.html样式和脚本替换为bootstrap 4sdn。

添加此用户进行测试:

usernamepasswordis superuser
adminadminadminyes
useruseruserno

待办事项

计划在下一版本中添加这些功能:

  • []添加run命令功能。
  • []添加copymove
  • []添加multi upload
  • []添加多选文件和目录下载或删除功能。
  • []添加previewedit能力。
  • []添加或上载时为重复的文件和目录添加权限
  • []更改dirs.html添加upload的模板deleteadd表单。
  • []重写视图定义。
  • []重写响应模板以获得更好的UX/UI。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
具有多用户OU和多访问CNs的java Spring LDAP身份验证   java分配的变量神秘地变为null   java比较两个表或文本文件,并用行号和列输出差异   java如何在同一构建目录中设置netbeans中的文件路径?   java如何在avro模式中定义byte[]和LocalDateTime?   java在多个活动和片段中使用相同的微调器。实施它的最佳方式是什么?   java使用OOPS扩展已编写的类   java如何在特定于文件的基础上禁用Eclipse中的编译器警告?   java将字符串转换为日期的格式不正确   Java文件从一台服务器复制到另一台服务器   java Jacksonal和JacksonApperasl的最新jar版本是什么?   java如何在使用selenium chrome web驱动程序时禁用chrome中的身份验证提示   java是什么。推荐人和推荐人。Eclipse工作区中的元数据以及它们是否应该在设备之间同步?   java我应该把sqlite db文件放在哪里,这样我的jar就可以访问它了?这对连接字符串有何影响?   java如何在选择单元格时设置JTable标题背景色   java Cassandra 2 Hector:复合行键上的范围切片查询返回空行   java方法注释继承   Python字节对象与java   java Android和从sqlite数据库加载listview