django.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Mon, 22 Feb 2016 12:41:52 +0200
changeset 1903 901e7394849f
parent 1346 a2fbf50a43f4
child 1905 fba288d59662
permissions -rw-r--r--
Decrease intent to increase space usage on mobile.

.. -*- coding: utf-8; -*-
.. include:: HEADER.rst

=========
 Django.
=========
.. contents::

Hello world Django app.
=======================
::

  $ cd ~/devel
  $ django-admin.py startproject dj
  $ cd dj
  $ django-admin.py startapp hello
  $ cat >hello/views.py <<EOF
  from django.http import HttpResponse
  def hello(request):
      return HttpResponse("Hello world")
  EOF
  $ cat >urls.py <<EOF
  from django.conf.urls.defaults import patterns, include, url
  from hello.views import hello
  urlpatterns = patterns(
      '',
      url(r'^hello/$', hello),
  )
  EOF
  $ ./manage.py runserver

Start server.
=============

  $ ./manage.py runserver
  $ ./manage.py runserver 8080