# /project/serect.py
import os
# 启动django 项目
def run():
# os.system('sudo chmod 777 *.log')
os.system('sudo service nginx start')
os.system('uwsgi my_uwsgi.ini')
# 关闭所有项目
def close():
os.system('sudo service nginx stop')
os.system('uwsgi --stop my_uwsgi.pid')
if __name__ == '__main__':
option = input("""\nWhat you want to do with django
1)run the site
2)shutdown this site\n""")
if option == "1":
run()
elif option == "2":
close()
else:
print("ok.")
网友评论