Django's LiveServerTestCase Always Fails Due to Conflicting Address… Despite Address Appearing Free

前端 未结 5 1257
心在旅途
心在旅途 2020-12-31 05:45

I\'m currently working on cleaning my Django functional tests to use the LiveServerTestCase rather than bouncing selenium based tests off an instance of the development envi

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-31 06:31

    You can set (in settings.py) the environment variable DJANGO_LIVE_TEST_SERVER_ADDRESS to include multiple ranges of ports that will be attempted:

    os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS']="localhost:8000-8010,8080,9200-9300"
    

    Had the same issue myself, maybe this helps someone out.

提交回复
热议问题