from django.conf.urls import url
from django.contrib import admin
from news import views as newview
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^year_archive/(?P<year>[0-9]{4})/$', newview.year_archive),
url(r'^$', newview.index),
url(r'^polls/', include('polls.urls')),
]
node2:/zjzc/mysite/polls#cat urls.py
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^getcode/$', views.getcode),
]
node2:/zjzc/mysite/mysite#cat ../polls/views.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def getcode(req):
a=req.GET['aa']
print a
return HttpResponse(a)