恢复Django 项目

随笔记录

目录

1. 重建Mysql DB

2. 启动Django 项目

2.1 确保你的系统上已安装pip工具。你可以使用以下命令来检查pip是否已安装

2.2  安装Packages

2.2.1 安装Django

2.2.2 安装pymysql

2.2.3 安装 kafka

2.2.4 安装 requests

2.2.5 安装simplepro

2.2.6 安装libjpeg-devel

2.2.7 重新安装simplepro

2.2.8 安装faker 

2.3 所有packages安装完成后,再次运行你的Python脚本

2.4 启动Django 项目

2.5 浏览器访问

3. 添加supervisord 守护进程


1. 重建Mysql DB

2. 启动Django 项目


[root@localhost Init_Sys]# pwd
/home/TestEvn/Risk_Init_V2/Init_Sys
[root@localhost Init_Sys]# 
[root@localhost Init_Sys]# 
[root@localhost Init_Sys]# ll
total 844
drwxr-xr-x. 9 root root    272 Apr 21  2023 Initapp
-rw-r--r--. 1 root root 853282 Apr 21  2023 Initapp.zip
drwxr-xr-x. 3 root root    136 Apr 21  2023 Init_Sys
-rw-r--r--. 1 root root   1022 Apr 21  2023 manage.py
-rw-r--r--. 1 root root    276 Apr 21  2023 Start_Init.sh
[root@localhost Init_Sys]# 
[root@localhost Init_Sys]# python3 manage.py makemigrations Initapp
Traceback (most recent call last):File "manage.py", line 10, in <module>from django.core.management.commands.runserver import Command as Runserver
ModuleNotFoundError: No module named 'django'
[root@localhost Init_Sys]# 
2.1 确保你的系统上已安装pip工具。你可以使用以下命令来检查pip是否已安装
# 没有Django package, 安装Django[root@localhost Init_Sys]# 
[root@localhost Init_Sys]# 
[root@localhost Init_Sys]# pip3 --version
pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)
[root@localhost Init_Sys]# 
[root@localhost Init_Sys]# 
2.2  安装Packages
2.2.1 安装Django
# 如果你想安装特定版本的Django,请将上述命令中的"django"替换为所需版本的Django[root@localhost Init_Sys]# 
[root@localhost Init_Sys]# pip3 install django
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting djangoDownloading https://files.pythonhosted.org/packages/c9/69/72663af69f1a70fa186813220c8ec5ce7f9056b6d987077e2c38ed794bee/Django-3.2.23-py3-none-any.whl (7.9MB)100% |████████████████████████████████| 7.9MB 26kB/s 
Collecting asgiref<4,>=3.3.2 (from django)Downloading https://files.pythonhosted.org/packages/fe/66/577f32b54c50dcd8dec38447258e82ed327ecb86820d67ae7b3dea784f13/asgiref-3.4.1-py3-none-any.whl
Collecting pytz (from django)Downloading https://files.pythonhosted.org/packages/32/4d/aaf7eff5deb402fd9a24a1449a8119f00d74ae9c2efa79f8ef9994261fc2/pytz-2023.3.post1-py2.py3-none-any.whl (502kB)100% |████████████████████████████████| 512kB 30kB/s 
Collecting sqlparse>=0.2.2 (from django)Downloading https://files.pythonhosted.org/packages/98/5a/66d7c9305baa9f11857f247d4ba761402cea75db6058ff850ed7128957b7/sqlparse-0.4.4-py3-none-any.whl (41kB)100% |████████████████████████████████| 51kB 24kB/s 
Collecting typing-extensions; python_version < "3.8" (from asgiref<4,>=3.3.2->django)Downloading https://files.pythonhosted.org/packages/45/6b/44f7f8f1e110027cf88956b59f2fad776cca7e1704396d043f89effd3a0e/typing_extensions-4.1.1-py3-none-any.whl
Installing collected packages: typing-extensions, asgiref, pytz, sqlparse, django
Successfully installed asgiref-3.4.1 django-3.2.23 pytz-2023.3.post1 sqlparse-0.4.4 typing-extensions-4.1.1
[root@localhost Init_Sys]# 
2.2.2 安装pymysql
[root@localhost Init_Sys]# pip3 install pymysql
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting pymysqlDownloading https://files.pythonhosted.org/packages/4f/52/a115fe175028b058df353c5a3d5290b71514a83f67078a6482cff24d6137/PyMySQL-1.0.2-py3-none-any.whl (43kB)100% |████████████████████████████████| 51kB 268kB/s 
Installing collected packages: pymysql
Successfully installed pymysql-1.0.2
[root@localhost Init_Sys]# 
2.2.3 安装 kafka
[root@localhost Init_Sys]# pip3 install kafka-python
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting kafka-pythonDownloading https://files.pythonhosted.org/packages/75/68/dcb0db055309f680ab2931a3eeb22d865604b638acf8c914bedf4c1a0c8c/kafka_python-2.0.2-py2.py3-none-any.whl (246kB)100% |████████████████████████████████| 256kB 1.0MB/s 
Installing collected packages: kafka-python
Successfully installed kafka-python-2.0.2
[root@localhost Init_Sys]# 
[root@localhost Init_Sys]# 
2.2.4 安装 requests
[root@localhost Init_Sys]# 
[root@localhost Init_Sys]# pip3 install requests
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting requestsDownloading https://files.pythonhosted.org/packages/2d/61/08076519c80041bc0ffa1a8af0cbd3bf3e2b62af10435d269a9d0f40564d/requests-2.27.1-py2.py3-none-any.whl (63kB)100% |████████████████████████████████| 71kB 312kB/s 
Collecting urllib3<1.27,>=1.21.1 (from requests)Downloading https://files.pythonhosted.org/packages/b0/53/aa91e163dcfd1e5b82d8a890ecf13314e3e149c05270cc644581f77f17fd/urllib3-1.26.18-py2.py3-none-any.whl (143kB)100% |████████████████████████████████| 153kB 571kB/s 
Collecting certifi>=2017.4.17 (from requests)Downloading https://files.pythonhosted.org/packages/64/62/428ef076be88fa93716b576e4a01f919d25968913e817077a386fcbe4f42/certifi-2023.11.17-py3-none-any.whl (162kB)100% |████████████████████████████████| 163kB 1.6MB/s 
Collecting charset-normalizer~=2.0.0; python_version >= "3" (from requests)Downloading https://files.pythonhosted.org/packages/06/b3/24afc8868eba069a7f03650ac750a778862dc34941a4bebeb58706715726/charset_normalizer-2.0.12-py3-none-any.whl
Collecting idna<4,>=2.5; python_version >= "3" (from requests)Downloading https://files.pythonhosted.org/packages/c2/e7/a82b05cf63a603df6e68d59ae6a68bf5064484a0718ea5033660af4b54a9/idna-3.6-py3-none-any.whl (61kB)100% |████████████████████████████████| 71kB 2.3MB/s 
Installing collected packages: urllib3, certifi, charset-normalizer, idna, requests
Successfully installed certifi-2023.11.17 charset-normalizer-2.0.12 idna-3.6 requests-2.27.1 urllib3-1.26.18
[root@localhost Init_Sys]# 
2.2.5 安装simplepro
[root@localhost Init_Sys]# pip3 install simplepro
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting simpleproUsing cached https://files.pythonhosted.org/packages/b5/a2/7d4fc4d98ff39d5453f4f5c7be8c07c593e6f863e0accdefa88f56916622/simplepro-7.2.2.tar.gz
Requirement already satisfied: django>=2.1 in /usr/local/lib64/python3.6/site-packages (from simplepro)
Requirement already satisfied: django-simpleui>=2023.11.15 in /usr/local/lib/python3.6/site-packages (from simplepro)
Requirement already satisfied: django-import-export in /usr/local/lib/python3.6/site-packages (from simplepro)
Requirement already satisfied: requests in /usr/local/lib/python3.6/site-packages (from simplepro)
Requirement already satisfied: rsa in /usr/local/lib/python3.6/site-packages (from simplepro)
Requirement already satisfied: psutil in /usr/local/lib64/python3.6/site-packages (from simplepro)
Collecting pillow (from simplepro)Using cached https://files.pythonhosted.org/packages/7d/2a/2fc11b54e2742db06297f7fa7f420a0e3069fdcf0e4b57dfec33f0b08622/Pillow-8.4.0.tar.gz
Requirement already satisfied: sqlparse>=0.2.2 in /usr/local/lib/python3.6/site-packages (from django>=2.1->simplepro)
Requirement already satisfied: pytz in /usr/local/lib/python3.6/site-packages (from django>=2.1->simplepro)
Requirement already satisfied: asgiref<4,>=3.3.2 in /usr/local/lib/python3.6/site-packages (from django>=2.1->simplepro)
Requirement already satisfied: diff-match-patch in /usr/local/lib/python3.6/site-packages (from django-import-export->simplepro)
Requirement already satisfied: tablib[html,ods,xls,xlsx,yaml]>=3.0.0 in /usr/local/lib/python3.6/site-packages (from django-import-export->simplepro)
Requirement already satisfied: idna<4,>=2.5; python_version >= "3" in /usr/local/lib/python3.6/site-packages (from requests->simplepro)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.6/site-packages (from requests->simplepro)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/site-packages (from requests->simplepro)
Requirement already satisfied: charset-normalizer~=2.0.0; python_version >= "3" in /usr/local/lib/python3.6/site-packages (from requests->simplepro)
Requirement already satisfied: pyasn1>=0.1.3 in /usr/local/lib/python3.6/site-packages (from rsa->simplepro)
Requirement already satisfied: typing-extensions; python_version < "3.8" in /usr/local/lib/python3.6/site-packages (from asgiref<4,>=3.3.2->django>=2.1->simplepro)
Requirement already satisfied: markuppy; extra == "html" in /usr/local/lib/python3.6/site-packages (from tablib[html,ods,xls,xlsx,yaml]>=3.0.0->django-import-export->simplepro)
Requirement already satisfied: odfpy; extra == "ods" in /usr/local/lib/python3.6/site-packages (from tablib[html,ods,xls,xlsx,yaml]>=3.0.0->django-import-export->simplepro)
Requirement already satisfied: xlrd; extra == "xls" in /usr/local/lib/python3.6/site-packages (from tablib[html,ods,xls,xlsx,yaml]>=3.0.0->django-import-export->simplepro)
Requirement already satisfied: xlwt; extra == "xls" in /usr/local/lib/python3.6/site-packages (from tablib[html,ods,xls,xlsx,yaml]>=3.0.0->django-import-export->simplepro)
Requirement already satisfied: openpyxl>=2.6.0; extra == "xlsx" in /usr/local/lib/python3.6/site-packages (from tablib[html,ods,xls,xlsx,yaml]>=3.0.0->django-import-export->simplepro)
Requirement already satisfied: pyyaml; extra == "yaml" in /usr/local/lib64/python3.6/site-packages (from tablib[html,ods,xls,xlsx,yaml]>=3.0.0->django-import-export->simplepro)
Requirement already satisfied: defusedxml in /usr/local/lib/python3.6/site-packages (from odfpy; extra == "ods"->tablib[html,ods,xls,xlsx,yaml]>=3.0.0->django-import-export->simplepro)
Requirement already satisfied: et-xmlfile in /usr/local/lib/python3.6/site-packages (from openpyxl>=2.6.0; extra == "xlsx"->tablib[html,ods,xls,xlsx,yaml]>=3.0.0->django-import-export->simplepro)
Installing collected packages: pillow, simpleproRunning setup.py install for pillow ... errorComplete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-d51wvxqq/pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-og1tmj5x-record/install-record.txt --single-version-externally-managed --compile:running installrunning buildrunning build_pycreating buildcreating build/lib.linux-x86_64-3.6creating build/lib.linux-x86_64-3.6/PILcopying src/PIL/BdfFontFile.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/BlpImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ContainerIO.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/CurImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ExifTags.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/FliImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/FontFile.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/GdImageFile.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/GifImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/GimpGradientFile.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/Image.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageChops.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageCms.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageColor.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageDraw.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageDraw2.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageEnhance.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageFile.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageFilter.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageFont.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageGrab.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageMath.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageMode.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageMorph.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageOps.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImagePalette.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImagePath.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageQt.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageSequence.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageShow.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageStat.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageTk.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageTransform.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImageWin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/JpegPresets.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/MicImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/MspImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/PSDraw.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/PaletteFile.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/PcfFontFile.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/PdfParser.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/PngImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/PyAccess.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/SunImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/TarIO.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/TiffTags.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/WalImageFile.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/__init__.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/__main__.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/_binary.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/_tkinter_finder.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/_util.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/_version.py -> build/lib.linux-x86_64-3.6/PILcopying src/PIL/features.py -> build/lib.linux-x86_64-3.6/PILrunning egg_infowriting src/Pillow.egg-info/PKG-INFOwriting dependency_links to src/Pillow.egg-info/dependency_links.txtwriting top-level names to src/Pillow.egg-info/top_level.txtreading manifest file 'src/Pillow.egg-info/SOURCES.txt'reading manifest template 'MANIFEST.in'warning: no files found matching '*.c'warning: no files found matching '*.h'warning: no files found matching '*.sh'warning: no previously-included files found matching '.appveyor.yml'warning: no previously-included files found matching '.clang-format'warning: no previously-included files found matching '.coveragerc'warning: no previously-included files found matching '.editorconfig'warning: no previously-included files found matching '.readthedocs.yml'warning: no previously-included files found matching 'codecov.yml'warning: no previously-included files matching '.git*' found anywhere in distributionwarning: no previously-included files matching '*.pyc' found anywhere in distributionwarning: no previously-included files matching '*.so' found anywhere in distributionno previously-included directories found matching '.ci'writing manifest file 'src/Pillow.egg-info/SOURCES.txt'running build_extThe headers or library files could not be found for jpeg,a required dependency when compiling Pillow from source.Please see the install instructions at:https://pillow.readthedocs.io/en/latest/installation.htmlTraceback (most recent call last):File "/tmp/pip-build-d51wvxqq/pillow/setup.py", line 1024, in <module>zip_safe=not (debug_build() or PLATFORM_MINGW),File "/usr/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setupreturn distutils.core.setup(**attrs)File "/usr/lib64/python3.6/distutils/core.py", line 148, in setupdist.run_commands()File "/usr/lib64/python3.6/distutils/dist.py", line 955, in run_commandsself.run_command(cmd)File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_commandcmd_obj.run()File "/usr/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in runreturn orig.install.run(self)File "/usr/lib64/python3.6/distutils/command/install.py", line 556, in runself.run_command('build')File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_commandself.distribution.run_command(command)File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_commandcmd_obj.run()File "/usr/lib64/python3.6/distutils/command/build.py", line 135, in runself.run_command(cmd_name)File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_commandself.distribution.run_command(command)File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_commandcmd_obj.run()File "/usr/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 78, in run_build_ext.run(self)File "/usr/lib64/python3.6/distutils/command/build_ext.py", line 339, in runself.build_extensions()File "/tmp/pip-build-d51wvxqq/pillow/setup.py", line 790, in build_extensionsraise RequiredDependencyException(f)__main__.RequiredDependencyException: jpegDuring handling of the above exception, another exception occurred:Traceback (most recent call last):File "<string>", line 1, in <module>File "/tmp/pip-build-d51wvxqq/pillow/setup.py", line 1037, in <module>raise RequiredDependencyException(msg)__main__.RequiredDependencyException:The headers or library files could not be found for jpeg,a required dependency when compiling Pillow from source.Please see the install instructions at:https://pillow.readthedocs.io/en/latest/installation.html----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-d51wvxqq/pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-og1tmj5x-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-d51wvxqq/pillow/
[root@localhost Init_Sys]# # 安装simplePro 失败,根据错误信息显示,安装Pillow库时出现了一个错误。错误提示说找不到jpeg的头文件或库文件,这是在从源码编译Pillow时所需的一个依赖项。# sudo yum install libjpeg-devel
2.2.6 安装libjpeg-devel
[root@localhost Init_Sys]# yum install libjpeg-devel
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.bfsu.edu.cn* epel: mirrors.bfsu.edu.cn* extras: mirrors.bfsu.edu.cn* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package libjpeg-turbo-devel.x86_64 0:1.2.90-8.el7 will be installed
--> Finished Dependency ResolutionDependencies Resolved============================================================================================================================================================================================================================================================================================Package                                                                       Arch                                                             Version                                                                Repository                                                      Size
============================================================================================================================================================================================================================================================================================
Installing:libjpeg-turbo-devel                                                           x86_64                                                           1.2.90-8.el7                                                           base                                                            99 kTransaction Summary
============================================================================================================================================================================================================================================================================================
Install  1 PackageTotal download size: 99 k
Installed size: 314 k
Is this ok [y/d/N]: y                          # y
Downloading packages:
libjpeg-turbo-devel-1.2.90-8.el7.x86_64.rpm                                                                                                                                                                                                                          |  99 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : libjpeg-turbo-devel-1.2.90-8.el7.x86_64                                                                                                                                                                                                                                  1/1 Verifying  : libjpeg-turbo-devel-1.2.90-8.el7.x86_64                                                                                                                                                                                                                                  1/1 Installed:libjpeg-turbo-devel.x86_64 0:1.2.90-8.el7                                                                                                                                                                                                                                                 Complete!
[root@localhost Init_Sys]# 
[root@localhost Init_Sys]# 
2.2.7 重新安装simplepro
# 重新安装  simplepro[root@localhost Init_Sys]# pip3 install simplepro
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting simpleproUsing cached https://files.pythonhosted.org/packages/b5/a2/7d4fc4d98ff39d5453f4f5c7be8c07c593e6f863e0accdefa88f56916622/simplepro-7.2.2.tar.gz
Requirement already satisfied: django>=2.1 in /usr/local/lib64/python3.6/site-packages (from simplepro)
Requirement already satisfied: django-simpleui>=2023.11.15 in /usr/local/lib/python3.6/site-packages (from simplepro)
Requirement already satisfied: django-import-export in /usr/local/lib/python3.6/site-packages (from simplepro)
Requirement already satisfied: requests in /usr/local/lib/python3.6/site-packages (from simplepro)
Requirement already satisfied: rsa in /usr/local/lib/python3.6/site-packages (from simplepro)
Requirement already satisfied: psutil in /usr/local/lib64/python3.6/site-packages (from simplepro)
Collecting pillow (from simplepro)Using cached https://files.pythonhosted.org/packages/7d/2a/2fc11b54e2742db06297f7fa7f420a0e3069fdcf0e4b57dfec33f0b08622/Pillow-8.4.0.tar.gz
Requirement already satisfied: pytz in /usr/local/lib/python3.6/site-packages (from django>=2.1->simplepro)
Requirement already satisfied: asgiref<4,>=3.3.2 in /usr/local/lib/python3.6/site-packages (from django>=2.1->simplepro)
Requirement already satisfied: sqlparse>=0.2.2 in /usr/local/lib/python3.6/site-packages (from django>=2.1->simplepro)
Requirement already satisfied: tablib[html,ods,xls,xlsx,yaml]>=3.0.0 in /usr/local/lib/python3.6/site-packages (from django-import-export->simplepro)
Requirement already satisfied: diff-match-patch in /usr/local/lib/python3.6/site-packages (from django-import-export->simplepro)
Requirement already satisfied: charset-normalizer~=2.0.0; python_version >= "3" in /usr/local/lib/python3.6/site-packages (from requests->simplepro)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.6/site-packages (from requests->simplepro)
Requirement already satisfied: idna<4,>=2.5; python_version >= "3" in /usr/local/lib/python3.6/site-packages (from requests->simplepro)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/site-packages (from requests->simplepro)
Requirement already satisfied: pyasn1>=0.1.3 in /usr/local/lib/python3.6/site-packages (from rsa->simplepro)
Requirement already satisfied: typing-extensions; python_version < "3.8" in /usr/local/lib/python3.6/site-packages (from asgiref<4,>=3.3.2->django>=2.1->simplepro)
Requirement already satisfied: markuppy; extra == "html" in /usr/local/lib/python3.6/site-packages (from tablib[html,ods,xls,xlsx,yaml]>=3.0.0->django-import-export->simplepro)
Requirement already satisfied: odfpy; extra == "ods" in /usr/local/lib/python3.6/site-packages (from tablib[html,ods,xls,xlsx,yaml]>=3.0.0->django-import-export->simplepro)
Requirement already satisfied: xlrd; extra == "xls" in /usr/local/lib/python3.6/site-packages (from tablib[html,ods,xls,xlsx,yaml]>=3.0.0->django-import-export->simplepro)
Requirement already satisfied: xlwt; extra == "xls" in /usr/local/lib/python3.6/site-packages (from tablib[html,ods,xls,xlsx,yaml]>=3.0.0->django-import-export->simplepro)
Requirement already satisfied: openpyxl>=2.6.0; extra == "xlsx" in /usr/local/lib/python3.6/site-packages (from tablib[html,ods,xls,xlsx,yaml]>=3.0.0->django-import-export->simplepro)
Requirement already satisfied: pyyaml; extra == "yaml" in /usr/local/lib64/python3.6/site-packages (from tablib[html,ods,xls,xlsx,yaml]>=3.0.0->django-import-export->simplepro)
Requirement already satisfied: defusedxml in /usr/local/lib/python3.6/site-packages (from odfpy; extra == "ods"->tablib[html,ods,xls,xlsx,yaml]>=3.0.0->django-import-export->simplepro)
Requirement already satisfied: et-xmlfile in /usr/local/lib/python3.6/site-packages (from openpyxl>=2.6.0; extra == "xlsx"->tablib[html,ods,xls,xlsx,yaml]>=3.0.0->django-import-export->simplepro)
Installing collected packages: pillow, simpleproRunning setup.py install for pillow ... doneRunning setup.py install for simplepro ... done
Successfully installed pillow-8.4.0 simplepro-7.2.2
[root@localhost Init_Sys]# 
2.2.8 安装faker 
root@localhost Init_Sys]# pip3 install faker
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting fakerDownloading https://files.pythonhosted.org/packages/36/e9/eb926239c310abc1502caffe651ac83e72a11c4cc9b9f8d9294be942758b/Faker-14.2.1-py3-none-any.whl (1.6MB)100% |████████████████████████████████| 1.6MB 31kB/s 
Collecting python-dateutil>=2.4 (from faker)Downloading https://files.pythonhosted.org/packages/36/7a/87837f39d0296e723bb9b62bbb257d0355c7f6128853c78955f57342a56d/python_dateutil-2.8.2-py2.py3-none-any.whl (247kB)100% |████████████████████████████████| 256kB 18kB/s 
Requirement already satisfied: typing-extensions>=3.7.4.3; python_version < "3.8" in /usr/local/lib/python3.6/site-packages (from faker)
Collecting six>=1.5 (from python-dateutil>=2.4->faker)Downloading https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil, faker
Successfully installed faker-14.2.1 python-dateutil-2.8.2 six-1.16.0
[root@localhost Init_Sys]# 
2.3 所有packages安装完成后,再次运行你的Python脚本
# python3 manage.py makemigrations Initapp[root@localhost Init_Sys]# python3 manage.py makemigrations Initapp
Migrations for 'Initapp':Initapp/migrations/0097_alter_dyn_rule_factor_param_config_risk_param_type.py- Alter field risk_param_type on dyn_rule_factor_param_config
[root@localhost Init_Sys]# 
[root@localhost Init_Sys]# 
[root@localhost Init_Sys]# 
[root@localhost Init_Sys]# python3 manage.py migrate Initapp
Operations to perform:Apply all migrations: Initapp
Running migrations:Applying Initapp.0001_initial... OKApplying Initapp.0002_auto_20220903_1417... OKApplying Initapp.0003_auto_20220904_1658... OKApplying Initapp.0004_index_componentinfo_ext_stock_production_ext... OKApplying Initapp.0005_auto_20221011_1418... OKApplying Initapp.0006_auto_20221012_0952... OKApplying Initapp.0007_auto_20221012_0953... OKApplying Initapp.0008_auto_20221012_0953... OKApplying Initapp.0009_auto_20221012_0954... OKApplying Initapp.0010_auto_20221012_0956... OKApplying Initapp.0011_auto_20221012_1002... OKApplying Initapp.0012_alter_rule_acc_except_control_level_value... OKApplying Initapp.0013_auto_20221013_1429... OKApplying Initapp.0014_alter_security_info_security_type... OKApplying Initapp.0015_auto_20221013_1648... OKApplying Initapp.0016_alter_stock_production_ext_securityname... OKApplying Initapp.0017_auto_20221013_1653... OKApplying Initapp.0018_auto_20221013_1709... OKApplying Initapp.0019_auto_20221013_1715... OKApplying Initapp.0020_alter_stock_production_ext_contractmultipli... OKApplying Initapp.0021_auto_20221013_1720... OKApplying Initapp.0022_alter_security_info_security_type... OKApplying Initapp.0023_alter_security_info_security_type... OKApplying Initapp.0024_alter_rule_info_risk_conno... OKApplying Initapp.0025_alter_rule_info_risk_conno... OKApplying Initapp.0026_auto_20221017_1059... OKApplying Initapp.0027_auto_20221017_1100... OKApplying Initapp.0028_alter_rule_account_config_control_level... OKApplying Initapp.0029_alter_rule_info_enable_status... OKApplying Initapp.0030_auto_20221017_1619... OKApplying Initapp.0031_alter_security_info_securityid... OKApplying Initapp.0032_alter_security_info_securityid... OKApplying Initapp.0033_alter_security_info_securityid... OKApplying Initapp.0034_auto_20221017_1737... OKApplying Initapp.0035_alter_rule_account_config_account_source... OKApplying Initapp.0036_alter_rule_account_config_account_source... OKApplying Initapp.0037_alter_security_info_security_exchange... OKApplying Initapp.0038_alter_rule_condition_config_risk_param_type... OKApplying Initapp.0039_alter_security_info_securityid... OKApplying Initapp.0040_auto_20221018_1408... OKApplying Initapp.0041_auto_20221018_1454... OKApplying Initapp.0042_alter_rule_condition_config_factor_int_para3... OKApplying Initapp.0043_auto_20221018_1611... OKApplying Initapp.0044_alter_rule_condition_config_risk_param_type... OKApplying Initapp.0045_alter_security_info_securityid... OKApplying Initapp.0046_auto_20221025_1032... OKApplying Initapp.0047_auto_20221025_1037... OKApplying Initapp.0048_auto_20221025_1719... OKApplying Initapp.0049_auto_20221026_1609... OKApplying Initapp.0050_alter_threshold_value_a_pchg1... OKApplying Initapp.0051_alter_security_info_securityid... OKApplying Initapp.0052_auto_20221027_1139... OKApplying Initapp.0053_auto_20221027_1302... OKApplying Initapp.0054_auto_20221027_1307... OKApplying Initapp.0055_auto_20221027_1321... OKApplying Initapp.0056_alter_rule_info_remakrks... OKApplying Initapp.0057_auto_20221027_1343... OKApplying Initapp.0058_auto_20221027_1538... OKApplying Initapp.0059_auto_20221027_1700... OKApplying Initapp.0060_alter_rule_account_config_account_source... OKApplying Initapp.0061_auto_20221028_1605... OKApplying Initapp.0062_alter_rule_info_risk_conno... OKApplying Initapp.0063_alter_rule_info_riskcon_begindate... OKApplying Initapp.0064_alter_rule_info_riskcon_begindate... OKApplying Initapp.0065_auto_20221031_1107... OKApplying Initapp.0066_alter_index_componentinfo_ext_componentsecurityexchange... OKApplying Initapp.0067_alter_index_componentinfo_ext_componentsecurityexchange... OKApplying Initapp.0068_alter_index_componentinfo_ext_securityid... OKApplying Initapp.0069_alter_index_componentinfo_ext_securityid... OKApplying Initapp.0070_auto_20221031_1355... OKApplying Initapp.0071_auto_20221101_1040... OKApplying Initapp.0072_alter_account_info_stock_holder_no... OKApplying Initapp.0073_auto_20221104_0020... OKApplying Initapp.0074_alter_rule_account_config_account_source... OKApplying Initapp.0075_auto_20221114_1438... OKApplying Initapp.0076_alter_stock_production_ext_securityid... OKApplying Initapp.0077_auto_20221114_1450... OKApplying Initapp.0078_dynamic_dimension... OKApplying Initapp.0079_stock_production_ext_closepx... OKApplying Initapp.0080_auto_20221121_1103... OKApplying Initapp.0081_alter_dynamic_dimension_dimensionid... OKApplying Initapp.0082_auto_20221122_1401... OKApplying Initapp.0083_alter_rule_account_config_account_source... OKApplying Initapp.0084_dyn_rule_info... OKApplying Initapp.0085_alter_dyn_rule_info_risk_conno... OKApplying Initapp.0086_alter_dyn_rule_info_risk_conno... OKApplying Initapp.0087_auto_20230323_0953... OKApplying Initapp.0088_auto_20230323_1123... OKApplying Initapp.0089_dyn_rule_acc_except_dyn_rule_account_config_dyn_rule_condition_config_dyn_rule_factor_config_dyn_rul... OKApplying Initapp.0090_alter_dyn_rule_info_risk_conno... OKApplying Initapp.0091_alter_dyn_rule_factor_param_config_remove_sec_value... OKApplying Initapp.0092_alter_dyn_rule_factor_param_config_remove_sec_value... OKApplying Initapp.0093_auto_20230328_0927... OKApplying Initapp.0094_auto_20230328_0930... OKApplying Initapp.0095_auto_20230328_0934... OKApplying Initapp.0096_alter_rule_account_config_enable_status... OKApplying Initapp.0097_alter_dyn_rule_factor_param_config_risk_param_type... OK
[root@localhost Init_Sys]# 
2.4 启动Django 项目
[root@localhost Init_Sys]# python3 manage.py runserver
Watching for file changes with StatReloader
Performing system checks...System check identified no issues (0 silenced).You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
December 11, 2023 - 10:05:35
Django version 3.2.23, using settings 'Init_Sys.settings'
Starting development server at http://192.168.2.247:8888/
Quit the server with CONTROL-C.
2.5 浏览器访问

