简体   繁体   English

Django Stripe Fake Card导致TemplateDoesNotExist错误

[英]Django Stripe Fake Card Causes TemplateDoesNotExist Error

When a person tries to submit a fake credit card into my Stripe payment form, I get an error page saying "TemplateDoesNotExist at /memberships/payment/ followed by membership/membership_payment.html".当有人试图在我的 Stripe 支付表单中提交假信用卡时,我收到一个错误页面,上面写着“TemplateDoesNotExist at /memberships/payment/ 后跟membership/membership_payment.html”。 Here is my code:这是我的代码:

views.py: https://dpaste.de/8EUX views.py: https://dpaste.de/8EUX

html files: https://dpaste.de/2Y37 html 文件: https://dpaste.de/2Y37

I need a way to not show that error page and redirect the user back to /memberships/ and display a card decline message instead.我需要一种不显示该错误页面并将用户重定向回 /memberships/ 并改为显示卡拒绝消息的方法。 However, if a user types in a valid card, that redirect is correct.但是,如果用户输入有效的卡片,则该重定向是正确的。 Otherwise maybe I need a way to validate the card is able to be charged to see if it is a real one before being able to submit the form.否则,也许我需要一种方法来验证该卡是否能够被收取费用,以查看它是否是真实的,然后才能提交表格。

Traceback has been included in the dpaste link. Traceback 已包含在 dpaste 链接中。

I am using this github project as a baseline so all files are mostly the same (except for my dpaste code updates):我使用这个 github 项目作为基线,所以所有文件都基本相同(除了我的 dpaste 代码更新):

https://github.com/danialbagheri/video-membership https://github.com/danialbagheri/video-membership

Any help would be greatly appreciated.任何帮助将不胜感激。

There is a typo in your path, you are missing a "s"您的路径中有错字,您缺少一个“s”

It should be "membership s /membership_payment.html" but your code uses "membership/membership_payment.html"它应该是“membership s /membership_payment.html”,但您的代码使用“membership/membership_payment.html”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM