django2 setting配置有关

1、ALLOWED_HOSTS=[];默认为空,

  当配置的时候是需要进行设置的,如果不设置会有这样的错误:
  Invalid HTTP_HOST header: '127.0.0.1:8000'. You may need to add '127.0.0.1' to ALLOWED_HOSTS.

  如果DEBUG = True;默认 有ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]']

猜你喜欢

转载自www.cnblogs.com/dreamzqw/p/12394933.html
今日推荐