webpages ✓ To process data from users (i.e from the browser) ✓ To access server resources • Database, filesystem, other programs and so on ✓ To provide different resources in different contexts • Authentication, sessions
is a Python framework to develop webapps ✓ Django embeds a web server for development purpose ๏ But it is not a (real) web server that will be used for production
urls.py wsgi.py A command-line utility that lets you interact with this Django project in various ways. Settings/configuration for this Django project. The URL declarations for this Django project; a "table of contents" of your Django-powered site. A configuration file to deploy your Django application (later in this course)
the HTTP response helloyou/views.py from django.shortcuts import render def index(request): return render(request,'helloyou/index.html',{}); We will see more advance techniques to work with templates later
the request • URLs are defined in the same way as for GET helloyou/views.py from django.views.decorators.csrf import csrf_exempt @csrf_exempt def sayHelloPost(request): yourname = request.POST['yourname'] return HttpResponse("Hello %s!" % yourname)