python:django:runserver

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
python:django:runserver [2019/05/18 02:23] – 外部編集 非ログインユーザーpython:django:runserver [2020/12/16 06:38] (現在) – [外部にフルオープンな開発サーバーの起動] ともやん
行 1: 行 1:
 +<html>
 +  <style>
 +    #result pre, #mincode pre {
 +      /*height: 300px;*/
 +      overflow: scroll;
 +      overflow-x: hidden;
 +      font-size: 10px;
 +    }
 +    #mintbl table {
 +      font-size: 12px;
 +    }
 +    .dokuwiki .plugin_wrap table {
 +      width: auto;
 +    }
 +  </style>
 +</html>
 ====== 開発用サーバの起動 (manage.py runserver) ====== ====== 開発用サーバの起動 (manage.py runserver) ======
-プロジェクトが正常に作成されると開発用サーバを起動して http://127.0.0.1:8000/ にアクセスすることで「It worked!」のページを表示することができる。+プロジェクトが正常に作成されると開発用サーバを起動して http://127.0.0.1:8000/ にアクセスすることで「The install worked successfully! Congratulations!」のページを表示することができる。
 <code> <code>
 $ cd django_project $ cd django_project
 $ python manage.py runserver $ python manage.py runserver
 +</code>
 +<WRAP prewrap 100% #result>
 +<code>
 +Watching for file changes with StatReloader
 Performing system checks... Performing system checks...
  
 System check identified no issues (0 silenced). System check identified no issues (0 silenced).
  
-You have unapplied migrations; your app may not work properly until they are applied.+You have 17 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. Run 'python manage.py migrate' to apply them.
- +March 292020 - 16:19:35 
-July 202015 - 16:36:19 +Django version 3.0.4, using settings 'django_project.settings'
-Django version 1.8.3, using settings 'django_project.settings'+
 Starting development server at http://127.0.0.1:8000/ Starting development server at http://127.0.0.1:8000/
-Quit the server with CONTROL-C.+Quit the server with CTRL-BREAK.
 </code> </code>
 +</WRAP>
  http://127.0.0.1:8000/にアクセスした様子。\\  http://127.0.0.1:8000/にアクセスした様子。\\
-{{:python:django:django_run_devserver.png?558|Django開発サーバ}}\\+{{:python:django:django_3.0_runserver.png?558|Django開発サーバ}}\\
  
 **メモ: 開発用サーバのポートを変更するには、コマンドを以下のようにする。** **メモ: 開発用サーバのポートを変更するには、コマンドを以下のようにする。**
行 23: 行 43:
 $ python manage.py runserver 8080 $ python manage.py runserver 8080
 </code> </code>
 +
 +===== 外部にフルオープンな開発サーバーの起動 =====
 +**settings.py** にてすべてのクライアント **Host:** ヘッダーを許可するように設定する。\\
 +<WRAP prewrap 100%>
 +<code>
 +$ cd django_project
 +$ vi django_project/settings.py
 +</code>
 +</WRAP>
 +<WRAP prewrap 100% #mincode>
 +<code python django_project/settings.py>
 +ALLOWED_HOSTS = ['*']
 +</code>
 +</WRAP>
 +
 +開発サーバーを **0.0.0.0:8000** で起動する。\\
 +<WRAP prewrap 100%>
 +<code>
 +$ python manage.py runserver 0.0.0.0:8000
 +</code>
 +</WRAP>
 +<WRAP prewrap 100% #result>
 +<code>
 +Watching for file changes with StatReloader
 +Performing system checks...
 +
 +System check identified no issues (0 silenced).
 +December 16, 2020 - 06:37:23
 +Django version 3.1.4, using settings 'django_project.settings'
 +Starting development server at http://0.0.0.0:8000/
 +Quit the server with CONTROL-C.
 +</code>
 +</WRAP>
  
  • python/django/runserver.1558113795.txt.gz
  • 最終更新: 2019/05/18 02:23
  • by 非ログインユーザー