django.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sat, 10 Feb 2018 01:28:53 +0200
changeset 2227 1e9323e7ec88
parent 1912 8b81a8f0f692
child 2228 837f1337c59b
permissions -rw-r--r--
Removed files: I don't longer have interest on topic.

.. -*- coding: utf-8; -*-

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

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