Created
May 8, 2014 02:28
-
-
Save wwj718/cc10a641e5718abee03e to your computer and use it in GitHub Desktop.
简单清晰的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
#coding=utf-8 | |
import sys | |
from django.conf import settings | |
from django.conf.urls import patterns | |
from django.http import HttpResponse | |
from django.core.management import execute_from_command_line | |
settings.configure( | |
DEBUG=True, | |
SECRET_KEY='placerandomsecretkeyhere', | |
ROOT_URLCONF=sys.modules[__name__], | |
) | |
def index(request): | |
return HttpResponse('Powered by Django') | |
urlpatterns = patterns('', | |
(r'^$', index), | |
) | |
if __name__ == "__main__": | |
execute_from_command_line(sys.argv) | |
#run : python test.py runserver |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment