Git Product home page Git Product logo

caoqianming / django-vue-admin Goto Github PK

View Code? Open in Web Editor NEW
859.0 859.0 252.0 3.44 MB

基于RBAC模型权限控制的中小型应用的基础开发平台,前后端分离,后端采用django+django-rest-framework,前端采用vue+ElementUI,移动端采用uniapp+uView(可发布h5和小程序).

License: MIT License

JavaScript 14.45% HTML 0.12% Python 79.79% SCSS 1.18% CSS 4.40% Dockerfile 0.04% Shell 0.02%
django django-rest-framework element-ui python rbac vue workflow

django-vue-admin's People

Contributors

caoqianming avatar dependabot[bot] avatar github-user112 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-vue-admin's Issues

npm run dev 报错

Error: PostCSS plugin autoprefixer requires PostCSS 8. Update PostCSS or downgrade this plugin.

权限bug

permission.py文件

    def has_permission(self, request, view):
        """
        权限校验逻辑
        :param request:
        :param view:
        :return:
        """
        if not request.user:
            perms = ['visitor'] # 如果没有经过认证,视为游客
        else:
            perms = cache.get(request.user.username + '__perms')
        if not perms:
            perms = get_permission_list(request.user)
        if perms:
            if 'admin' in perms:
                return True
            elif not hasattr(view, 'perms_map'):
                return True
            else:
                perms_map = view.perms_map
                _method = request._request.method.lower()
                if perms_map:
                    for key in perms_map:
                        
                        if key == _method or key == '*':
                            # 这里*号判断有问题
                            if perms_map[key] in perms or perms_map[key] == '*':
                                return True
                return False
        else:
            return False

向您请教

您好,已star,下载运行后发现,新增加用户时,不知道该用户的密码是多少 可否告知一下

关于菜单颜色

我现在有个地方自己不会处理,就是菜单颜色,代码里是读取的variables.scss配置的颜色,我现在想改成在编译的时候通过我传入的参数设置颜色,我看element ui的菜单是有默认颜色和自定义颜色嘛,我现在就想有个这么的设置,比如我在.env.production里添加一个参数,在编译的时候通过这个参数判断是用默认的菜单颜色或者是自定义颜色,这个该怎么弄呢,scss这种我不太不会弄,我同一套代码想通过颜色区分开,部署了两个项目。

关于周期性任务

关于定时任务
使用celery以及django_celery_beat包实现

需要安装redis并在默认端口启动, 并启动worker以及beat

进入虚拟环境并启动worker: celery -A server worker -l info -P eventlet, linux系统不用加-P eventlet

进入虚拟环境并启动beat: celery -A server beat -l info

我注册了任务,配置了周期性任务每分钟运行,但是就是没能成功运行,不知道是哪里的问题。
worker和beat都启动了,手动触发show就能执行。
能麻烦解答一下吗
感谢

你好,问一个问题。

关于extra action的权限处理

作者你这个权限管理我有一点不清楚。在你的userviewset里面定义一个info,我该怎么做才能把info加到rbac里面呢?

    # perms_map={'get':'*'}, 自定义action控权
    @action(methods=['get'], detail=False, url_name='my_info', permission_classes=[IsAuthenticated])
    def info(self, request, pk=None):

你的info加了一个permission,permission_classes=[IsAuthenticated],这一点我也很清楚。不过怎么加到rbac里面呢?

关于cache

你把权限字典写在cache里面,但是更改权限时候并不是实时生效的(我自己测试是这个样子的),要不要加个信号保证cache里的数据实时更新呢?

前端报错

image

image

./src/styles/index.scss (./node_modules/_css-loader@1.0.1@css-loader??ref--8-oneOf-3-1!./node_modules/_postcss-loader@3.0.0@postcss-loader/src??ref--8-oneOf-3-2!./node_modules/_sass-loader@7.3.1@sass-loader/dist/cjs.js??ref--8-oneOf-3-3!./src/styles/index.scss)
Module build failed (from ./node_modules/_sass-loader@7.3.1@sass-loader/dist/cjs.js):
Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (93)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1

您好,想问一下接口的设计情况

抱歉打扰了,但是还是想请教您一下
关于这套模板里面的前后端数据接口
image
image
image
咨询一下关于接口的设计情况,动态拿到权限然后做侧边栏的筛选
基于初始化data用户信息,做的接口设计拿到perms权限,但是我在测试的时候,发现并不是很明确,想请教您

更换mysql数据库不行

