added instruction for runing myems-api with waitress on Windows
parent
6892981249
commit
b012f5d866
|
@ -1,19 +0,0 @@
|
||||||
1、Windows下运行myems-api服务需要安装依赖waitress,命令是: pip install waitress;
|
|
||||||
2、运行服务命令:waitress-serve --port=8000 app:api
|
|
||||||
3、可能遇到的问题(在这卡了很久):No module named 'fcntl'和No module named 'pwd',实际解决方法很简单:在python目录的lib目录下新建fcntl.py和pwd.py,fcntl里内容如下,pwd里空着就行;
|
|
||||||
|
|
||||||
|
|
||||||
def fcntl(fd, op, arg=0):
|
|
||||||
return 0
|
|
||||||
|
|
||||||
def ioctl(fd, op, arg=0, mutable_flag=True):
|
|
||||||
if mutable_flag:
|
|
||||||
return 0
|
|
||||||
else:
|
|
||||||
return ""
|
|
||||||
|
|
||||||
def flock(fd, op):
|
|
||||||
return
|
|
||||||
|
|
||||||
def lockf(fd, operation, length=0, start=0, whence=0):
|
|
||||||
return
|
|
|
@ -32,6 +32,7 @@ python-decouple
|
||||||
|
|
||||||
## Quick Run for Development
|
## Quick Run for Development
|
||||||
|
|
||||||
|
Quick run on Linux (NOT for production use):
|
||||||
```bash
|
```bash
|
||||||
cd myems/myems-api
|
cd myems/myems-api
|
||||||
sudo pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
|
sudo pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
|
||||||
|
@ -40,6 +41,26 @@ sudo chmod +x run.sh
|
||||||
./run.sh
|
./run.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Quick run on Windows (NOT for production use):
|
||||||
|
Find python path in Command Prompt:
|
||||||
|
```bash
|
||||||
|
where python
|
||||||
|
```
|
||||||
|
Assume the result is 'C:\Users\johnson\AppData\Local\Programs\Python\Python310\python.exe'
|
||||||
|
Copy fcntl.py and pwd.py to lib folder:
|
||||||
|
```bash
|
||||||
|
cp myems\myems-api\fcntl.py C:\Users\johnson\AppData\Local\Programs\Python\Python310\Lib
|
||||||
|
cp myems\myems-api\pwd.py C:\Users\johnson\AppData\Local\Programs\Python\Python310\Lib
|
||||||
|
```
|
||||||
|
|
||||||
|
Install and run with waitress:
|
||||||
|
```bash
|
||||||
|
pip install waitress
|
||||||
|
cd myems\myems-api
|
||||||
|
waitress-serve --listen=127.0.0.1:8000 app:api
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### Installation Option 1: Install myems-api on Docker
|
### Installation Option 1: Install myems-api on Docker
|
||||||
|
@ -2672,6 +2693,8 @@ curl -i -X GET {{base_url}}/reports/virtualmetercost?virtualmeterid=1&periodtype
|
||||||
|
|
||||||
[8]. https://foss.heptapod.net/openpyxl/et_xmlfile/
|
[8]. https://foss.heptapod.net/openpyxl/et_xmlfile/
|
||||||
|
|
||||||
|
[9]. https://docs.pylonsproject.org/projects/waitress/en/latest/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
def fcntl(fd, op, arg=0):
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
def ioctl(fd, op, arg=0, mutable_flag=True):
|
||||||
|
if mutable_flag:
|
||||||
|
return 0
|
||||||
|
else:
|
||||||
|
return ""
|
||||||
|
|
||||||
|
|
||||||
|
def flock(fd, op):
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
def lockf(fd, operation, length=0, start=0, whence=0):
|
||||||
|
return
|
|
@ -0,0 +1 @@
|
||||||
|
# left blank intentionally
|
Loading…
Reference in New Issue