Created
September 27, 2019 17:38
-
-
Save lamenezes/f16811df102d60d4daee845df537aa26 to your computer and use it in GitHub Desktop.
django one-file hello world
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
""" | |
To run the app execute: | |
python hello.py runserver | |
And then access http://127.0.0.1:8000/ on your browser | |
""" | |
import sys | |
from django.conf import settings | |
from django.core.management import execute_from_command_line | |
from django.http import HttpResponse | |
from django.urls import path | |
def hello(request): | |
return HttpResponse('Hello World') | |
settings.configure() | |
settings.DEBUG = True | |
settings.ROOT_URLCONF = [path('', hello)] | |
execute_from_command_line(sys.argv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment