Created
July 16, 2015 01:20
-
-
Save simonw/68662325b25dff560517 to your computer and use it in GitHub Desktop.
A django view in a single file, adapted from https://raw.githubusercontent.com/halfnibble/django-light/master/hello.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
from django.http import HttpResponse | |
from django.conf.urls import url | |
settings.configure( | |
DEBUG = True, | |
SECRET_KEY = 'yourrandomsecretkey', | |
ROOT_URLCONF = __name__, | |
MIDDLEWARE_CLASSES = (), | |
) | |
urlpatterns = ( | |
url(r'^$', lambda request: HttpResponse('Hello!')), | |
) | |
if __name__ == '__main__': | |
from django.core.management import execute_from_command_line | |
import sys | |
execute_from_command_line(sys.argv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment