Re: django storage chinese failed to mysql!!

2010-07-27 Thread Dennis Kaarsemaker
On wo, 2010-07-28 at 09:11 +0800, pengbo xue wrote: > hi all, > > I can register from my django web page in english,but it can't storage > chinese to django mysql database. > > please give me advice. thx Check your table definition to see whether the field you try to store is a latin1 or utf8

implementing next and previous of the object

2010-07-27 Thread haibin
Hi all, Need help, advice on how the have a next and previous link on a object detail page. For example fomr a object list page a user chose an object, and in the object page instead of going back to the list to view other object the user just click either next or previous. Any idea how to

private models and inheriting model permission?

2010-07-27 Thread Jamie
Hi all, I'm new to Django and Python. I have a small project I want to tackle and was after some advice on where to start. Simply the project will be a site to manage 'Projects' and their associated 'Tasks', however each project and their related tasks should be private (authenticated users can

Re: HTTP POST sent from app to Django Server returns 403 Forbidden

2010-07-27 Thread Kieran Farr
Finally figured out what's going on. My hypothesis: An HTTP request with POST method sent to a Django view wrapped with @csrf_exempt will still raise a 403 CSRF error if the wrapped view raises an Http404 exception. In this specific case, we raise 404 when there is no valid video_id passed in

Re: how to debug restful django apps?

2010-07-27 Thread berto
Do you have access to the Django app? Can you set settings.DEBUG = True to get the full traceback? If you set the ADMINS tuple in the settings you also can get an email with the traceback when DEBUG = False. The email backend can also be configured with the EMAIL_BACKENDS setting, so you can,

Re: HTTP POST sent from app to Django Server returns 403 Forbidden

2010-07-27 Thread Kieran Farr
Further research shows that CSRF is enabled regardless of my settings.py if we use Django's built-in auth. Obviously, we need to still use Django's auth, so we can't just disable CSRF site-wide like this hack:

updating admin values with other fields

2010-07-27 Thread Nick
I have a save override in my admin file that catches a value from one field and applies it to another. The values it grabs from a manytomany field. I can get it to work, but only when I save twice. It looks like it needs the manytomany to update with the new values and then it needs to second

django storage chinese failed to mysql!!

2010-07-27 Thread pengbo xue
hi all, I can register from my django web page in english,but it can't storage chinese to django mysql database. please give me advice. thx -- cowboy -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

testing with multiple databases

2010-07-27 Thread berto
Hello Djangonauts, I am using django in an application that has multiple distinct databases, each with unique data (i.e. not master/slave type configuration). I've created an app (django-admin.py startapp) for each database and the settings.py defines DATABASE_ROUTERS where I specify what

[ot] good practices questions, using django

2010-07-27 Thread Felippe Bueno
Hello Guys, I'm relatively new to django. I have some doubt about good practices, using it. 1 - I have some helpers that I use on all apps. For this I created a app called helpers (./manager.py startapp helpers) it don't have any view, or model. And then I created some files like: misc.py

File sharing service on Django?

2010-07-27 Thread Artem
Is there any painless way to make Django able to serve files with one- time urls, like in RapidShare? First thought - use django.views.static.serve with some tweeks. But is there a way to track status of download (dropped\complited)? Thanks -- You received this message because you are

Re: MySQL error -1

2010-07-27 Thread Dennis Kaarsemaker
On di, 2010-07-27 at 13:49 -0700, shacker wrote: > On Jul 27, 3:10 am, Dennis Kaarsemaker wrote: > > > > > Start with checking/repairing the table that causes this error to be > > thrown. > > All tables analyzed, optimized, and repaired. No errors found. But the > "

Re: MySQL error -1

2010-07-27 Thread shacker
On Jul 27, 3:10 am, Dennis Kaarsemaker wrote: > > Start with checking/repairing the table that causes this error to be > thrown. All tables analyzed, optimized, and repaired. No errors found. But the " error -1 from storage engine" reports continue a few minutes later

