Changeset 2524
- Timestamp:
- 03/15/06 21:02:51 (3 years ago)
- Files:
-
- django/branches/magic-removal/AUTHORS (modified) (1 diff)
- django/branches/magic-removal/django/conf/locale/zh_TW/LC_MESSAGES/django.mo (modified) (previous)
- django/branches/magic-removal/django/conf/locale/zh_TW/LC_MESSAGES/django.po (modified) (11 diffs)
- django/branches/magic-removal/django/views/static.py (modified) (3 diffs)
- django/branches/magic-removal/docs/faq.txt (modified) (1 diff)
- django/branches/magic-removal/docs/flatpages.txt (modified) (1 diff)
- django/branches/magic-removal/docs/settings.txt (modified) (1 diff)
- django/branches/magic-removal/docs/templates.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/magic-removal/AUTHORS
r2467 r2524 38 38 Jiri Barton 39 39 Ned Batchelder <http://www.nedbatchelder.com/> 40 Shannon -jj Behrens <http://jjinux.blogspot.com/> 40 41 James Bennett 41 42 Paul Bissex <http://e-scribe.com/> django/branches/magic-removal/django/conf/locale/zh_TW/LC_MESSAGES/django.po
r2273 r2524 325 325 #: contrib/comments/templates/comments/form.html:23 326 326 msgid "Required" 327 msgstr " "327 msgstr "必需的" 328 328 329 329 #: contrib/comments/templates/comments/form.html:12 330 330 #: contrib/comments/templates/comments/form.html:23 331 331 msgid "Optional" 332 msgstr " "332 msgstr "可選擇的" 333 333 334 334 #: contrib/comments/templates/comments/form.html:23 335 335 msgid "Post a photo" 336 msgstr " "336 msgstr "張貼照片" 337 337 338 338 #: contrib/comments/templates/comments/form.html:27 … … 487 487 #: contrib/admin/views/main.py:415 contrib/admin/views/main.py:492 488 488 msgid "You may edit it again below." 489 msgstr "你可以在下面再 次編輯。"489 msgstr "你可以在下面再編輯一次。" 490 490 491 491 #: contrib/admin/views/main.py:423 contrib/admin/views/main.py:501 … … 706 706 "This object doesn't have a change history. It probably wasn't added via this " 707 707 "admin site." 708 msgstr "這個物件沒有變更的歷 蜜。它可能不是透過這個管理網站新增的。"708 msgstr "這個物件沒有變更的歷史。它可能不是透過這個管理網站新增的。" 709 709 710 710 #: contrib/admin/templates/admin/base_site.html:4 … … 743 743 #: contrib/admin/templates/admin/404.html:10 744 744 msgid "We're sorry, but the requested page could not be found." 745 msgstr "我們很抱歉,不過被要求的頁面找不到 "745 msgstr "我們很抱歉,不過被要求的頁面找不到。" 746 746 747 747 #: contrib/admin/templates/admin/index.html:27 … … 756 756 #: contrib/admin/templates/admin/index.html:43 757 757 msgid "You don't have permission to edit anything." 758 msgstr "你沒有編輯任何東西的權限 "758 msgstr "你沒有編輯任何東西的權限。" 759 759 760 760 #: contrib/admin/templates/admin/index.html:51 … … 777 777 #: contrib/admin/templates/admin/login.html:20 778 778 msgid "Have you <a href=\"/password_reset/\">forgotten your password</a>?" 779 msgstr "你 <a href=\"/password_reset/\">忘記 你的密碼了嗎</a>?"779 msgstr "你 <a href=\"/password_reset/\">忘記密碼了嗎</a>?" 780 780 781 781 #: contrib/admin/templates/admin/base.html:23 … … 1084 1084 #: contrib/flatpages/models/flatpages.py:10 1085 1085 msgid "enable comments" 1086 msgstr " 允許評論"1086 msgstr "啟用評論" 1087 1087 1088 1088 #: contrib/flatpages/models/flatpages.py:11 … … 1128 1128 #: utils/dates.py:6 1129 1129 msgid "Monday" 1130 msgstr " 星期一"1130 msgstr "週一" 1131 1131 1132 1132 #: utils/dates.py:6 1133 1133 msgid "Tuesday" 1134 msgstr " 星期二"1134 msgstr "週二" 1135 1135 1136 1136 #: utils/dates.py:6 1137 1137 msgid "Wednesday" 1138 msgstr " 星期三"1138 msgstr "週三" 1139 1139 1140 1140 #: utils/dates.py:6 1141 1141 msgid "Thursday" 1142 msgstr " 星期四"1142 msgstr "週四" 1143 1143 1144 1144 #: utils/dates.py:6 1145 1145 msgid "Friday" 1146 msgstr " 星期五"1146 msgstr "週五" 1147 1147 1148 1148 #: utils/dates.py:7 1149 1149 msgid "Saturday" 1150 msgstr " 星期六"1150 msgstr "週六" 1151 1151 1152 1152 #: utils/dates.py:7 1153 1153 msgid "Sunday" 1154 msgstr " 星期日"1154 msgstr "週日" 1155 1155 1156 1156 #: utils/dates.py:14 … … 1306 1306 #: models/core.py:67 1307 1307 msgid "session key" 1308 msgstr "session 鍵 "1308 msgstr "session 鍵值" 1309 1309 1310 1310 #: models/core.py:68 … … 1460 1460 #: conf/global_settings.py:48 1461 1461 msgid "Japanese" 1462 msgstr " "1462 msgstr "日文" 1463 1463 1464 1464 #: conf/global_settings.py:49 1465 1465 msgid "Dutch" 1466 msgstr " "1466 msgstr "荷蘭文" 1467 1467 1468 1468 #: conf/global_settings.py:50 … … 1661 1661 msgid "Watch your mouth! The word %s is not allowed here." 1662 1662 msgid_plural "Watch your mouth! The words %s are not allowed here." 1663 msgstr[0] "看 住你的嘴!%s 不允許出現在這裡。"1663 msgstr[0] "看管口舌!此處不允許 %s 這樣的字眼。" 1664 1664 1665 1665 #: core/validators.py:238 django/branches/magic-removal/django/views/static.py
r2324 r2524 1 import os2 import urllib3 import posixpath4 import mimetypes5 1 from django.template import loader 6 2 from django.core.exceptions import ImproperlyConfigured 7 from django.http import Http404, HttpResponse, HttpResponseRedirect 3 from django.http import Http404, HttpResponse, HttpResponseRedirect, HttpResponseNotModified 8 4 from django.template import Template, Context, TemplateDoesNotExist 5 import mimetypes 6 import os 7 import posixpath 8 import re 9 import rfc822 10 import stat 11 import urllib 9 12 10 13 def serve(request, path, document_root=None, show_indexes=False): … … 42 45 if show_indexes: 43 46 return directory_index(newpath, fullpath) 44 else: 45 raise Http404, "Directory indexes are not allowed here." 46 elif not os.path.exists(fullpath): 47 raise Http404, "Directory indexes are not allowed here." 48 if not os.path.exists(fullpath): 47 49 raise Http404, '"%s" does not exist' % fullpath 48 else: 49 mimetype = mimetypes.guess_type(fullpath)[0] 50 return HttpResponse(open(fullpath, 'rb').read(), mimetype=mimetype) 50 # Respect the If-Modified-Since header. 51 statobj = os.stat(fullpath) 52 if not was_modified_since(request.META.get('HTTP_IF_MODIFIED_SINCE'), 53 statobj[stat.ST_MTIME], statobj[stat.ST_SIZE]): 54 return HttpResponseNotModified() 55 mimetype = mimetypes.guess_type(fullpath)[0] 56 contents = open(fullpath, 'rb').read() 57 response = HttpResponse(contents, mimetype=mimetype) 58 response["Last-Modified"] = rfc822.formatdate(statobj[stat.ST_MTIME]) 59 return response 51 60 52 61 DEFAULT_DIRECTORY_INDEX_TEMPLATE = """ … … 86 95 }) 87 96 return HttpResponse(t.render(c)) 97 98 def was_modified_since(header=None, mtime=0, size=0): 99 """ 100 Was something modified since the user last downloaded it? 101 102 header 103 This is the value of the If-Modified-Since header. If this is None, 104 I'll just return True. 105 106 mtime 107 This is the modification time of the item we're talking about. 108 109 size 110 This is the size of the item we're talking about. 111 """ 112 try: 113 if header is None: 114 raise ValueError 115 matches = re.match(r"^([^;]+)(; length=([0-9]+))?$", header, 116 re.IGNORECASE) 117 header_mtime = rfc822.mktime_tz(rfc822.parsedate_tz( 118 matches.group(1))) 119 header_len = matches.group(3) 120 if header_len and int(header_len) != size: 121 raise ValueError 122 if mtime > header_mtime: 123 raise ValueError 124 except (AttributeError, ValueError): 125 return True 126 return False django/branches/magic-removal/docs/faq.txt
r2369 r2524 182 182 begin maintaining backwards compatibility. This should happen in a couple of 183 183 months or so, although it's entirely possible that it could happen earlier. 184 That translates into February or March2006.184 That translates into summer 2006. 185 185 186 186 Of course, you should note that `quite a few production sites`_ use Django in django/branches/magic-removal/docs/flatpages.txt
r1951 r2524 22 22 ============ 23 23 24 To install the flatpages app, follow these twosteps:24 To install the flatpages app, follow these steps: 25 25 26 26 1. Add ``"django.contrib.flatpages"`` to your INSTALLED_APPS_ setting. django/branches/magic-removal/docs/settings.txt
r2295 r2524 76 76 Read the `Django mod_python documentation`_ for more information. 77 77 78 .. _Django mod_python documentation: http://www.djangoproject.com/documentation/mod _python/78 .. _Django mod_python documentation: http://www.djangoproject.com/documentation/modpython/ 79 79 80 80 Default settings django/branches/magic-removal/docs/templates.txt
r2320 r2524 1072 1072 Wraps words at specified line length. 1073 1073 1074 **Argument:** number of words at which to wrap the text1074 **Argument:** number of characters at which to wrap the text 1075 1075 1076 1076 yesno
