Задать вопрос

Тел: +7 965 3737 888

366

Просмотров

2

Ответов

SWFUpload auth decorator

<p>I use this snippet to simplify my auth system with flash uploader SWFUpload. flash_login_required ensures that the user is authenticated and inject the context dictionnary into the specified template. To redirect a user, just set the variable context['redirect'] with an url. </p>
<p>Remember to include the cookie js in your template to get the sessionid variable POSTed to your view:</p>
<p>&lt;script type="text/javascript" src="/static/js/swfupload/swfupload.cookies.js"&gt;&lt;/script&gt;</p>

Вопрос полезен? Да0/Нет0
file_3224.py(1.5Кб)
None

Ответы (2):

Ответmenendez:29.06.2009
Ответ полезен? Да0/Нет0

Lines 11 and 12 should be replaced with this so that it works with any session engine:

engine = import(settings.SESSION_ENGINE, {}, {}, ['']) session_data = engine.SessionStore(request.POST.get('sessionid'))

Line 5 can be removed.

Ответrevolunet:28.04.2009
Ответ полезен? Да0/Нет0

nice tip, it works. but seems very unsecure to bypass the sessionid this way.