Re: HTTP POST sent from app to Django Server returns 403 Forbidden

2010-07-27 Thread Kieran Farr
Raj sorry I misread your question. This initial response is in re: my listener. The "sender" of this POST request is a third party server that we have no control over. However, even when debugging with wget we receive the 403. Here is the wget command I've been testing with: $ wget

Re: save a values_list to a charfield

2010-07-27 Thread Nick
It is a bit of a last minute deal and will be changed after today, but we had a handful of "improvements" handed down to us from management and this was the fastest thing we could come up with using some old mysql query logic and several already built templates for output. I appreciate the help.

Re: save a values_list to a charfield

2010-07-27 Thread ringemup
', '.join(primary_ids) The fact that you're doing this with foreign keys, though, suggests to me that you may have a database normalization problem. On Jul 27, 3:26 pm, Nick wrote: > I am getting this to save but I can't get it to output properly > > it's outputting as

Re: save a values_list to a charfield

2010-07-27 Thread Nick
I am getting this to save but I can't get it to output properly it's outputting as [16L, 451L, 521L] for a list of id's, which it should according to documentation. However, how can I output it like this 16, 451, 521 On Jul 27, 12:11 pm, Nick wrote: > I am needing to do

Re: HTTP POST sent from app to Django Server returns 403 Forbidden

2010-07-27 Thread Kieran Farr
This is intended not to be protected by auth, so this page is publicly accessible, no login required. Here's the function in its entirety: 255 @csrf_response_exempt 256 def DistroHeySpreadListener(request): 257 if request.method == 'POST': 258 post = request.POST 259

Re: HTTP POST sent from app to Django Server returns 403 Forbidden

2010-07-27 Thread raj
Most probably it has something to do with permissions. Go thru the exact code block which tries to post the data. Is the login successful and does the logged-in user have got all necessary permissions required? Post that part of the code if you can't find out. Rajeesh. On Jul 27, 11:20 pm,

Re: HTTP POST sent from app to Django Server returns 403 Forbidden

2010-07-27 Thread Kieran Farr
Hi, were having the exact same problem. We're integrating with a third-party API that sends "pings" via simple POST requests to our server to give us updates re: status video conversion processes. We're running Django 1.2.1 with Apache mod_python on Ubuntu 9.04. I've disabled ALL csrf related

Re: "TypeError iteration over non-sequence" after deploying

2010-07-27 Thread jean polo
hi. stupid me, was registering a form in admin... didn't see that I had this error locally also (*only* the first time though, reloading was working fine). thanks ! _y On Jul 27, 6:45 pm, Shawn Milochik wrote: > There's your error. The value of model_or_iterable is not

save a values_list to a charfield

2010-07-27 Thread Nick
I am needing to do some duct taping for a project that is going on right now. In it I need to take a values_list of id's from a ManyToMany field and save those values to a varchar field so a mysql query can access the values. I am working with two different sets of developers and this is the best

Re: how to debug restful django apps?

2010-07-27 Thread Marek Dudek
On 27.07.2010 19:07, ff wrote: how on earth is django-toolbar going to help me at all here? Did you even read any of my post? On Jul 27, 7:15 am, lzzzing wrote: Try Django debug toolbar. On Jul 27, 5:06 pm, ff wrote: I have a python

Re: how to debug restful django apps?

2010-07-27 Thread ffffff
how on earth is django-toolbar going to help me at all here? Did you even read any of my post? On Jul 27, 7:15 am, lzzzing wrote: > Try Django debug toolbar. > > On Jul 27, 5:06 pm, ff wrote: > > > I have a python script that creates and then uploads a

Best way to present N items in table row for list

2010-07-27 Thread Wadim
Hello. I have a list that i want to present in a table. Each row should have 5 items. For now i create the function that returns me new grouped list, that i use later in a template. def groupListByRow(list): cnt=0 rows=[] while cnt

