Giter VIP home page Giter VIP logo

django_transportation_management_system's Introduction

Django_Transportation_Management_System

基于Django实现的物流管理系统(TMS,Transportation Management System)

前几年工作时忙里偷闲写的练手项目。

特点

  • 前端基于Bootstrap 4框架和AdminLTE框架。
  • 使用MySQL作为数据库后端。
  • 实现了运单录入、发车出库、到货签收、客户签收等基本功能。
  • 拥有较为完善的报表功能和财务管理功能。
  • 可以通过后台界面对各个用户进行权限管理。

缺陷

  • 由于没有认清时代潮流,所以没有做前后端分离,本来是打算当作跳槽的敲门砖的,淦!
  • 由于前期纯粹是抱着练手的目的写的,边学边做,所以没有保留历史提交,但保留了上百个历史版本的备份
  • 由于知识匮乏,所以重复造了很多轮子。
  • 由于没有时间太懒,所以没有编写使用文档。

TODO

  • 实现打印货物标签和提货单的功能。(需要配合打印控件)
  • 实现消息功能。

依赖

  • 要求Python最低版本:v3.9+

  • 必要的第三方库

    • django
    • mysqlclient
    • openpyxl (用于实现报表导出功能)
  • 可选的第三方库

    • django-debug-toolbar (用于调试)
    • django-extensions (用于增强manage.py的功能)

Usage

  • 克隆仓库
  • 安装并配置好MySQL,过程不再赘述
  • cd到项目所在目录
  • 同步AdminLTE-3.0.5:
    • 运行git submodule init
    • 运行git submodule update --depth=1
  • 编辑PPWuliu/settings.py,手动配置以下这些项目:
    • SECRET_KEY
    • DATABASES
  • 手动创建数据库(数据库名称与PPWuliu/settings.pyDATABASES所配置的一致)
  • 导入测试数据:运行init_database.sh(测试数据中的账号密码:见此文件)

注意:在Windows环境下运行执行此shell脚本是不可能的(使用Git For Windows自带的mingw64执行也不行,会在git apply之后异常退出且没有任何提示),如果你一定要在Windows系统下运行此项目,请阅读init_database.sh并手动运行这些命令。

  • 运行manage.py runserver
  • Django的Admin管理后台是默认启用的,请自行创建超级用户

预览

django_transportation_management_system's People

Contributors

pzqqt 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

Watchers

 avatar  avatar

django_transportation_management_system's Issues

init_database.sh报错

抱歉我是个还在学习过程中的小白
环境为Ubuntu server 22.04.1 LTS, MySQL 5.7, Python 3.10, Django 4.1

直接运行init_database.sh错误提示:

error: patch failed: wuliu/common.py:46
error: wuliu/common.py: patch does not apply
error: patch failed: wuliu/urls.py:1
error: wuliu/urls.py: patch does not apply

手动更改文件后尝试运行runserver,错误提示为:

Exception in thread django-main-thread:
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1009, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 946, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/django/core/management/commands/runserver.py", line 137, in inner_run
self.check_migrations()
File "/usr/local/lib/python3.10/dist-packages/django/core/management/base.py", line 564, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/usr/local/lib/python3.10/dist-packages/django/db/migrations/executor.py", line 18, in init
self.loader = MigrationLoader(self.connection)
File "/usr/local/lib/python3.10/dist-packages/django/db/migrations/loader.py", line 58, in init
self.build_graph()
File "/usr/local/lib/python3.10/dist-packages/django/db/migrations/loader.py", line 235, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/usr/local/lib/python3.10/dist-packages/django/db/migrations/recorder.py", line 81, in applied_migrations
if self.has_table():
File "/usr/local/lib/python3.10/dist-packages/django/db/migrations/recorder.py", line 57, in has_table
with self.connection.cursor() as cursor:
File "/usr/local/lib/python3.10/dist-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/django/db/backends/base/base.py", line 323, in cursor
return self._cursor()
File "/usr/local/lib/python3.10/dist-packages/django/db/backends/base/base.py", line 299, in _cursor
self.ensure_connection()
File "/usr/local/lib/python3.10/dist-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/django/db/backends/base/base.py", line 282, in ensure_connection
self.connect()
File "/usr/local/lib/python3.10/dist-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/django/db/backends/base/base.py", line 262, in connect
conn_params = self.get_connection_params()
File "/usr/local/lib/python3.10/dist-packages/django/db/backends/mysql/base.py", line 218, in get_connection_params
if settings_dict["HOST"].startswith("/"):
AttributeError: 'NoneType' object has no attribute 'startswith'

