python 来自:http://programming.oreilly.com/2014/04/simplifying-django.html
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 来自:http://programming.oreilly.com/2014/04/simplifying-django.html相关的知识,希望对你有一定的参考价值。
import os
import sys
BASE_PATH = os.path.dirname(__file__)
from django.conf import settings
from django.conf.urls import patterns, url
from django.core.management import execute_from_command_line
from django.shortcuts import render
settings.configure(
DEBUG=True,
SECRET_KEY='placerandomsecretkeyhere',
ROOT_URLCONF=sys.modules[__name__],
TEMPLATE_DIRS=(
os.path.join(BASE_PATH, 'templates'),
),
)
def index(request):
return render(request, 'index.html', {'request': request})
urlpatterns = patterns('',
url(r'^$', index, name='index'),
)
if __name__ == "__main__":
execute_from_command_line(sys.argv)
以上是关于python 来自:http://programming.oreilly.com/2014/04/simplifying-django.html的主要内容,如果未能解决你的问题,请参考以下文章
python Python programmer.py的演变
python:BeautifulSoup学习
[转]30 ESSENTIAL PYTHON TIPS AND TRICKS FOR PROGRAMMERS
python:网络爬虫的学习笔记
8 Traits of an Experienced Programmer that every beginner programmer should know
《What every programmer should know about memory》-What Programmers Can Do译