Traceback (most recent call last):
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\db\backends\utils.py", line 86, in _execute
return self.cursor.execute(sql, params)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\db\backends\mysql\base.py", line 74, in execute
return self.cursor.execute(query, args)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\MySQLdb\cursors.py", line 206, in execute
res = self._query(query)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\MySQLdb\cursors.py", line 319, in _query
db.query(q)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\MySQLdb\connections.py", line 259, in query
_mysql.connection.query(self, query)
MySQLdb._exceptions.ProgrammingError: (1146, "Table 'nspmdb.django_content_type' doesn't exist")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "manage.py", line 21, in
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\core\management_init_.py", line 401, in execute_from_command_line
utility.execute()
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\core\management_init_.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\core\management\base.py", line 328, in run_from_argv
self.execute(*args, **cmd_options)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\core\management\base.py", line 369, in execute
output = self.handle(*args, **options)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\core\management\commands\loaddata.py", line 72, in handle
self.loaddata(fixture_labels)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\core\management\commands\loaddata.py", line 114, in loaddata
self.load_label(fixture_label)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\core\management\commands\loaddata.py", line 181, in load_label
obj.save(using=self.using)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\core\serializers\base.py", line 223, in save
models.Model.save_base(self.object, using=using, raw=True, **kwargs)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\db\models\base.py", line 784, in save_base
force_update, using, update_fields,
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\db\models\base.py", line 865, in _save_table
forced_update)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\db\models\base.py", line 917, in _do_update
return filtered._update(values) > 0
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\db\models\query.py", line 771, in _update
return query.get_compiler(self.db).execute_sql(CURSOR)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\db\models\sql\compiler.py", line 1500, in execute_sql
cursor = super().execute_sql(result_type)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\db\models\sql\compiler.py", line 1152, in execute_sql
cursor.execute(sql, params)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\db\backends\utils.py", line 100, in execute
return super().execute(sql, params)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\db\backends\utils.py", line 68, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\db\backends\utils.py", line 77, in _execute_with_wrappers
return executor(sql, params, many, context)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\db\backends\utils.py", line 86, in _execute
return self.cursor.execute(sql, params)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\db\utils.py", line 90, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\db\backends\utils.py", line 86, in _execute
return self.cursor.execute(sql, params)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\django\db\backends\mysql\base.py", line 74, in execute
return self.cursor.execute(query, args)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\MySQLdb\cursors.py", line 206, in execute
res = self._query(query)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\MySQLdb\cursors.py", line 319, in _query
db.query(q)
File "E:\pysource\django-vue-admin\server\venv\lib\site-packages\MySQLdb\connections.py", line 259, in query
_mysql.connection.query(self, query)
django.db.utils.ProgrammingError: Problem installing fixture 'E:\pysource\django-vue-admin\server\db.json': Could not load contenttypes.ContentType(pk=1): (1146, "Table 'nspmdb.django_content_type' doesn't exist")

(venv) E:\pysource\django-vue-admin\server>

系统使用说明

能不能简单介绍一下系统添加菜单的方法,和使用,还有接口api

Cannot run under mac os or linux.

 allen@MacBook  ~/dev/django-vue-admin/client   master ±  pnpm run dev

> [email protected] dev /Users/allen/dev/django-vue-admin/client
> set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve

 INFO  Starting development server...
 10% building 2/2 modules 0 activeℹ 「wds」: Project is running at http://localhost:9528/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /Users/allen/dev/django-vue-admin/client/public
ℹ 「wds」: 404s will fallback to /index.html
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:68:19)
    at Object.createHash (node:crypto:138:10)
    at module.exports (/Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/util/createHash.js:90:53)
    at NormalModule._initBuildHash (/Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/NormalModule.js:401:16)
    at handleParseError (/Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/NormalModule.js:449:10)
    at /Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/NormalModule.js:481:5
    at /Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/NormalModule.js:342:12
    at /Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at /Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3)
 10% building 2/5 modules 3 active ...r/client/index.js?http://localhost:9528node:internal/crypto/hash:68
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:68:19)
    at Object.createHash (node:crypto:138:10)
    at module.exports (/Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/util/createHash.js:90:53)
    at NormalModule._initBuildHash (/Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/NormalModule.js:401:16)
    at handleParseError (/Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/NormalModule.js:449:10)
    at /Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/NormalModule.js:481:5
    at /Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/NormalModule.js:342:12
    at /Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at /Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

after run export NODE_OPTIONS=--openssl-legacy-provider, there's a new error on npm run dev:

Failed to compile.

./src/main.js
Module build failed (from ./node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/babel-loader/lib/index.js):
TypeError: this.getOptions is not a function
    at Object.loader (/Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/babel-loader/lib/index.js:44:28)
    at Object.<anonymous> (/Users/allen/dev/django-vue-admin/client/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/babel-loader/lib/index.js:39:12)

前端安装依赖

在使用npm install --registry=https://registry.npm.taobao.org时报错
image
image
服务器是windows,python3

关于权限认证

你好,你这个权限是不是没有完善?
我建立一个角色--测试角色,没有给测试角色打开/user/role的权限,但实测可以打开。
这个不能上传图片,,,,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.