我有简单的Django项目名称阿贾克斯。而我安装了这个项目的名称促销码只有一个应用程序。 我在这个项目中的问题是js和python之间的Ajax调用。我不能使用ajax调用函数处理Succes。错误:函数()结果我得到了。 我知道我在Ajax调用函数促销码的应用程序和URL映射urls.py错误,但我解决不了这个。请帮我:)Ajax调用JS用在Python
我主要urls.py文件是:
from datetime import datetime
from django.conf.urls import url,include
import django.contrib.auth.views
urlpatterns = [
url(r'^', include('promocode.urls'))]
我的促销码应用urls.py文件是:
from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^$', views.index,name='index'),
url(r'^$', views.extract_json)]
我views.py文件是:
from django.shortcuts import render
import json
from suds.client import Client as Client
from django.http.response import HttpResponse
def index(request):
return render(requ