Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windwos怎么配置路径 #2

Open
yidongyi opened this issue Oct 22, 2020 · 3 comments
Open

windwos怎么配置路径 #2

yidongyi opened this issue Oct 22, 2020 · 3 comments

Comments

@yidongyi
Copy link

windwos怎么配置路径,报错 ErrorOSError(22, '文件名、目录名或卷标语法不正确。')

@DaiQiangReal
Copy link
Owner

修改app/views.py 70到75行 用python的os.path 进行转换

@needUserCookies
def main(req):
    global rootpath
    try:
        with open("./app/rootpath.conf") as root:
            rootpath=root.read()
    except Exception:
        pass
    Folder = Utils.Folder(rootpath)
    dataJson = Folder.getFolderJson()
    language=req.COOKIES.get('language')

    if language=="en":
        return render(req, "index_en-US.html", {"dataJson": dataJson})
    if language=="cn":
        return render(req, "index_zh-CN.html", {"dataJson": dataJson})

@yidongyi
Copy link
Author

修改app/views.py 70到75行 用python的os.path 进行转换

@needUserCookies
def main(req):
    global rootpath
    try:
        with open("./app/rootpath.conf") as root:
            rootpath=root.read()
    except Exception:
        pass
    Folder = Utils.Folder(rootpath)
    dataJson = Folder.getFolderJson()
    language=req.COOKIES.get('language')

    if language=="en":
        return render(req, "index_en-US.html", {"dataJson": dataJson})
    if language=="cn":
        return render(req, "index_zh-CN.html", {"dataJson": dataJson})

可以了,感谢

@DaiQiangReal
Copy link
Owner

那就麻烦提个 pull Request 吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants