我有一个域domain_name.com。在我的本地计算机上,使用python flask建立了一个网站。在domain_name.com服务器的主目录中,我将所有文件放在文件夹“ school”中,并在python3虚拟环境中执行命令./main.py runserver
,该命令给出:
* Serving Flask app "memorizer.application" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
如何将其映射到domain_name.com/school?本地计算机位于ubuntu 18.04上,服务器为linux millennium。我可以使用cpanel。
以下是在服务器上运行脚本的顺序:
. cd school/
. ls
app.py memorizer.db Pipfile.lock setup.cfg
LICENSE migrations public tests
main.py passenger_wsgi.py questions tmp
memorizer Pipfile README.md tox.ini
. pwd
/home/user_name/school
. cat main.py
#!/usr/bin/env python3
from memorizer.application import manager
if __name__ == '__main__':
manager.run()
. source /home/user_name/virtualenv/school/3.5/bin/activate
(school:3.5). ./main.py runserver
* Serving Flask app "memorizer.application" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)