Django returns string from url manager

Is there a way to return the string "hello world" from a bare django project (without creating an application and views.py)?

Something like that:

urlpatterns = patterns('', url(r'^$', plaint_text_module, 'Hello World!'), ) 
+6
source share
1 answer

You can add the built-in lambda (or view the called information):

 urlpatterns = patterns('', url(r'^$', lambda request: HttpResponse('Hello World!'), name='hello_world'), ) 
+7
source

All Articles