Re: "TypeError iteration over non-sequence" after deploying

2010-07-27 Thread Shawn Milochik
There's your error. The value of model_or_iterable is not iterable. Perhaps it's a model (based on your naming convention). Try logging the value of model_or_iterable right before that line to see what it contains. Once you've done that, figure out why it contains that instead of something that's

Help:How to post data to the admin form by urllib2 ?

2010-07-27 Thread jerry
Hi: I build a website and want to login the admin form by python code. I have disabled the CSRF in my project and use urllib2 to post data. here are my codes: import urllib import

Re: "TypeError iteration over non-sequence" after deploying

2010-07-27 Thread jean polo
some more details: Exception Type: TypeError Exception Value:iteration over non-sequence Exception Location: ../projects/django/contrib/admin/sites.py in register, line 76 and /django/contrib/admin/sites.py: 74if isinstance(model_or_iterable, ModelBase): 75

Re: DateTimeField Validation Error

2010-07-27 Thread strayhand
Doah! Thanks. On Jul 27, 2:04 am, Daniel Roseman wrote: > On Jul 27, 6:34 am, strayhand wrote: > > > I don't get why I'm getting a validation error with my code. I thought > > that all of the built in fields are referenced inside of "from > > django.db

"TypeError iteration over non-sequence" after deploying

2010-07-27 Thread jean polo
Hello sorry for the n00b post... I just updated my project on my host (OVH), got it running with cgi but I have this error on every page I try to load: TypeError at [whatever] iteration over non-sequence I guess this might be a url problem but I'm pretty new to django/python so I have no clue of

Re: Case insensitive non ascii chars

2010-07-27 Thread Daniel Roseman
On Jul 27, 10:26 am, Robert wrote: > Hi, > > For phrase "POLAŃSKI" I cannot get results when posting "polań" in my > search form. > > I'm using the 1.2.1. Django version on PostgreSQL 8.3 with both > (SQL_ASCII) and UTF8 encoding. In my settings DEFAULT_CHARSET is set > for

Cherokee on ubuntu problem.

2010-07-27 Thread Miles
Hello, I try to make server which will be able to serve both static and dynamic files. I have installed id from launchpad and watch screen cast but there is problem. I add vserver reinstall and when i type in my browser nickname of the vserwer i see externam www.example.com. I thought that adding

Re: Stability of auto IDs

2010-07-27 Thread bruno desthuilliers
On 27 juil, 14:37, Torsten Bronger wrote: (snip) > Well, it could map them possibly ... granted that there would be no > reason for it.  Okay, then I must be more precise: > > If I have a model with an implicit primary key, and values of this > key are used to

Re: Stability of auto IDs

2010-07-27 Thread Torsten Bronger
Hallöchen! Steve Holden writes: > On 7/27/2010 12:38 PM, Torsten Bronger wrote: >> Hallöchen! >> >> bruno desthuilliers writes: >> >>> On 27 juil, 07:19, Torsten Bronger >>> wrote: >>> Currently, our Django app relies on the stability of various auto

Re: Stability of auto IDs

2010-07-27 Thread bruno desthuilliers
On 27 juil, 13:38, Torsten Bronger wrote: > Hall chen! > > bruno desthuilliers writes: > > On 27 juil, 07:19, Torsten Bronger > > wrote: > > >> Currently, our Django app relies on the stability of various auto > >> ID fields which

Re: Stability of auto IDs

2010-07-27 Thread Steve Holden
On 7/27/2010 12:38 PM, Torsten Bronger wrote: > Hallöchen! > > bruno desthuilliers writes: > >> On 27 juil, 07:19, Torsten Bronger >> wrote: >> >>> Currently, our Django app relies on the stability of various auto >>> ID fields which are implicitly generated by

Re: Override QuerySet.none()

