サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
アメリカ大統領選
www.djangosnippets.org
Author: zenx Posted: May 23, 2008 Language: Python Version: .96 Score: 5 (after 7 ratings) Download Raw Checks if the request is an AJAX request, if not it returns an HttpResponseNotFound. It looks for the XMLHttpRequest value in the HTTP_X_REQUESTED_WITH header. Major javascript frameworks (jQuery, etc.) send this header in every AJAX request. from django.http import HttpResponseBadRequest def aj
Author: henriklied Posted: March 3, 2009 Language: Python Version: 1.0 Score: 9 (after 9 ratings) Download Raw UPDATE: A more complete example is up on GitHub Based around Simon Willison's Fire Eagle oAuth, this will allow you to develop Twitter oAuth applications (…that is – if you're in the closed beta) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
Author: SmileyChris Posted: March 2, 2009 Language: Python Version: 1.0 Score: 65 (after 67 ratings) Download Raw Save this as smart_if.py in the templatetags folder of one of your apps. Then a simple {% load smart_if %} replaces the boring built-in Django {% if %} template with the new smart one. 7 May 2009: Was asked about whether it handles combination of and/or. It does, added a test to show i
Author: cmcavoy Posted: April 8, 2008 Language: Python Version: .96 Score: -3 (after 5 ratings) Download Raw A decorator for Django apps running Google AppEngine that requires a user to be authenticated. from django.http import HttpResponsePermanentRedirect from google.appengine.api import users def loginrequired(func): def redirect_to_login(request): return HttpResponsePermanentRedirect(users.cre
Author: kylefox Posted: May 26, 2007 Language: HTML/template Version: Not specified Score: 10 (after 10 ratings) Download Raw This adds a checkbox for each object and three buttons to a model's change list: Delete selected: deletes the selected objects Delete shown: deletes all the visible objects. For example, if you perform a search or in any way filter the list, this button deletes only objects
Author: chris Posted: March 2, 2007 Language: Python Version: Pre .96 Score: 59 (after 63 ratings) Download Raw Django's built in authentication system requires the username to be alpha-numeric only. Therefore, email addresses are invalid. However, in many cases, you would like to use an email address as the username. This snippet allows you to do so. It has the added benefit that if you want to c
Author: sjzabel Posted: March 6, 2007 Language: Python Version: Pre .96 Score: 17 (after 17 ratings) Download Raw SSL Middleware This middleware answers the problem of redirecting to (and from) a SSL secured path by stating what paths should be secured in urls.py file. To secure a path, add the additional view_kwarg 'SSL':True to the view_kwargs. For example urlpatterns = patterns('some_site.some_
このページを最初にブックマークしてみませんか?
『djangosnippets: Welcome』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く