Skip to content

Instantly share code, notes, and snippets.

@nsmgr8
Last active April 12, 2020 16:53
Show Gist options
  • Save nsmgr8/6734519 to your computer and use it in GitHub Desktop.
Save nsmgr8/6734519 to your computer and use it in GitHub Desktop.
The minimal django hello world! However, never, ever, NEVER write such code. Always modularise your code and follow the popular/de-facto/standard convention.
from django.conf.urls import url
from django.http import HttpResponse
DEBUG, ROOT_URLCONF, SECRET_KEY = True, __name__, '.'
urlpatterns = url('', lambda _: HttpResponse('Hello world')),
@nsmgr8
Copy link
Author

nsmgr8 commented Apr 12, 2020

Run with django dev server as follows:

PYTHONPATH=. django-admin runserver --settings=djhello

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment