Django,从 php 到 Django

发布于 2024-08-06 09:18:51 字数 250 浏览 2 评论 0原文

我有一个使用 Django 完成的网站,之前是使用 PHP 和 CodeIgniter 完成的。我已将网站移至 Webfaction,更改了 DNS 和所有其他配置,但现在我的电子邮件充满了这样的错误:

Error (EXTERNAL IP): /index.php/main/leer/7497

我不知道为什么 Django 应用程序正在寻找来自 PHP 应用程序的页面,特别是因为 PHP应用程序位于另一台主机中。

I have a website done with Django, that was previously done with PHP and CodeIgniter. I've moved the website to Webfaction, changed the DNS and all other configurations, but now my email is full of errors like this:

Error (EXTERNAL IP): /index.php/main/leer/7497

I don't know why the Django app is looking for pages from the PHP app, specially since the PHP app was in another host.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

指尖上的星空 2024-08-13 09:18:51

这些 URL 是来自您的旧网站吗?这可能是因为人们拥有过时的书签,尝试导航到它们,却收到了 404 错误。您可能需要考虑捕获这些错误,并重定向到响应代码为 302 的新 URL。

我无法想象这些错误是由 Django 引起的(除非这些报告来自 Django 报告 404,而且它是免费的) 。

Are those URLs from your old site? That's probably a case of people having stale bookmarks, trying to navigate to them, and getting 404s. You might want to consider catching those, and redirecting to the new URL with response code 302.

I can't imagine those errors are caused by Django (except in the sense that the reports are from Django reporting 404s, which it does for free).

岁吢 2024-08-13 09:18:51

我同意上面的观点。只是想添加您应该使用 django.contrib.redirects 来移动重定向。

您可以在此处阅读更多相关信息

I agree with above. Just want to add you should use django.contrib.redirects to move the redirects.

You can read more about it here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文