您好,登錄后才能下訂單哦!
本篇文章給大家分享的是有關如何設置python腳本運行參數,小編覺得挺實用的,因此分享給大家學習,希望大家閱讀完這篇文章后可以有所收獲,話不多說,跟著小編一起來看看吧。
D:\Python2.7\python.exe "D:/Django project/DjangoProject1/manage.py" Type 'manage.py help <subcommand>' for help on a specific subcommand. Available subcommands: [auth] changepassword createsuperuser [django] check compilemessages createcachetable dbshell diffsettings dumpdata flush inspectdb loaddata makemessages makemigrations migrate sendtestemail shell showmigrations sqlflush sqlmigrate sqlsequencereset squashmigrations startapp startproject test testserver [sessions] clearsessions [staticfiles] collectstatic findstatic runserver Process finished with exit code 0
沒有顯示監聽端口,因為它本身缺少參數
1、常用的命令行設置參數的方法
D:\Django project\DjangoProject1>python manage.py runserver 0.0.0.0:8000
在manage.py腳本的根目錄下運行cmd,輸入python manage.py + 參數,以下是運行結果
Performing system checks... System check identified no issues (0 silenced). You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions. Run 'python manage.py migrate' to apply them. April 11, 2017 - 13:26:13 Django version 1.10.6, using settings 'DjangoProject1.settings' Starting development server at http://0.0.0.0:8000/ Quit the server with CTRL-BREAK. [11/Apr/2017 13:27:16] "GET / HTTP/1.1" 200 1767 Not Found: /favicon.ico [11/Apr/2017 13:27:16] "GET /favicon.ico HTTP/1.1" 404 1944 Not Found: /favicon.ico [11/Apr/2017 13:27:16] "GET /favicon.ico HTTP/1.1" 404 1944
成功監聽到了8000端口
2、在pycharm中設置運行參數
run --> Edit Configurations -->Scrip parameters
設置好之后運行
D:\Python2.7\python.exe "D:/Django project/DjangoProject1/manage.py" runserver 0.0.0.0:8000 Performing system checks... System check identified no issues (0 silenced). You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions. Run 'python manage.py migrate' to apply them. April 11, 2017 - 14:07:30 Django version 1.10.6, using settings 'DjangoProject1.settings' Starting development server at http://0.0.0.0:8000/ Quit the server with CTRL-BREAK.
成功監聽8000端口。
Python主要應用于:1、Web開發;2、數據科學研究;3、網絡爬蟲;4、嵌入式應用開發;5、游戲開發;6、桌面應用開發。
以上就是如何設置python腳本運行參數,小編相信有部分知識點可能是我們日常工作會見到或用到的。希望你能通過這篇文章學到更多知識。更多詳情敬請關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。