如何在创建CNAME之前在PythonAnywhere上测试我的网站?

时间:2021-09-10 10:43:38

I've gotten part way through deploying my new webapp on PythonAnywhere, and currently it's got the 'Coming Soon' place holder.

我通过在PythonAnywhere上部署我的新webapp获得了部分的进展,现在它有了“即将到来”的占位符。

When I refresh the app from the web tab it tells me I need to set the CNAME,and from what I remember that involves redirecting from my Domain Service (Gandi in this case).

当我从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.

你的域名配置有问题。有关详细信息,请参阅下面的DNS设置部分。注意,DNS更改可能需要一段时间才能在internet上传播。它们占用的确切时间将取决于您的域配置,但可能长达一天。

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

您的域名是webredir.vip.gandi.net。有关如何正确设置它的更多信息,请查看此帮助页面。

I don't want to do that yet.

我还不想那样做。

What I want is to 'preview' my page at webapp-XXXXXX.pythonanywhere.com before it goes live.

我想在webapp- xxxxxxxxx .pythonanywhere网站上“预览”我的页面。

This suggests that I:

这表明,我:

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.

添加一行,其中包含上一步获得的IP地址,然后是一个选项卡,然后是在PythonAnywhere中设置的web应用程序的主机名。

But I've not found that to work, and besides, how would that let me see what's hosted online? It would just let me access it via a different URL.

但我还没发现它能起作用,而且,它怎么能让我看到什么是在网上托管的呢?它会让我通过不同的URL访问它。

Here what I added to my hosts file:

这里我添加到我的主机文件:

   50.19.109.98    webapp-206115.pythonanywhere.com/

How can I test my website on PythonAnywhere before setting up my CNAME?

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

1 个解决方案

#1


1  

The easiest solution i found for this is to rename the webapp to <username>.pythonanywhere.com. Thats the default for the free subscription and it still works for me after i change to a payed plan. But i dont know if this is because i already had registered a webapp under this name or if this always works.

我找到的最简单的解决方案是将webapp重命名为 .pythonanywhere.com。这是免费订阅的默认设置,在我改变支付计划后仍然适用。但我不知道这是因为我已经用这个名字注册了一个webapp,还是它一直都能用。

#1


1  

The easiest solution i found for this is to rename the webapp to <username>.pythonanywhere.com. Thats the default for the free subscription and it still works for me after i change to a payed plan. But i dont know if this is because i already had registered a webapp under this name or if this always works.

我找到的最简单的解决方案是将webapp重命名为 .pythonanywhere.com。这是免费订阅的默认设置,在我改变支付计划后仍然适用。但我不知道这是因为我已经用这个名字注册了一个webapp,还是它一直都能用。