https://www.python.org/downloads/windows/选择Windows x86-64 executable installer下载解压:python-3.5.4-amd64.exe问题:安装python-3.5.4-amd64.exe时报错:0x80240017解决:重装系统:Windows8.1-KB2919355-x64.msu 下载Windows8.1-KB2919355-x64.msu: https://pan.baidu.com/s/1Iw8y-jsbnrLyzUncua1lSQ#list/path=%2F
如:C:\Python\python35和C:\Python\python35\Scripts
python -m pip install --upgrade pip --force-reinstall
先安装tornado:tornado-5.1.1-cp35-cp35m-win_amd64.whl下载网址:https://pypi.org/project/tornado/5.1.1/#filespip3 install tornado-5.1.1-cp35-cp35m-win_amd64.whl再安装项目依赖 pip3 install -r requirements.txt 注:这里会报错,执行1.6中的步骤进行安装
下载网址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi找到下载:mod_wsgi-4.5.24+ap24vc14-cp35-cp35m-win_amd64.whlpip3 install mod_wsgi-4.5.24+ap24vc14-cp35-cp35m-win_amd64.whl
①下载:(直接在pycharm上项目路径下)pip3 download -d C:\Users\hzx\Desktop\package -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/注:C:\Users\hzx\Desktop\package 指的是桌面上新建的空文件夹为package的路径,②安装:把package文件夹和requirements.txt放在C盘根目录下 pip3 install --no-index --find-links=C:\package -r requirements.txt③问题:安装过项目依赖后,执行python manage.py runserver 192.168.1.67:8000后会报错,提示xxx模块没有安装,
解决依次执行pip3 install 模块名==版本号 -i https://pypi.tuna.tsinghua.edu.cn/simple/
C:\ MySQL5.6\mysql-5.6.45-winx64\bin
创建my.ini文件,放在bin目录下面,配置内容:[mysql]default-character-set=utf8 # 设置mysql客户端默认字符集[mysqld]port = 3306 # 设置3306端口basedir=E:/mysql-5.7.12-winx64 # 设置mysql的安装目录datadir=E:/mysql-5.7.12-winx64/data # 设置mysql数据库的数据的存放目录max_connections=200 # 允许最大连接数character-set-server=utf8 # 服务端使用的字符集默认为8比特编码的latin1字符集default-storage-engine=INNODB # 创建新表时将使用的默认存储引擎
mysqld --initialize-insecure mysqld -install 如果已存在,则删除:sc delete mysql 或者 mysql –removenet start mysql
mysqladmin -u root -p password回车出现Enter password:直接回车,未设置密码时默认没有密码,接着出现“New password:”输入新的密码password,回车即可,接着出现“Confirm new password:”确认密码password,回车即可。登录mysql:mysql –uroot –ppassword
delete from mysql.user where user=‘‘; delete from mysql.user where host=‘::1‘;
update user set host=‘%‘ where user =‘root‘;flush privileges;
①先创建数据库mysql –uroot –ppasswordcreate database tesudrm_adg charset=utf8;
②导入项目数据库mysql -uroot -ppassword tesudrm_adg < tesudrm_adg.sql
https://github.com/MSOpenTech/redis版本:Redis-x64-3.2.100
redis-server redis.windows.conf 指定配置文件开启
redis-server --service-install redis.windows.conf --loglevel verbose
卸载服务:redis-server --service-uninstall开启服务:redis-server --service-start停止服务:redis-server --service-stop
redis-cli -h 127.0.0.1 -p 6379
https://de.apachehaus.com/downloads/httpd-2.4.41-o102s-x64-vc14-r2.zip解压httpd-2.4.41-o102s-x64-vc14-r2.zip将解压出的Apache24移植指定位置C盘根路径:C:\
cd C:\ Apache24\conf\httpd.conf①Apache24文件的路径,其余不用改:Define SRVROOT "C:\Apache24"
②此处为你要发布的网站ip地址,此处我用我电脑的ip和端口,你也可以用127.0.0.1:8000用于本地测试;80端口自己设置Listen 192.168.1.67:8000 ServerName 192.168.1.67:8000
③注释:# Define ENABLE_TLS13 "Yes"
①cd C:\Apache24\bin②创建服务:httpd.exe -k install -n "Apache24" ③卸载服务:httpd.exe -k uninstall -n "Apache24"④重启apache命令:httpd.exe -k restart
192.168.1.67:8000 出现页面,则Apache服务配置成功
①查看mod_wsgi路径mod_wsgi-express module-config
②记录下来LoadFile "c: /python35/python35.dll"LoadModule wsgi_module "c:/ python35/lib/site-packages/mod_wsgi/server/mod_wsgi.cp35-win_amd64.pyd"WSGIPythonHome "c:/python35"
①settings.py文件中写入静态文件物理路径(已经写了)SITE_ROOT=os.path.join(os.path.abspath(os.path.dirname(__file__)),‘..‘)STATIC_ROOT = os.path.join(SITE_ROOT,‘static‘) ②添加静态文件访问逻辑路径 STATICFILES_DIRS = [ os.path.join(BASE_DIR, ‘static‘) ] ③收集静态文件python manage.py collectstatic ④注销掉物理路径# STATIC_ROOT# SITE_ROOT
①安装wsgi模块后,出来的三行字符,直接复制过来LoadFile "c: /python35/python35.dll"LoadModule wsgi_module "c:/ python35/lib/site-packages/mod_wsgi/server/mod_wsgi.cp35-win_amd64.pyd"WSGIPythonHome "c:/python35"
②设置项目中的wsgi路径WSGIScriptAlias / C:\ TSDRM_ADG\TSDRM\wsgi.py
③设置项目路径WSGIPythonPath C:\ TSDRM_ADG
④设置wsgi路径 <Directory C:\ TSDRM_ADG\TSDRM> <Files wsgi.py> Require all granted </Files> </Directory>
⑤设置静态文件路径 Alias /static C:\ TSDRM_ADG\static <Directory C:\ TSDRM_ADG\static> AllowOverride None Options None Require all granted </Directory> 注意:不要导入 win_unicode_console
①问题:Forbidden You don‘t have permission to access this resource. 解决: 找到 apache 配置文件 httpd.conf 把里面的 <Directory /> AllowOverride none Require all denied </Directory> 改为 <Directory /> AllowOverride none Require all granted </Directory> ②问题: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, add.com@phpstudy and inform them of the time the error occurred, and anything you might have done that may have caused the error查看问题:进入到C:\Apache24\logs查看error.log,报错信息: File "C:\\python35\\lib\\site-packages\\django\\__init__.py", line 17, in setup\r configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)\r File "C:\\python35\\lib\\importlib\\__init__.py", line 126, in import_module\r cursor.execute(sql)\r File "C:\\python35\\lib\\site-packages\\pymysql\\cursors.py", line 165, in execute\r result = self._query(query)\r File "C:\\python35\\lib\\site-packages\\pymysql\\cursors.py", line 321, in _query\r conn.query(q)\r File "C:\\python35\\lib\\site-packages\\pymysql\\connections.py", line 860, in query\r self._affected_rows = self._read_query_result(unbuffered=unbuffered)\r pymysql.err.InternalError: (1046, ‘No database selected‘)\r解决:路径出错 进入到项目settings.py中: db_config_file = os.path.join(os.path.join(os.path.join(os.getcwd(), "faconstor"), "config"), "db_config.xml") print(os.getcwd()) ? C:\Apache24 这里需要把项目文件拷贝到Apache24根路径下就能决绝错误
①地址:https://github.com/wkhtmltopdf/wkhtmltopdf/releases/②下载对应的应用软件:wkhtmltox-0.12.5-1.msvc2015-win64.exe③将wkhtmltopdf应用软件拷贝至Apach24目录