3. 添加supervisord 守护进程

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/215050.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

持续集成交付CICD:GitLabCI上传Nexus制品

目录 一、实验 1.GitLabCI上传Nexus制品 2.优化GitLabCI&#xff08;引用系统变量&#xff09; 3.添加if条件判断项目类型 4.优化GitLabCI&#xff08;模板类&#xff09; 二、问题 1.GitLabCI获取jar文件失败 2. GitLabCI获取流水线项目命名空间失败 3.GItLab Packag…

.NET 8 编写 LiteDB vs SQLite 数据库 CRUD 接口性能测试(准备篇)

WebAppDbTest 项目准备 项目准备1、.net cli 创建项目2、nuget 包引用和项目结构2.1、项目添加相关 nuget 包2.2、WebAppDbTest 项目结构 3、项目代码说明3.1、CSharp/C# 类文件说明3.2、json 配置文件说明 4、项目运行预览 数据库 .db 文件准备1、创建 SQLite 数据库1.1、在 W…

Python---综合案例

一、系统需求分析 1、需求分析 使用面向对象编程思想完成学员管理系统的开发&#xff0c;具体如下&#xff1a; ① 系统要求&#xff1a;学员数据存储在文件中 ② 系统功能&#xff1a;添加学员、删除学员、修改学员信息、查询学员信息、显示所有学员信息、保存学员信息及退…

