1 Star 6 Fork 3

bytesc / django_management_system_template

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

django_management_system_template

基于 Django 和 Mysql 的管理系统模板 ✨:后台管理系统,OA ,表单系统,管理员系统,数据库管理系统模板,数据库访问模板。前端后端不分离,Web 应用增删改查数据库。前端,Web应用,mysql数据库。详细注释,高度封装,易复用。

个人网站:www.bytesc.top

个人博客:blog.bytesc.top

🔔 如有项目相关问题,欢迎在本项目提出issue,我一般会在 24 小时内回复。

界面展示

首页 img

登录 img

使用 cookie 保存登录状态。未登录的用户只能访问首页和登录页面。否则重定向到登录页面。 img

用户管理 img

添加用户 img

部门管理 img

号码管理 img

编辑号码 img

任务管理 img

使用方法

安装依赖

pip install -r requirement.txt

打开 setting.py,找到83行左右。

如果使用 mysql 就使用下面一个 DATABASES,把上面的注释掉。 在里面填写自己 mysql 服务器的 'USER''PASSWORD''HOST''PORT'。 手动创建和 'NAME' 字段内容同名的数据库

如果使用 sqlite 就使用上面一个 DATABASES,把下面的注释掉即可。

# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases

# DATABASES = {
#     "default": {
#         "ENGINE": "django.db.backends.sqlite3",
#         "NAME": BASE_DIR / "db.sqlite3",
#     }
# }

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'djangolearntest',
        'USER': 'root',
        'PASSWORD': '123456',
        'HOST': '127.0.0.1',
        'PORT': '3306',
    }
}

初始化数据库

python manage.py makemigrations
python manage.py migrate

进入django shell

python manage.py shell

手动添加管理员

import app01.models
app01.models.MyAdmin.objects.create(id="admin", user_name="admin", password="9b7bdac3cbd4af86551d5f27d64a5291")
exit()

运行

python manage.py runserver

如果默认 8000 端口被占用,换端口即可

python manage.py runserver 8008

登录用户名是admin,密码是12345678 img

项目结构

.
│  .gitignore
│  cmd.txt
│  guide.md
│  LICENSE
│  manage.py
│  README.md
│  requirement.txt
├─app01
│  │  admin.py
│  │  apps.py
│  │  models.py
│  │  tests.py
│  │  views.py
│  │  __init__.py
│  │
│  └─ middle_ware
│     └─ my_auth.py
├─srcs
│  │  ├─forms
│  │  │  └─ form.py
│  │  │
│  │  └─views
│  │         account.py
│  │         departments.py
│  │         myadmin.py
│  │         number.py
│  │         order.py
│  │         task.py
│  │         user.py
│  ├─static
│  │
│  ├─templates
│  │  │  change.html
│  │  │  error.html
│  │  │  index.html
│  │  │  layout.html
│  │  │
│  │  ├─account
│  │  │      login.html
│  │  │
│  │  ├─departments
│  │  │      depart_add.html
│  │  │      depart_edit.html
│  │  │      depart_list.html
│  │  │
│  │  ├─myadmin
│  │  │      myadmin_list.html
│  │  │
│  │  ├─numbers
│  │  │      num_add.html
│  │  │      num_edit.html
│  │  │      num_list.html
│  │  │
│  │  ├─order
│  │  │      order_list.html
│  │  │
│  │  ├─task
│  │  │      task_list.html
│  │  │
│  │  └─users
│  │          user_add.html
│  │          user_edit.html
│  │          user_list.html
│  │
│  └─ utils
│    bootstrap_modelform.py
│    md5.py
│    page_nav.py

├─Learntest
│     asgi.py
│     settings.py
│     urls.py
│     wsgi.py

└─ readme_img
MIT License Copyright (c) 2023 bytesc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

✨ 基于 Django 和 Mysql 的信息管理系统模板 ✨。后台管理系统,OA ,表单系统,管理员系统,数据库管理系统模板,数据库访问模板。前端后端不分离,Web 应用增删改查数据库。详细注释,高度封装,易复用。 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/bytesc/django_management_system_template.git
git@gitee.com:bytesc/django_management_system_template.git
bytesc
django_management_system_template
django_management_system_template
master

搜索帮助