README.md 1.76 KB
Newer Older
wanli's avatar
wanli committed
1 2
<!--
 * @Author: your name
3 4 5
 * @Date: 2021-07-15 09:33:39
 * @LastEditTime: 2021-07-19 17:04:37
 * @LastEditors: Please set LastEditors
wanli's avatar
wanli committed
6 7 8
 * @Description: In User Settings Edit
 * @FilePath: \evm-store\tools\README.md
-->
wanli's avatar
wanli committed
9 10 11 12
# 代码生成工具

使用Python Jinja2模板引擎,自动生成代码。

wanli's avatar
wanli committed
13 14 15 16 17
# 参考资料链接

- https://flask.palletsprojects.com/en/1.1.x/api/
- https://flask-sqlalchemy.palletsprojects.com/en/2.x/
- http://www.pythondoc.com/flask-sqlalchemy/index.html
wanli's avatar
wanli committed
18
- https://jinja.palletsprojects.com/en/2.11.x/templates/
wanli's avatar
wanli committed
19 20 21 22
- marshmallow: https://www.cnblogs.com/dowi/p/11850558.html
- https://flask-marshmallow.readthedocs.io/en/latest/
- https://docs.pyfilesystem.org/en/latest/index.html
- https://jinja.palletsprojects.com/en/3.0.x/
wanli's avatar
wanli committed
23
- https://www.jb51.net/article/205786.htm
24
- https://blog.csdn.net/weixin_39352048/article/details/80363326
wanli's avatar
wanli committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79

# 问题

## ModuleNotFoundError: No module named 'flask._compat'

解决方法:
```
On this specific error: from flask._compat import text_type
ModuleNotFoundError: No module named 'flask._compat' -

It happened because the python searched on Flask._compat directory and It isn't there, so I changed like on below : (on flask_script/__init__.py)

Where:

`from ._compat import text_type` on original flask-script file

to :

`from flask_script._compat import text_type`

Then It works !!
```

## ModuleNotFoundError: No module named 'fcntl'

解决方法:

输入以下代码并保存至Python安装目录的Lib目录下

```
LOCK_UN=8
LOCK_EX=2
F_GETFD=1
FD_CLOEXEC=1
F_SETFD=2

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

```