LoginSignup
10
12

More than 5 years have passed since last update.

Djangoのサーバ起動

Posted at

とりあえず起動する

$ python manage.py runserver 8000

外部アクセスできる状態でサーバ起動する

アクセス制限がかかっているので、settings.pyのALLOWED_HOSTSを修正する必要がある。
フルオープンにするときは'*'を入れればいい。

settings.py
ALLOWED_HOSTS = ["*"]

サーバを起動するときは0.0.0.0で起動する

$ python manage.py runserver 0.0.0.0:8000
10
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
12