{"id":3727,"date":"2011-11-21T03:25:37","date_gmt":"2011-11-20T18:25:37","guid":{"rendered":"http:\/\/mimumimu.net\/blog\/2011\/11\/21\/python-django-%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f%e3%80%82-%e3%81%9d%e3%81%ae%ef%bc%92%ef%bc%8e%e3%81%a8%e3%82%8a%e3%81%82%e3%81%88%e3%81%9a%e3%83%9a%e3%83%bc%e3%82%b8%e3%82%92%e5%87%ba%e3%81%97\/"},"modified":"2012-04-21T18:23:13","modified_gmt":"2012-04-21T09:23:13","slug":"python-django-%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f%e3%80%82-%e3%81%9d%e3%81%ae%ef%bc%92%ef%bc%8e%e3%81%a8%e3%82%8a%e3%81%82%e3%81%88%e3%81%9a%e3%83%9a%e3%83%bc%e3%82%b8%e3%82%92%e5%87%ba%e3%81%97","status":"publish","type":"post","link":"https:\/\/mimumimu.net\/blog\/2011\/11\/21\/python-django-%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f%e3%80%82-%e3%81%9d%e3%81%ae%ef%bc%92%ef%bc%8e%e3%81%a8%e3%82%8a%e3%81%82%e3%81%88%e3%81%9a%e3%83%9a%e3%83%bc%e3%82%b8%e3%82%92%e5%87%ba%e3%81%97\/","title":{"rendered":"Python + Django \u3057\u3066\u307f\u305f\u3002 \u305d\u306e\uff12\uff0e\u3068\u308a\u3042\u3048\u305a\u30da\u30fc\u30b8\u3092\u51fa\u3057\u3066\u307f\u308b\u3002"},"content":{"rendered":"<p>\u3069\u30fc\u3082\u3002\u307f\u3080\u3089\u3093\u3067\u3059\u3002<br \/>\u3068\u3044\u3046\u308f\u3051\u3067\u3001 <a href=\"http:\/\/mimumimu.net\/blog\/2011\/11\/21\/python-django-%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f%e3%80%82-%e3%81%9d%e3%81%ae%ef%bc%91%ef%bc%8e%e3%81%a8%e3%82%8a%e3%81%82%e3%81%88%e3%81%9a%e5%8b%95%e3%81%8b%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b\/\">\u7b2c\uff11\u56de<\/a> \u306e\u7d9a\u304d\u3068\u3057\u3066\u9069\u5f53\u306b\u307a\u3051\u307a\u3051\u3068\u3002<\/p>\n<p>&#160;<\/p>\n<h3>\uff11\uff0e settings.py \u3092\u7de8\u96c6\u3059\u308b\u3002<\/h3>\n<p>settings.py \u3092\u7de8\u96c6\u3057\u3066\u3001 \u4efb\u610f\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u8aad\u307f\u8fbc\u3080\u3088\u3046\u306b\u6307\u793a\u3057\u307e\u3059\u3002<\/p>\n<div style=\"padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px\" id=\"scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:68183e13-40c5-4e55-ae14-4fe5eab93a91\" class=\"wlWriterEditableSmartContent\">\n<pre class=\"brush: python;\">INSTALLED_APPS = (\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.sites',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n    # Uncomment the next line to enable the admin:\n    # 'django.contrib.admin',\n    # Uncomment the next line to enable admin documentation:\n    # 'django.contrib.admindocs',\n)<\/pre>\n<\/div>\n<p>\u4e0a\u8a18\u306e\u3088\u3046\u306a\u3053\u3068\u304c\u66f8\u304b\u308c\u3066\u3044\u308b\u7b87\u6240\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001 <br \/>\u305d\u3053\u306b\u3001<\/p>\n<div style=\"padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px\" id=\"scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:c8df12d4-862e-46fa-9283-efa933b5faf5\" class=\"wlWriterEditableSmartContent\">\n<pre class=\"brush: python;\">INSTALLED_APPS = (\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.sites',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n    'test_app',\n)<\/pre>\n<\/div>\n<p>\u3068\u3044\u3046\u3088\u3046\u306b\u3001\uff08\u6700\u4e0b\u884c\uff09 <br \/>test_app \uff08\u4f5c\u6210\u3057\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u540d\uff09 \u3092\u8ffd\u8a18\u3002<\/p>\n<p>&#160;<\/p>\n<h3>\uff12\uff0e urls.py \u3092\u7de8\u96c6\u3002<\/h3>\n<p>urls.py \u3092\u7de8\u96c6\u3057\u3001\u4efb\u610f\u306e URI \u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092 <br \/>\u4efb\u610f\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u306b\u6e21\u308b\u3088\u3046\u306b\u3001 URI \u3068\u95a2\u6570\u3092\u95a2\u9023\u3065\u3051\u307e\u3059\u3002<\/p>\n<p>\u201d\u201d\u201d <br \/>\u3069\u306e\u672c\u8aad\u3093\u3067\u3082\u3001<br \/>\u307f\u3093\u306a\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u3058\u3083\u306a\u304f\u3066\u3001\u95a2\u6570\u3084\u30e1\u30bd\u30c3\u30c9\u3068\u66f8\u304b\u308c\u3066\u3044\u308b\u304b\u3089\u3001\u95a2\u6570\u3068\u66f8\u3044\u305f\u65b9\u304c\u3044\u3044\u6c17\u304c\u3057\u3066\u304d\u305f\u3002<\/p>\n<p>\u30fb\u30fb\u4ed6\u306e\u8a00\u8a9e\u3067\u306e\u7528\u8a9e\u306b\u5408\u308f\u305b\u308b\u306a\u3089\u3070\u3001\u30cf\u30f3\u30c9\u30e9\u3068\u3082\u66f8\u3051\u305d\u3046\u306a\u6c17\u304c\u3059\u308b\u3051\u3069\u3001\u3080\u30fc\u3002&#160; <br \/>\u201d\u201d\u201d<\/p>\n<div style=\"padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px\" id=\"scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:cde50b35-6f76-4faf-8513-d0a499755154\" class=\"wlWriterEditableSmartContent\">\n<pre class=\"brush: python;\">urlpatterns = patterns('',\n    # Examples:\n    # url(r'^$', 'test_project.views.home', name='home'),\n    # url(r'^test_project\/', include('test_project.foo.urls')),\n\n    # Uncomment the admin\/doc line below to enable admin documentation:\n    # url(r'^admin\/doc\/', include('django.contrib.admindocs.urls')),\n\n    # Uncomment the next line to enable the admin:\n    # url(r'^admin\/', include(admin.site.urls)),\n)<\/pre>\n<\/div>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3053\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u308c\u3092\u5909\u66f4\u3057\u3001<\/p>\n<div style=\"padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px\" id=\"scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:d3749091-798d-4616-bd11-6839c172ef6e\" class=\"wlWriterEditableSmartContent\">\n<pre class=\"brush: python;\">urlpatterns = patterns('',\n    (r'\\$', 'test_app.views.home'),\n)<\/pre>\n<\/div>\n<p>\u3068\u3044\u3046\u611f\u3058\u306b\u3002<\/p>\n<p>\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u3001\u5168\u3066\u306e\u30a2\u30af\u30bb\u30b9\u304c\u3001 <br \/>test_app \u306e\u3001 views.py \u306e\u4e2d\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3001 home \u30e1\u30bd\u30c3\u30c9\u306b\u3066\u51e6\u7406\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u7b2c\uff11\u5f15\u6570\u306f\u6b63\u898f\u8868\u73fe\u3067\u8a18\u8ff0\u3057\u307e\u3059\u306e\u3067\u3001 <br \/>(r\u2019^lang\/(python|CSharp)\/$\u2019, \u2018test_app.views.correct\u2019) <br \/>\u306a\u3093\u3066\u66f8\u304d\u65b9\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>&#160;<\/p>\n<h3>\uff13\uff0eviews.py \u3092\u66f8\u304f\u3002<\/h3>\n<p>\u5148\u307b\u3069\u4f5c\u6210\u3057\u305f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3078\u79fb\u52d5\u3057\u3066\u3001 <br \/>\u305d\u306e\u4e2d\u306e views.py \u3092\u7de8\u96c6\u3057\u3001\u51e6\u7406\u5185\u5bb9\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<p>views.py : <\/p>\n<div style=\"padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px\" id=\"scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:52d74a9f-1826-4364-8e8c-67193271e9d1\" class=\"wlWriterEditableSmartContent\">\n<pre class=\"brush: text;\">from django.http import HttpResponse\n\ndef home(req):\n    return HttpResponse('Hello Django World !')<\/pre>\n<\/div>\n<p>&#160;<\/p>\n<h3>\uff14\uff0e\u52d5\u304b\u3057\u3066\u307f\u308b\u3002<\/h3>\n<p><a href=\"http:\/\/mimumimu.net\/blog\/wp-content\/uploads\/2011\/11\/image22.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"http:\/\/mimumimu.net\/blog\/wp-content\/uploads\/2011\/11\/image_thumb22.png\" width=\"557\" height=\"297\" \/><\/a><\/p>\n<p>&#160;<\/p>\n<p>\u30c6\u30ad\u30b9\u30c8\u304c\u8868\u793a\u3055\u308c\u305f\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3069\u30fc\u3082\u3002\u307f\u3080\u3089\u3093\u3067\u3059\u3002\u3068\u3044\u3046\u308f\u3051\u3067\u3001 \u7b2c\uff11\u56de \u306e\u7d9a\u304d\u3068\u3057\u3066\u9069\u5f53\u306b\u307a\u3051\u307a\u3051\u3068\u3002 &#160; \uff11\uff0e settings.py \u3092\u7de8\u96c6\u3059\u308b\u3002 settings.py \u3092\u7de8\u96c6\u3057\u3066\u3001 \u4efb\u610f\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u8aad\u307f\u8fbc\u3080\u3088\u3046\u306b\u6307\u793a\u3057\u307e [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,14,7],"tags":[118,584,121],"class_list":["post-3727","post","type-post","status-publish","format-standard","hentry","category-python","category-web","category-dev","tag-django","tag-python","tag-121"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/posts\/3727","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/comments?post=3727"}],"version-history":[{"count":0,"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/posts\/3727\/revisions"}],"wp:attachment":[{"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/media?parent=3727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/categories?post=3727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/tags?post=3727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}