2010-07-27 Thread bruno desthuilliers
On 27 juil, 10:37, gs794 wrote: > Thanks for the reply. > > I previously had a look at how QuerySet.none (in > Django.db.models.query) was implemented, and that didn 't give me any > clues - hence the post.  So I worked it out by looking at >

Re: Stability of auto IDs

2010-07-27 Thread Torsten Bronger
Hallöchen! bruno desthuilliers writes: > On 27 juil, 07:19, Torsten Bronger > wrote: > >> Currently, our Django app relies on the stability of various auto >> ID fields which are implicitly generated by Django/database >> backend. > > [...] From a practical POV,

Re: single point of entry to a webpage

2010-07-27 Thread Tim Chase
On 07/27/10 03:08, bruno desthuilliers wrote: A django *project* is composed of * one or more apps. * templates * static resources (css, images etc) ...and one or more "utils.py" files... :-) (tips his hat in the direction of JKM and makes a hasty exit...) -tkc -- You received this

Re: Form validation

2010-07-27 Thread Renne Rocha
Send your model and form codes, than it will be easier to see what is wrong. On Tue, Jul 27, 2010 at 4:45 AM, S.Selvam wrote: > Hi all, > I have two model fields (text and file ) and i want either one of the field > to be filled out. > > I set null=True,blank=True for

Re: how to debug restful django apps?

2010-07-27 Thread lzzzing
Try Django debug toolbar. On Jul 27, 5:06 pm, ff wrote: > I have a python script that creates and then uploads a file to a > django app. Sometimes the django app will error out and my script will > just return this: > > Traceback (most recent call last): >   File

Re: error 500 & 404 / date time isnot defined

2010-07-27 Thread yalda nasirian
tanx daniel . On Tue, Jul 27, 2010 at 2:37 PM, Daniel Roseman wrote: > On Jul 27, 10:13 am, "yalda.nasirian" > wrote: > > hi ,please help me , i realy dont know what can i do for this error i > > cant see my web page . > > another question : i

Re: error 500 & 404 / date time isnot defined

2010-07-27 Thread yalda nasirian
thank you so much hector but still i have error ! Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/admin/ Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order: 1. ^polls/$ 2. ^polls/(?P\d+)/$ 3. ^polls/(?P\d+)/results/$

Re: MySQL error -1

2010-07-27 Thread Dennis Kaarsemaker
On di, 2010-07-27 at 00:14 -0700, shacker wrote: > One of my Django sites has been throwing occasional 500 errors, I > believe related to mysql: > > OperationalError: (1030, 'Got error -1 from storage engine') > > I'm never able to catch it in the act - I just see the 500 email > reports. This

Re: error 500 & 404 / date time isnot defined

2010-07-27 Thread Daniel Roseman
On Jul 27, 10:13 am, "yalda.nasirian" wrote: > hi ,please help me , i realy dont know what can i do for this error i > cant see my web page . > another question : i have datetime error (i import date time in shell > but this error exist ) > tanx > please help ! error >

Re: error 500 & 404 / date time isnot defined

2010-07-27 Thread Hector Garcia
You should first of all set DEBUG and TEMPLATE_DEBUG to True in your settings.py, so you can have a traceback of what is happening. If you still don't have a clue, post the traceback. H. Hector Garcia - Web developer, musician http://nomadblue.com/ On Tue, Jul 27, 2010 at 11:13 AM,

Re: Stability of auto IDs

2010-07-27 Thread Steve Holden
On 7/27/2010 8:40 AM, bruno desthuilliers wrote: > On 27 juil, 07:19, Torsten Bronger > wrote: >> Hall chen! >> >> Currently, our Django app relies on the stability of various auto ID >> fields which are implicitly generated by Django/database backend. > > auto ID

Case insensitive non ascii chars

2010-07-27 Thread Robert
Hi, For phrase "POLAŃSKI" I cannot get results when posting "polań" in my search form. I'm using the 1.2.1. Django version on PostgreSQL 8.3 with both (SQL_ASCII) and UTF8 encoding. In my settings DEFAULT_CHARSET is set for UTF8. After debugging it looks like PostgreSQL can't do the UPPER()

error 500 & 404 / date time isnot defined

2010-07-27 Thread yalda.nasirian
hi ,please help me , i realy dont know what can i do for this error i cant see my web page . another question : i have datetime error (i import date time in shell but this error exist ) tanx please help ! error Page not found We're sorry, but the requested page could not be found. [27/Jul/2010

how to debug restful django apps?

2010-07-27 Thread ffffff
I have a python script that creates and then uploads a file to a django app. Sometimes the django app will error out and my script will just return this: Traceback (most recent call last): File "/home/chris/bin/upload.py", line 318, in send_request(tmpzip, var1, var2, options.meta, url)

Re: DateTimeField Validation Error

2010-07-27 Thread Daniel Roseman
On Jul 27, 6:34 am, strayhand wrote: > I don't get why I'm getting a validation error with my code. I thought > that all of the built in fields are referenced inside of "from > django.db import models". Thanks for any help that you may offer. > > >         status =

Re: What goes in 500.html?

2010-07-27 Thread yalda nasirian
hi , please help me , i realy dont know what can i do for this error i cant see my web page . another question : i have datetime error (i import date time in shell but this error exist ) tanx please help ! error Page not found We're sorry, but the requested page could not be found. [27/Jul/2010

Re: Override QuerySet.none()

2010-07-27 Thread gs794
Thanks for the reply. I previously had a look at how QuerySet.none (in Django.db.models.query) was implemented, and that didn 't give me any clues - hence the post. So I worked it out by looking at http://seanmonstar.com/post/708862164/extending-django-models-managers-and-querysets which

Re: single point of entry to a webpage

2010-07-27 Thread bruno desthuilliers
On 26 juil, 18:00, owidjaya wrote: > how do i write custom template tag that is available to all my apps. > not tied to a particular app? You don't have to make your templatetags "available to all your apps" - this would make each app dependants on the others, which is

Re: Override QuerySet.none()

2010-07-27 Thread bruno desthuilliers
On 27 juil, 06:27, gs794 wrote: > Hi all, > > I'm having trouble overriding QuerySet.none() (code below)...  Works > if I rename the method to almost anything but "none". > > class QuerySetManager(models.Manager): >   def get_query_set(self): >     return

Form validation

2010-07-27 Thread S.Selvam
Hi all, I have two model fields (text and file ) and i want either one of the field to be filled out. I set null=True,blank=True for both fields in model. Still the form validation requires both fields. In form i tried to have required=False attribute, which makes it impossible to upload

Re: Stability of auto IDs

2010-07-27 Thread bruno desthuilliers
On 27 juil, 07:19, Torsten Bronger wrote: > Hall chen! > > Currently, our Django app relies on the stability of various auto ID > fields which are implicitly generated by Django/database backend. auto ID are a RDBMS feature, Django is not involved. They are usually

MySQL error -1

2010-07-27 Thread shacker
One of my Django sites has been throwing occasional 500 errors, I believe related to mysql: OperationalError: (1030, 'Got error -1 from storage engine') I'm never able to catch it in the act - I just see the 500 email reports. This is not connected to any particular page - it seems to happen to

checking sessions from another domain

2010-07-27 Thread Tony
I have a few domains currently pointed to the same website. Im only using one of my domains to store sessions. When I try to access a session when someone types in a domain other then the one that I am using sessions for, I can't because the domain name isnt the same (obviously). Is there any

Re: errors serving text files using templates and static files

2010-07-27 Thread Dennis Kaarsemaker
I suggest you install firebug and check the differences in HTTP headers/html content with it. It's weird :) On ma, 2010-07-26 at 18:18 -0400, Josh Boon wrote: > Oops, swapped it and it still didn't work. Right now I have it > writing to a file and then redirecting and having Apache serve the >