Created
April 18, 2014 13:24
-
-
Save FZambia/11044152 to your computer and use it in GitHub Desktop.
minimal django
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: | |
# python web.py runserver | |
from django.conf import settings | |
from django.conf.urls import patterns | |
from django.http import HttpResponse | |
if not settings.configured: | |
settings.configure( | |
DEBUG=True, | |
ROOT_URLCONF='web', | |
TEMPLATE_DIRS=['.'], | |
) | |
urlpatterns = patterns( | |
'', | |
(r'^$', 'web.index'), | |
) | |
def index(request): | |
return HttpResponse('hello') | |
if __name__ == '__main__': | |
from django.core.management import execute_from_command_line | |
execute_from_command_line() |
Author
FZambia
commented
Apr 18, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment