A simple django tutorial, no database (hello world)

there is somewhere a tutorial for creating a hello world sample application with django.

+6
django
source share
3 answers

Yes, the third textbook.

http://docs.djangoproject.com/en/dev/intro/tutorial03/#write-your-first-view
although you should read up to this point.

Conf URL:

from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^hello_world/$', 'dot.path.to.view.hello_world'), ) 

View:

 from django.http import HttpResponse def hello_world(request): return HttpResponse("Hello, world.") 
+12
source share

When I started my site, I did not have a database running for a while. Just leave all the database fields in settings.py empty. You can follow other tutorials for examples of using views, URLs, templates, etc., And it should work fine, without using a database. However, when you get into models, forms, and user data, you will at least want to get a simple database like SQLite.

I came across a small factoid on the mailing list, which said that the database is required in django versions prior to 1.0 (the default anyway). But if you are new to django, you probably already have a version, a newer one.

Good luck

+2
source share

I can recommend Gigantuan . A good start to working with video tutorials.

+1
source share

All Articles