Re: how to get the variable in the context

2012-04-28 Thread Amao Zhao
Dear DanYun Liu Django has the biuld-in middlewar with the user. You can use the user in your templates immediately. 在 2012年4月28日星期六,DanYun Liu 写道: > I defined a context processor to pass the login user info to the template. > and, I also need to use it in the view. > > is there any way t

Re: request.is_ajax() not working

2012-04-22 Thread Amao Zhao
dear psychok7: You have no data from your ajax post, you should post some data with your ajax post, like this $.post("api/newdoc/", {'user':'your username'}, function(data) { alert(data); }); } 在 2012年4月23日星期一,psychok7 写道: > hi there i am trying a simple example using AJAX, DJANGO

Re: Django-cms plugins - ImportError no module named: cmsplugin_filer_file....

2012-03-04 Thread Amao Zhao
the APP_INSTALLS in your settings.py is a list. please recheck your 'filer' and so no. 在 2012-3-4 下午10:07,"doniyor" 写道: > Hi there, > > i need your help, i am trying to setup cms of my webpage, but > everytime i run the "python manage.py syncdb" the error comes: > django.core.exceptions.Improperly

Re: How to create unique tags based on Taggit

2011-10-27 Thread Amao Zhao
hi, Tsung: your code for i in range(0,len(tags)): if tags[i] not in s: s.append(tags[i]) the tags[i] will return the tag.__unicode__() function and compare with the s List, so you will get the complete List as the beginning. If you want get your hope result, you can use the dj

Re: how to use "{% url *** %}" in django template file?

2011-08-06 Thread Amao Zhao
hi, jimmy you should pass the name of your func with url in template. such as your example, in your urls.py, you update the url: url(r'card/create$', 'card.views.create_card', name = 'create_card'), and then you can use the url in your template like this : {% url create_card %} 在 2011年8月7日星期日,J

Re: Django can't see my static files

2011-08-04 Thread Amao Zhao
Hi, you should conform the django.contrib.staticfiles in your INSTALLED_APPS, then add the prefix to your template:{% load static %}, On Thursday, August 4, 2011, Guillaume Chorn wrote: > Hi All, > > It's been a couple of days since I last wrote and no response so I'm trying again (see below). P

Re: AW: MEDIA_URL not treated like static

2011-03-28 Thread Amao Zhao
Dear galgal: according to the django docs for 1.3, The most likely example is user-uploaded content in MEDIA_ROOT . staticfiles is intended for static assets and has no built-in handling for user-uploaded files, but you

Re: acces lists by index

2011-03-10 Thread Amao Zhao
django do not sport list[-n] index! On Thu, Mar 10, 2011 at 11:24 PM, Szabo, Patrick (LNG-VIE) < patrick.sz...@lexisnexis.at> wrote: > Hi, > > > > I’m trying to acces the last index of a list in my template but list[-1] > throws the following error: > > > > *Could not parse the remainder: '[-1]

Add Tiny_mce for Django Admin site

2010-12-02 Thread Amao Zhao
Hi all: I am using Django1.2.3 and python2.6.5. And I want to add the Tiny_mce for my admin in my project. But I followed the doc on django, it does not work. Here is my code: The admin.py: class EntryAdmin(admin.ModelAdmin): class Media: js = ('stat

Re: Automatic form submission and CSRF??

2010-09-26 Thread Amao Zhao
Hi, I think you should add the 'django.middleware.csrf.CsrfResponseMiddleware' into your MIDDLEWARE_CLASSES in the settings model. Yours, BR On Mon, Sep 27, 2010 at 7:58 AM, Russell Keith-Magee < russ...@keith-magee.com> wrote: > On Mon, Sep 27, 2010 at 12:18 AM, Joakim Hove > wrote: > > Hello,