Project cross domain access : Reference resources Django Cross domain access has been blocked by CORS policy: No ‘Access-Control-Allow-Origin‘ header resolvent _ChangYan. The blog of -CSDN Blog
0、 Install plug-ins across settings
pip install django-cors-header -i http://pypi.doubanio.com/simple --trusted-host pypi.doubanio.com
1、 Configuration modification :
Settings.py
INSTALLED_APPS=[
'corsheaders',
]
MIDDLEWARE=[
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
]
CORS_ORIGIN_ALLOW_ALL=True
CORS_ALLOW_CREDENTIALS=True
2、 Allow remote access
ALLOWED_HOSTS = ['*']
python manage.py runserver 0.0.0.0:8081
It mainly includes django The project framework +vue Packed static files, etc
Reference resources :Python pyinsatller pack Django The project is exe file - loren880898 - Blog Garden (cnblogs.com)https://www.cnblogs.com/loren880898/p/14681933.html
0、 Exception information during packaging :
TypeError: _get_sysconfigdata_name() missing 1 required positional argument: 'check_exists'
modify
D:\ProgramData\Anaconda3\Lib\site-packages\PyInstaller\hooks\hook-distutils.py
D:\ProgramData\Anaconda3\Lib\site-packages\PyInstaller\hooks\hook-sysconfig.py
The content of :
add to :
import sysconfig
print(sysconfig.__file__)modify :
_get_sysconfigdata_name(check_exists=True)
Save and repack
===================================================
1、pyinstaller -D .\manage.py Printed when packaging
Abnormal information :【 Mainly with pyinstaller Dependency related 】
PyInstaller.exceptions.ImportErrorWhenRunningHook: Failed to import module __PyInstaller_hooks_0_IPython required by hook for module d:\programdata\anaconda3\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks\hook-IPython.py. Please check whether module __PyInstaller_hooks_0_IPython actually exists and whether the hook is compatible with your version of d:\programdata\anaconda3\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks\hook-IPython.py: You might want to read more about hooks in the manual and provide a pull-request to improve PyInstaller.
Reference article :
Perfect solution pyinstaller Program packaging problem And Hooks Report errors _ Xiaoming's girlfriend's blog -CSDN Blog _pyinstaller Packaging failed https://blog.csdn.net/weixin_42430971/article/details/121726334
To solve the process :
Try No 5 Two ways to update , Then delete the last package generated file in the project directory
Uninstall... In the environment pyinstaller, Use conda reinstall
Reference resources :
Link attached :
1、pyInstaller
How to Install PyInstaller — PyInstaller 5.1 documentationhttps://pyinstaller.org/en/stable/installation.html#installed-commands
Catalog cause : Problem descr
p{margin:10px 0}.markdown-body
(0) Abstract # Course link ne