看起来都是数据库错误,有没有可能直接手动导入数据库呢?
求大佬帮忙

作者,您新的更新终于解决了我的困惑

昨天半夜win10试了好久在那个init_database.sh上,还装了git,您恰好今天更新说到这个问题。您如果上传一个sql文件我用mysql导入会不会不需要init_database.sh了。我对sh的命令不是很会。我是一个学生,我们这学期要做一个医疗系统,很想学习下您的项目,觉得您写的很规整!还有您说现在主张前后端分离,但您这个不分离的其实刚好适合我们学习,因为我们的前端也不是很好。谢谢!

项目Run不起来

大神您好:
git clone 本项目之后,执行./init_database.sh会报错,错误如下:
image
ps: mac和linux下系统都尝试了,还是会报错

尝试不用shell来初始化项目,执行迁移命令makemigrations时,会报错表不存在:
image
项目migrations目录的除开init.py都删除了的
不知道您.gitignore中是否漏了本项目的必要文件,导致项目初始化不成功
希望您看到issues回复下,谢谢啦
本人邮箱: [email protected]

在最后manage.py runserver时报错

D:\github\Django_Transportation_Management_System>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

Exception in thread django-main-thread:
Traceback (most recent call last):
File "D:\Python39\lib\site-packages\django\template\backends\django.py", line 128, in get_package_libraries
module = import_module(entry[1])
File "D:\Python39\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 790, in exec_module
File "", line 228, in _call_with_frames_removed
File "D:\github\Django_Transportation_Management_System\wuliu\templatetags\wuliu_extras.py", line 6, in
from ..common import get_global_settings, is_logged_user_has_perm, get_logged_user, PERMISSION_TREE_LIST
ImportError: cannot import name 'PERMISSION_TREE_LIST' from partially initialized module 'wuliu.common' (most likely due to a circular import) (D:\github\Django_Transportation_Management_System\wuliu\common.py)

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

Traceback (most recent call last):
File "D:\Python39\lib\threading.py", line 950, in _bootstrap_inner
self.run()
File "D:\Python39\lib\threading.py", line 888, in run
self._target(*self._args, **self._kwargs)
File "D:\Python39\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "D:\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 134, in inner_run
self.check(display_num_errors=True)
File "D:\Python39\lib\site-packages\django\core\management\base.py", line 475, in check
all_issues = checks.run_checks(
File "D:\Python39\lib\site-packages\django\core\checks\registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "D:\Python39\lib\site-packages\django\core\checks\templates.py", line 60, in check_for_template_tags_with_the_same_name
for module_name, module_path in get_template_tag_modules():
File "D:\Python39\lib\site-packages\django\template\backends\django.py", line 105, in get_template_tag_modules
for name in get_package_libraries(pkg):
File "D:\Python39\lib\site-packages\django\template\backends\django.py", line 130, in get_package_libraries
raise InvalidTemplateLibrary(
django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'wuliu.templatetags.wuliu_extras': cannot import name 'PERMISSION_TREE_LIST' from partially initialized module 'wuliu.common' (most likely due to a circular import) (D:\github\Django_Transportation_Management_System\wuliu\common.py)

请问这是什么原因呢

Django和Python环境版本

请问一下作者项目中使用的Python和Django是什么版本的,可以告诉一下嘛,可以有偿!

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.