from django.conf.urls import include, urlfrom django.contrib import admin
urlpatterns = [ # Examples: # url(r'^$', 'django_test.views.home', name='home'), # url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)), url(r'^hello/$',include('article.urls')), url(r'^hello_template/$',include('article.urls')),]
from django.shortcuts import renderfrom django.http import HttpResponsefrom django.template.loader import get_templatefrom django.template import Context
def hello(request): name = "Hello World" html = "<html><body> Hi,my name is %s</body></html>" %name return HttpResponse(html)
def hello_template(request): name = "Akshat" t = get_template('hello.html') html = t.render(Context({"name":name})) return HttpResponse(html)
from django.conf.urls import url
from . import views
urlpatterns = [ url(r'^$',views.hello,name='hello'),]