Django can't find staticfiles with Debug=False and Allowed_Hosts

后端 未结 3 1303
陌清茗
陌清茗 2021-02-20 17:05

Hi all I\'m having trouble solving this issue: If I turn DEBUG to False, I can\'t run manage.py runserver:

CommandError: You must set settings.ALLOWED_HOSTS if D         


        
3条回答
  •  青春惊慌失措
    2021-02-20 17:27

    If you still need to server static locally (e.g. for testing without debug) you can run devserver in insecure mode:

    manage.py runserver --insecure
    

提交回复
热议问题