Differences between revisions 1 and 2
Revision 1 as of 2009-02-24 12:35:47
Size: 392
Editor: 147
Comment:
Revision 2 as of 2009-02-24 12:36:32
Size: 394
Editor: 147
Comment:
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
{attachment:views.py} {{attachment:views.py}}

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 d

vojicu

   1     (r'^hello/$', views.hello)

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