2015-03-12 5 views
0

Я пытаюсь настроить ежемесячную абонентскую подписку с помощью django-stripe-payments. Я выполнил инструкцию по установке и все еще имею проблемы.Настройка подписки с помощью Stripe - Django-stripe-payments - Ошибка TemplateDoesNotExist

Я добавил платежи в установленных приложений, но я получаю сообщение об ошибке TemplateDoesNotExist

Я проверил .../Библиотека/python2.7/сайт-пакеты/платежи/шаблоны/платежи/шаблоны/платежи/_subscribe_form.html и файл есть! Однако отслеживающий говорит Файл не существует

view.py

@login_required 
    def subscribe(request): 
     form = PlanForm(request.POST or None) 
     template = 'payments/templates/payments/_subscribe_form.html' 
     context = { 
     "form": form, 
     } 
     return render(request, template, context) 

urls.py

url(r"^payments/", include("payments.urls")), 

Traceback

TemplateDoesNotExist at /subscriptions/subscribe 
payments/templates/payments/_subscribe_form.html 
Request Method: GET 
Request URL: http://127.0.0.1:8000/subscriptions/subscribe 
Django Version: 1.6.5 
Exception Type: TemplateDoesNotExist 
Exception Value:  
payments/templates/payments/_subscribe_form.html 
Exception Location: /Users/andysair/Documents/personal/nmninja/lib/python2.7/site-packages/django/template/loader.py in find_template, line 131 
Python Executable: /Users/andysair/Documents/personal/nmninja/bin/python 
Python Version: 2.7.5 
Python Path:  
['/Users/andysair/Documents/personal/nmninja/nmninja', 
'/Users/andysair/Documents/personal/nmninja/lib/python27.zip', 
'/Users/andysair/Documents/personal/nmninja/lib/python2.7', 
'/Users/andysair/Documents/personal/nmninja/lib/python2.7/plat-darwin', 
'/Users/andysair/Documents/personal/nmninja/lib/python2.7/plat-mac', 
'/Users/andysair/Documents/personal/nmninja/lib/python2.7/plat-mac/lib-scriptpackages', 
'/Users/andysair/Documents/personal/nmninja/Extras/lib/python', 
'/Users/andysair/Documents/personal/nmninja/lib/python2.7/lib-tk', 
'/Users/andysair/Documents/personal/nmninja/lib/python2.7/lib-old', 
'/Users/andysair/Documents/personal/nmninja/lib/python2.7/lib-dynload', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', 
'/Users/andysair/Documents/personal/nmninja/lib/python2.7/site-packages'] 
Server time: Thu, 12 Mar 2015 22:34:56 +1100 
Template-loader postmortem 

Django tried loading these templates, in this order: 
Using loader django.template.loaders.filesystem.Loader: 
/Users/andysair/Documents/personal/nmninja/nmninja/templates/payments/templates/payments/_subscribe_form.html (File does not exist) 
Using loader django.template.loaders.app_directories.Loader: 
/Users/andysair/Documents/personal/nmninja/lib/python2.7/site-packages/django/contrib/admin/templates/payments/templates/payments/_subscribe_form.html (File does not exist) 
/Users/andysair/Documents/personal/nmninja/lib/python2.7/site-packages/django/contrib/auth/templates/payments/templates/payments/_subscribe_form.html (File does not exist) 
/Users/andysair/Documents/personal/nmninja/lib/python2.7/site-packages/django_forms_bootstrap/templates/payments/templates/payments/_subscribe_form.html (File does not exist) 
/Users/andysair/Documents/personal/nmninja/lib/python2.7/site-packages/payments/templates/payments/templates/payments/_subscribe_form.html (File does not exist) 
+0

У вас есть приложение в переменной 'INSTALLED_APPS' вашего файла' settings.py'? – argaen

ответ

1

В дополнение к успеху 'платежи' в ваш INSTALLED_APPS, скорректируйте {% extends "site_base.html"%} в баре e.html в файл base.html вашего проекта, то есть замените файл site_base.html на файл base.html вашего проекта.

Смежные вопросы