Re: Help - Which IDE is best to use.

2012-05-16 Thread Kejun He
Hi, I using wingide -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options,

Re: HELP with unicode!!!!!

2012-05-01 Thread Kejun He
Hi, it may because of the csv file sometimes, try to save the file as utf-8 or utf-8 no-bom. On Tue, May 1, 2012 at 7:08 PM, dizzydoc wrote: > Hi , > > i have lost a lot of time looking for a solution. > > My problem is, while i a reading csv in python using > > csv_file = open(path_file, "

Re: How to release the caching of QuerySet

2012-04-18 Thread Kejun He
Hi, On Wed, Apr 18, 2012 at 8:03 PM, akaariai wrote: > On Apr 18, 2:48 pm, Kejun He wrote: > > (2) > > About the query if be executed > > > > if the code like below, and do no operation on variable tmp:>>>tmp = > Demo.objects.filter(pid=p_id) > >

Re: How to release the caching of QuerySet

2012-04-18 Thread Kejun He
st version. On Wed, Apr 18, 2012 at 6:35 PM, akaariai wrote: > On Apr 18, 1:05 pm, Kejun He wrote: > > and define a method named test in views.py. like below: > > > > def test(p_id): > > # Just execute the filter 1000 times > > for i in xr

Re: How to release the caching of QuerySet

2012-04-18 Thread Kejun He
Hi, Thank you for your reply. I have set DEBUG=False in settings.py and try again. The the problem still exists. and the result of sys.getrefcount(Demo) is not 0 gc.garbage() is [] regards, Kejun On Wed, Apr 18, 2012 at 6:09 PM, Tom Evans wrote: > On Wed, Apr 18, 2012 at 11:05 AM, Kejun

Re: Admin site not working

2012-04-18 Thread Kejun He
Hi, Did you uncomment the code below on urls.py? # from django.contrib import admin # admin.autodiscover() And Did you add "django.contrib.admin" into INSTALLED_APPS on settings.py? On Tue, Apr 17, 2012 at 6:26 PM, mohamed elsebaey wrote: > Dear andrea > thanks for your reply > i'd ran the

How to release the caching of QuerySet

2012-04-18 Thread Kejun He
Hi, I met a problem about memory overflow on a Django project. I spent much of time finding the reason and I got some question about how the django release the caching of QuerySet. Exp: I build a Model class like below: class Demo(models.Model): pid = models.IntegerField() and define a me

Re: Problems extracting valid form data lately

2012-04-16 Thread Kejun He
paste your form code please On Sun, Apr 15, 2012 at 11:54 PM, Andy McKay wrote: > What does your form code look like? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. >

Re: lose access to my app on dashboard when setting.DEBUG=False

2012-04-13 Thread Kejun He
top On Sun, Apr 8, 2012 at 3:53 PM, sillyou su wrote: > It works fine with DEBUG=True. But when I set settings.DEBUG=False, I > can,t access my app on dashboard except sites and auth. > It is strange. Any idea? > > -- > You received this message because you are subscribed to the Google Groups >

Re: error while running django-admin.py

2012-02-13 Thread Kejun He
hi, paste the traceback. Maybe reinstall django can resolve the problem. On Tue, Feb 14, 2012 at 7:44 AM, WebServices wrote: > django-admin.py startproject throwing error - Syntax error > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. >

Re: Installing Django

2011-10-09 Thread Kejun He
Reinstall Django On Mon, Oct 10, 2011 at 11:45 AM, Bob Peene wrote: > Django and Python newby > Following Django 1.0 by Hourieh > 'setup.py install' seemed to go ok > error running django-admin.py (it is in my Win7 path) > > 'django.core import management' > 'no module named core' > > Any insigh

Re: Django mysite problem

2011-09-14 Thread Kejun He
Maybe reinstall django would resolve this problem On Thu, Sep 15, 2011 at 10:01 AM, PremAnand Lakshmanan wrote: > I have a problem executing this command, > > C:\Python27\Lib\site-packages\django\bin\django-admin.py startproject > mysite2 > > SyntaxError: invalid syntax > > I get the above error

Re: save_as only saves data showing on the form

2011-09-04 Thread Kejun He
save_model() ??? https://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_model On Sat, Sep 3, 2011 at 9:45 PM, zobbo wrote: > I have a very extensive model and and an admin form which contains key > fields from that model. Other data is editedin a differen

Re: django-admin.py not found

2011-08-29 Thread Kejun He
the django-admin must in the sys path On Tue, Aug 30, 2011 at 11:19 AM, PremAnand Lakshmanan wrote: > Hi, > I don't find the django-admin.py. > > I get the following error while trying to execute the following command, > > django-admin.py startproject mysite > > SyntaxError: invalid syntax > > --

Re: Model rowset split

2011-08-29 Thread Kejun He
You'd better offer more info about your question On Mon, Aug 29, 2011 at 6:26 PM, kooliah < kool...@djeve.sites.djangohosting.ch> wrote: > With > > recset = mydb.all() > len(recset) > 2000 > > I would like to split into x rowset with the same attributes and methods > but 2000/x records. > > I tri

Re: authentication in django

2011-08-28 Thread Kejun He
request.user.is_authenticated() ??? and the do a HttpResponseRedirect to the url you like. https://docs.djangoproject.com/en/1.3/ref/request-response/#django.http.HttpRequest.user https://docs.djangoproject.com/en/1.3/ref/request-response/#django.http.HttpResponseRedirect On Mon, Aug 29, 2011

Re: Integrity Error

2011-08-26 Thread Kejun He
Sometime, set null = true would allow a field to be empty On Fri, Aug 26, 2011 at 5:41 PM, Thomas Orozco wrote: > Your invoice items have no invoice attribute, as the error says. > > By the way, although I'm not sure of what you're trying to achieve, let me > point out that there is not really a

Re: Error: cannot import name settings

2011-08-24 Thread Kejun He
Search "settings" in your project, and see the settings how to be imported. On Wed, Aug 24, 2011 at 4:45 PM, Reinout van Rees wrote: > On 24-08-11 09:54, Mario Gudelj wrote: > >> Error: cannot import name settings >> > > Are you doing "from django.conf import settings"? Is that going wrong? > Or

Re: Debud setting behaves weird

2011-08-23 Thread Kejun He
Hi Which platform did your project run? On the development platform or the publishing platform ? 2011/8/23 Yaşar Arabacı > Hi, > > When I set debug=True in my settings module, my static files work. When I > set it to False, I get 404 on my static files. Anyone has an ide what is > going on here?

Re: Need help on admin page

2011-08-22 Thread Kejun He
Visit the django official document about admin https://docs.djangoproject.com/en/1.3//ref/contrib/admin/ On Tue, Aug 23, 2011 at 2:01 PM, Temulen Odbayar wrote: > I don't understand about admin page site thing. What should i do with > this thing??? Sorry my bad english. Any help ^__^ > > -- > Yo

Re: FW: MySQLdb version doesn't match _mysql version

2011-08-22 Thread Kejun He
em. and ensure the new python-mysqldb and the mysql match. Good Luck. > > On Aug 22, 11:18 am, Kejun He wrote: > > Did you install python-mysqldb in your mechine?? > > > > On Mon, Aug 22, 2011 at 3:45 PM, Cal Leeming [Simplicity Media Ltd] < > > > >

Re: FW: MySQLdb version doesn't match _mysql version

2011-08-22 Thread Kejun He
Did you install python-mysqldb in your mechine?? On Mon, Aug 22, 2011 at 3:45 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Hold on, i would say this is a django-related question (albeit not related > to a problem within django). OP - try removing and re

Re: Work in memory instead of BD, how to?

2011-08-18 Thread Kejun He
May be you can try database long connection. On Fri, Aug 19, 2011 at 10:44 AM, Andre Terra wrote: > I think a better solution would be to use a store rather than cache > (protip: redis) and, if the calculations are lengthy, write a > 'publish' function that writes them to the store and let the u

Re: How do I select which user/password to use for DB connection after Django app was started?

2011-08-18 Thread Kejun He
hi, I had a same problem as you before, and I spent much of time on it, but could not get it goal. And the DATAVASES in settings.py is loaded when the server running. If you can let the project reload the settings, you may resolve the problem. Or you can use MySQLdb to do it. Sometimes we can

Re: 'str' object has no attribute 'resolve' when access admin site

2011-08-09 Thread Kejun He
Hi, I have never met the same problem. And it would be better if you paste the traceback On Wed, Aug 10, 2011 at 11:56 AM, raj wrote: > *bump* really need an answer for this. > > On Aug 9, 11:41 am, raj wrote: > > I keep getting this error: > > 'str' object has no attribute 'resolve' > > > >

Re: how to get request object out of views

2011-08-09 Thread Kejun He
hi, I will do as your method thanks for your reply regards, kejun On Tue, Aug 9, 2011 at 5:56 PM, Tom Evans wrote: > On Tue, Aug 9, 2011 at 10:22 AM, Kejun He wrote: > > hi, > > Ok, It is a good method to get the current user. I am sorry for that. > > > > But

Re: how to get request object out of views

2011-08-09 Thread Kejun He
On Tue, Aug 9, 2011 at 5:54 PM, bruno desthuilliers < bruno.desthuilli...@gmail.com> wrote: > On Aug 9, 11:22 am, Kejun He wrote: > > hi, > > Ok, It is a good method to get the current user. > > It's actually THE good method. > > > > > But i just

Re: how to get request object out of views

2011-08-09 Thread Kejun He
hi, Ok, It is a good method to get the current user. I am sorry for that. But i just do maintain a django project, and i do not want to change the template structure. And now, I have found a new method to resolve the problem. through a variable CURRENT_USER defined in settings.py to save the cur

Re: how to get request object out of views

2011-08-08 Thread Kejun He
Evans wrote: > On Mon, Aug 8, 2011 at 4:19 PM, Kejun He wrote: > > hi, > > My goal is to generate some data, > > For example: > > I defined a template tag, and it is used to generate a menutree, the item > of > > the menutree is a list. > > The list comes

Re: how to get request object out of views

2011-08-08 Thread Kejun He
hi, My goal is to generate some data, For example: I defined a template tag, and it is used to generate a menutree, the item of the menutree is a list. The list comes from another .py file.In this file,I want to get a current user object(LIKE:request.user), so I need to get a request object ou

how to get request object out of views

2011-08-08 Thread Kejun He
Hi, I try to get a request object out of views.py, and could not get the reqeust object through "def demo(request)". Could you tell me how to get it?? Or is there other ways to get the same goal. Thanks very much regards, kejun -- You received this message because you are subscribed to the

Re: Django can't see my static files

2011-08-02 Thread Kejun He
hi, Did you use the django development server to test it?? I have ever published my project on Lighttpd, but lost all the css. I solved this problem by specified the midia and site-midia. Like below on lighttpd.conf "/site_media/" => "/root/web/Affair/gmadmin/media/", "/media/"

Re: A problem about rpc4django

2011-07-25 Thread Kejun He
, Mike Dewhirst wrote: > On 25/07/2011 6:04pm, Kejun He wrote: > >> Hi, >> >> A strange problem! The same project about RPC could work normally in >> Linux, but it reported a error "global name 'dispatcher' is not defined" on >> development serve

A problem about rpc4django

2011-07-25 Thread Kejun He
Hi, A strange problem! The same project about RPC could work normally in Linux, but it reported a error "global name 'dispatcher' is not defined" on development server(http://127.0.0.1:8000) in Windows OS. Did anyone meet this problem before? Could you tell me how to fix it? Thank you! ===

Re: Method call when deleting FK in admin

2011-07-22 Thread Kejun He
try "admins.ModelAdmin" On Sat, Jul 23, 2011 at 5:07 AM, galgal wrote: > > > My models:class Spectacle(models.Model): > > title = models.CharField(max_length=100) > slug = models.SlugField(max_length=100 unique=False) > description = models.TextField() > class SpectacleGallery(models.Model): > s

Re: Django site broken after Debian upgrade

2011-07-18 Thread Kejun He
hi, I met the same problem when updated diango from version 1.2 to version 1.3. And it comes back to normal after back to version 1.2. May be your trouble came from the same reason rgs, he On Tue, Jul 19, 2011 at 1:13 PM, Andre Terra wrote: > On Tue, Jul 19, 2011 at 9:48 AM, bkline wrote: >>

Re: something about django mysql database long connection

2011-07-15 Thread Kejun He
hi, I found a method to make a persistent connection to database. from django.core import signals from django.db import close_connection signals.request_finished.disconnect(close_connection) <== I have tested, it work normally! regards, he On Fri, Jul 15, 2011 at 9:44 AM, Kejun He wr

Re: something about django mysql database long connection

2011-07-14 Thread Kejun He
Hi, I will look the DBUtils imformation first. Thank you very much regards, he On Thu, Jul 14, 2011 at 11:58 AM, Jian Chang wrote: > Try DBUtils > http://www.webwareforpython.org/DBUtils/Docs/UsersGuide.html > > 2011/7/13 Kejun He > >> hi, >> I am sorry. My Englis

Re: something about django mysql database long connection

2011-07-12 Thread Kejun He
hi, I am sorry. My English is very bad. Yes, i want to make persistent databases connection on each session. and yesterday i try to modify the code on "site-packages\django\db\__init__.py" def close_connection(**kw