Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
简单清晰的Django
#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
You can’t perform that action at this time.