56.windows docker 安装ES、Go操作ES

文章目录 一、环境准备1、 docker安装ES2、启动容器3、图像化客户端工具ElasticSearch-Head 二、Go ES连接与认证1、 连接ES2、配置ES认证 三、索引的增删改查四、文档的增删改创建单个文档根据文档id删除文档批量删除文档批量创建文档 五、文档查询列表查询精确匹配模糊匹配嵌…

ubuntu18.04配置cuda+cudnn+tensorrt+anconda+pytorch-gpu+pycharm

一、显卡驱动安装 执行nvidia-smi查看安装情况 二、cuda安装 cuda官网下载cuda_11.6.2_510.47.03_linux.run&#xff0c;安装执行 sudo sh cuda_11.6.2_510.47.03_linux.run提升安装项&#xff0c;驱动不用安装&#xff0c;即第一项&#xff08;Driver&#xff09;&#xff…

如何使用Java在Excel中添加动态数组公式?

本文由葡萄城技术团队发布。转载请注明出处&#xff1a;葡萄城官网&#xff0c;葡萄城为开发者提供专业的开发工具、解决方案和服务&#xff0c;赋能开发者。 前言 动态数组公式是 Excel 引入的一项重要功能&#xff0c;它将 Excel 分为两种风格&#xff1a;Excel 365 和传统 …

虹科技术 | IO-Link Wireless如何赋能工厂车间迈向无线自动化?

大规模定制、卓越运营和商业智能正在从根本上改变制造业&#xff0c;为了在竞争中立于不败之地&#xff0c;制造商需要更加灵活、通用、可扩展和具有成本效益的机器和生产线。随着制造商向工业 4.0 迈进&#xff0c;更好的适应性、更高的吞吐量和更短的停机时间是他们的共同要求…

打包CSS

接上一个打包HTML继续进行CSS的打包 1.在之前的文件夹里的src文件夹创建一个css文件 2.在浏览器打开webpack——>中文文档——>指南——>管理资源——>加载CSS 3.复制第一句代码到终端 4.复制下图代码到webpack.config.js脚本的plugins&#xff1a;[.....]内容下…

【docker】Hello World

搜索hello-world镜像 docker search hello-world拉去镜像 docker pull hello-world查看本地镜像 docker images 运行镜像 docker run hello-world查看所有的容器 docker ps -a查询start状态容器 docker ps 输出介绍 CONTAINER ID: 容器 ID。IMAGE: 使用的镜像。COMMAN…

分布式搜索引擎02

分布式搜索引擎02 在昨天的学习中&#xff0c;我们已经导入了大量数据到elasticsearch中&#xff0c;实现了elasticsearch的数据存储功能。但elasticsearch最擅长的还是搜索和数据分析。 所以今天&#xff0c;我们研究下elasticsearch的数据搜索功能。我们会分别使用DSL和Res…

ElasticSearch应用场景以及技术选型[ES系列] - 第496篇

历史文章&#xff08;文章累计490&#xff09; 《国内最全的Spring Boot系列之一》 《国内最全的Spring Boot系列之二》 《国内最全的Spring Boot系列之三》 《国内最全的Spring Boot系列之四》 《国内最全的Spring Boot系列之五》 《国内最全的Spring Boot系列之六》 M…

PDF控件Spire.PDF for .NET【转换】演示:将 PDF 转换为 Excel

PDF是一种通用的文件格式&#xff0c;但它很难编辑。如果您想修改和计算PDF数据&#xff0c;将PDF转换为Excel将是一个理想的解决方案。在本文中&#xff0c;您将了解如何使用Spire.PDF for .NET在 C# 和 VB.NET 中将 PDF 转换为 Excel。 Spire.Doc 是一款专门对 Word 文档进行…

【华为数据之道学习笔记】3-10元数据管理架构及策略

元数据管理架构包括产生元数据、采集元数据、注册元数据和运 维元数据。 产生元数据&#xff1a; 制定元数据管理相关流程与规范的落地方案&#xff0c;在IT产品开发过程中实现业务元数据与技术元数据的连接。 采集元数据&#xff1a; 通过统一的元模型从各类IT系统中自动采集元…

多线程(初阶九:线程池)

目录 一、线程池的由来 二、线程池的简单介绍 1、ThreadPoolExecutor类 &#xff08;1&#xff09;核心线程数和最大线程数&#xff1a; &#xff08;2&#xff09;保持存活时间和存活时间的单位 &#xff08;3&#xff09;放任务的队列 &#xff08;4&#xff09;线程工…

Axure的安装以及简单使用

目录 Axure简介 是什么 有什么用 Axure的优缺点 优点&#xff1a; 缺点&#xff1a; 安装 汉化 Axure的使用 工具栏 页面 ​编辑 添加子页面 ​编辑 Axure简介 是什么 Axure是一款著名的原型设计工具。它允许用户创建交互式线框图、流程图、原型和其他设计文档&…

「Verilog学习笔记」脉冲同步电路

专栏前言 本专栏的内容主要是记录本人学习Verilog过程中的一些知识点&#xff0c;刷题网站用的是牛客网 timescale 1ns/1nsmodule pulse_detect(input clk_fast , input clk_slow , input rst_n ,input data_in ,output dataout );reg data_level, dat…

第十一章 React 封装自定义组件

一、专栏介绍 &#x1f30d;&#x1f30d; 欢迎加入本专栏&#xff01;本专栏将引领您快速上手React&#xff0c;让我们一起放弃放弃的念头&#xff0c;开始学习之旅吧&#xff01;我们将从搭建React项目开始&#xff0c;逐步深入讲解最核心的hooks&#xff0c;以及React路由、…

【NLP】RAG 应用中的调优策略

​ 检索增强生成应用程序的调优策略 没有一种放之四海而皆准的算法能够最好地解决所有问题。 本文通过数据科学家的视角审视检索增强生成&#xff08;RAG&#xff09;管道。它讨论了您可以尝试提高 RAG 管道性能的潜在“超参数”。与深度学习中的实验类似&#xff0c;例如&am…

axios 基础的 一次封装 二次封装

一、平常axios的请求发送方式 修改起来麻烦的一批 代码一大串 二、axios的一次封装 我们会在src/utils创建一个request.js的文件来存放我们的基地址与拦截器 /* 封装axios用于发送请求 */ import axios from axios/* (1)request 相当于 Axios 的实例对象 (2)为什么要有reque…

VSCode使用Remote-SSH连接服务器时报错:无法与“***”建立连接: XHR failed.

关于VSCode的报错问题&#xff1a;无法与“***”建立连接: XHR failed 问题描述问题理解解决方法手动在本地下载安装包&#xff0c;然后手动传到服务器端 问题描述 是的&#xff0c;我又踩坑了&#xff0c;而且这个弄了好久&#xff0c;也重新装了VSCode软件&#xff0c;好像结…