English 中文(简体)
django 请求书没有载列关键内容
原标题:django request that does not contains a key

First i want to thanks you for watching my post! I have used django for two month for an enterprise project. And im a kind of french noob in web developpement and in django developpment :D

这里我的问题是:为了确定要求的关键。 本届会议之后,又将这一关键内容提上去:

一、导 言

def check(request):
if request.method ==  POST :
    RequestContext(request)
    try:
        m = MsGnlMember.objects.get(mbr_nom=request.POST[ username ])
    except (ObjectDoesNotExist):
        return render_to_response( login.html , { BAD : True,  username  :  Unknown User })
    if m.mbr_mdp == request.POST[ mdp ]:
Here ===>   request.session[ MBR_INSTANCE ] = m

        return index(request)


def index(request):
username = request.session["MBR_INSTANCE"].mbr_nom
request.session.modified = True # does not fix my problem
getNote = GetNoteForm()
saveNote = SaveNoteForm()
search = SearchForm()
return render_to_response( index.html , { FORM_GETNOTE  : getNote,
                                          FORM_SAVENOTE  : saveNote,
                                          FORM_SEARCH  : search,
                                          USERNAME  : username},
                          context_instance=RequestContext(request))

该代码的工作相当好(根据查询结果,用户名称在指数.html上改动),但在页数上。

def arbo_get_acts(request):
if request.method ==  POST  and request.is_ajax():
    if "MBR_INSTANCE" in request.session:
        acts = MsWriAct.objects.filter(act_mbr=request.session[ MBR_INSTANCE ])        
        acts_serialised = serializers.serialize( json , acts)
        return HttpResponse(acts_serialised,  application/json )
    else:     
        acts_serialised = {}            
        return HttpResponse(acts_serialised,  application/json )

and i never enter in my if statement : ( snif snif so please explain me what im doing wrong or what i don t understand

EDIT: Ok Everyone, yesterday i test my code at home and it worked pretty well. At work it continue to fail. After a long journey and hard labor i found. It made tilt when i was thinking that "why it works at home and not at work". At home i m using Linux, at work windows. ........ First google search: Here is the shame on me: https://code.djangoproject.com/ticket/9084 File-based session does not store any data on Windows

T_T 如何放松两天的发展

最佳回答

EDIT:奥基每个人,昨天,我在国内测试了我的法典,并且做得很好。 在工作上,它继续失败。 在经过漫长的征程和艰苦劳动之后,就找到了。 它是在想“在家里工作而不是工作”时提出的。 在使用林丹的家庭,在工作窗口。 ...... 第一线搜索: 这里的耻辱是:。 基于文件的会议没有储存任何关于Windows的数据。

T_T 如何放松两天的发展

问题回答




相关问题
why the session in iis automatically log out?

I used iis6, and when i called a function Directory.delete(), the all the session relate this website will be logged out. and i debugged the website, i found no exception. any one have ideas on this ? ...

Check session from a view in CodeIgniter

What is the best way to check session from a view in CodeIgniter, it shows no way in their user guide, otherwise I will have to make two views on everything, which is kinda weird...still a newbie to ...

Can I get the size of a Session object in bytes in c#?

Is it possible to get the size(in bytes) of a Session object after storing something such as a datatable inside it? I want to get the size of a particular Session object, such as Session["table1"], ...

提供严格分类的出席会议物体

提供严格分类的与会机会的最佳方式是什么? 我正计划转而选择矩阵,这正在促使汇编者抱怨我的幻觉方案拟订方法......

PHP Session is not destroying after user logout

I m trying to create an authentication mechanism for my PHP Application and I m having difficulty destroying the session. I ve tried unsetting the authentication token which was previously set within ...

热门标签