如何在设置我的 CNAME 之前在 PythonAnywhere 上测试我的网站?

How to test my website on PythonAnywhere before setting up my CNAME?

我已经完成了在 PythonAnywhere 上部署我的新 Web 应用程序的部分过程,目前它有 'Coming Soon' 占位符。

当我从 Web 选项卡刷新应用程序时,它告诉我需要设置 CNAME,据我所知,这涉及从我的域服务(在本例中为 Gandi)重定向。

There is a problem with your domain name configuration. Take a look at the DNS setup section below for details. Be aware that DNS changes can take some time to propagate across the internet. The exact time they take will depend on your domain configuration, but it could be as long as a day.

You domain's current CNAME is webredir.vip.gandi.net. Check this help page for more information about how to set it up correctly.

我还不想那样做。

我想要的是 'preview' 我的页面在 webapp-XXXXXX.pythonanywhere.com 上线之前。

建议我:

add a line with the IP address you got from the previous step, then a tab, then the host name you've set up the web app with in PythonAnywhere.

但我发现它不起作用,此外,它如何让我看到在线托管的内容?它只会让我通过不同的 URL.

访问它

这是我添加到 hosts 文件的内容:

   50.19.109.98    webapp-206115.pythonanywhere.com/

如何在设置 CNAME 之前在 PythonAnywhere 上测试我的网站?

我找到的最简单的解决方案是将 webapp 重命名为 <username>.pythonanywhere.com。这是免费订阅的默认设置,在我更改为付费计划后它仍然适用于我。但我不知道这是因为我已经用这个名字注册了一个网络应用程序还是这是否总是有效。