Differences between revisions 5 and 6
Revision 5 as of 2009-02-24 12:43:17
Size: 543
Editor: 147
Comment:
Revision 6 as of 2009-02-26 10:01:43
Size: 547
Editor: 147
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:

Hello, world

  • Vytvorím nový projekt, urobím syncdb

  • V adresári projektu vytvorím modul views.py:

   1 from django.http import HttpResponse
   2 
   3 def hello(request):
   4     html="""<html>
   5     <body>
   6     <h1>Hello, world</h1>
   7     </body>
   8     </html>
   9     """
  10     return(HttpResponse(html))
views.py
  • V súbore urls.py pridám do urlpatterns dvojicu

   1     (r'^hello/$', views.hello)
  • Samozrejme, predtým treba v urls.py dať kdesi hore

   1 import views

Celý projekt máte tu: hello.tar.gz

KMaDGWiki: ProgramovanieInternetovychAplikacii/HelloWorld (last edited 2009-02-26 10:01:43 by 147)