Re: how to fetch query string in the view

2010-06-09 Thread Dejan Noveski
request.GET.get('test1', 'default_value_if_None') request.GET.get('test2', 'default_value_if_None') http://docs.djangoproject.com/en/dev/ref/request-response/#httprequest-objects On Wed, Jun 9, 2010 at 8:40 AM, rahul jain wrote: > HI Django, > > So I am generating a url of the form > > http://t

Re: how to call an external Javascript using static serve() in Django?

2010-06-09 Thread Dejan Noveski
Are you sure that the javascript file is loaded? Try the link to the javascript file directly. On Wed, Jun 9, 2010 at 7:10 AM, ravi krishna wrote: > Hi, > How can i call an external javascript file in Django. I got a value printed > in my html file from View using templates. Now I want to try ou

Re: how to call an external Javascript using static serve() in Django?

2010-06-09 Thread ankit rai
check the source of ur web page does it includes the file and path is correct On Wed, Jun 9, 2010 at 1:16 PM, Dejan Noveski wrote: > Are you sure that the javascript file is loaded? Try the link to the > javascript file directly. > > > On Wed, Jun 9, 2010 at 7:10 AM, ravi krishna wrote: > >> Hi

Re: How to enable Static Generator

2010-06-09 Thread Federico Capoano
I wrote a blog post about it here: http://nemesisdesign.net/blog/coding/setup-django-staticgenerator-apache-mod_wsgi/ On May 20, 1:29 pm, vikk wrote: > Hi all, > > I got some of the documents to enable static generator but still for > away from the result. > Please show me the way to implement it

Re: pg_get_serial_sequence("unknown", "unknown") - revision 13336

2010-06-09 Thread Federico Capoano
I have PostgreSQL version 7.4.27 on my server. The reason for which I use this version is that is the latest version available for webmin and my VPS use it. What can I do? I checked the release notes and I didn't notice anything about this bit. Before upgrading to the last revision I had probably

Ajax header not sent in all browsers

2010-06-09 Thread David Escobar
Hi everyone, I'm using Django 1.1 with jQuery 1.4.2 and currently testing with the Django development server. Whenever I send an AJAX request with $.get(), the HTTP_X_REQUESTED_WITH header only gets sent with Chrome and Safari. It does not get sent with IE or Firefox. I've verified this by outputti

Anything like content_for in rails?

2010-06-09 Thread trung
In Rails I can do this. <% content_for :my_block do %> <%= line 1 %> <% end %> <% content_for :my_block do %> <%= line 2 %> <% end %> <% content_for :my_block do %> <%= line 2 %> <% end %> so when I call <%= yield :my_block %>, it will return line 1 line 2 line 3 The idea here is that

Re: pg_get_serial_sequence("unknown", "unknown") - revision 13336

2010-06-09 Thread Matt Hoskins
The calls to pg_get_serial_sequence were added in to fix #8901 and I noted on that issue that the call wasn't available on PostgreSQL prior to 8, that Django made no claims about which PostgreSQL version it requires as a minimum, but that version 7 was rather old these days with version 8 having be

Re: pg_get_serial_sequence("unknown", "unknown") - revision 13336

2010-06-09 Thread Russell Keith-Magee
On Wed, Jun 9, 2010 at 6:27 PM, Federico Capoano wrote: > I have PostgreSQL version 7.4.27 on my server. The reason for which I > use this version is that is the latest version available for webmin > and my VPS use  it. In your defense, you didn't miss anything. We haven't documented a minimum re

limit on date in postgres/django

2010-06-09 Thread Wim Feijen
Hello, Do you know whether there is a minimum to a date? In my project, I'd like to add birthdays from way back, from people born on 21 january 0061 for example. When trying to write these dates to the db, I get the following error. I'm using Django 1.0.5 alpha and Postgres 8.3.9. --- Traceback

Re: pg_get_serial_sequence("unknown", "unknown") - revision 13336

2010-06-09 Thread Matt Hoskins
... Replying to my own post on this bit... of course the older Django 1.1.x can still be used with the older PostgreSQL 7 without hitting this issue regardless as I'm assuming the patch for #8901 isn't being applied back to the 1.1 series :). Perhaps worth being explicit in the Django documentation

Re: limit on date in postgres/django

2010-06-09 Thread Kenneth Gonsalves
On Wednesday 09 June 2010 16:53:55 Wim Feijen wrote: > Do you know whether there is a minimum to a date? In my project, I'd > like to add birthdays from way back, from people born on 21 january > 0061 for example. > > When trying to write these dates to the db, I get the following error. > I'm usi

Re: limit on date in postgres/django

2010-06-09 Thread David De La Harpe Golden
On 09/06/10 12:23, Wim Feijen wrote: Hello, Do you know whether there is a minimum to a date? Well there is, at the postgresql level, dates are supported between 4713 BC and 5874897 AD http://www.postgresql.org/docs/8.4/static/datatype-datetime.html Maybe there's some text to date parser lev

Generate thumbnails from videos

2010-06-09 Thread Venkatraman S
Hi, Say, a user uploads a video in my website, then how can i generate a thumbnail version of the video on the go? -V- http://twitter.com/venkasub -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us..

Re: Generate thumbnails from videos

2010-06-09 Thread Tom Evans
On Wed, Jun 9, 2010 at 12:50 PM, Venkatraman S wrote: > Hi, > > Say, a user uploads a video in my website, then how can i generate a > thumbnail version of the video on the go? > > -V- > http://twitter.com/venkasub > ffmpeg would be the best way. Use python subprocess module to call to the comman

Re: limit on date in postgres/django

2010-06-09 Thread Wim Feijen
Thanks for your reponse guys! It is a production machine with a lot of custom software, so I cannot change that right now. For me, it worked fine under Django 1.0.3 alpha and postgres 8.2.7 ! ?? Wim On 9 jun, 13:43, David De La Harpe Golden wrote: > On 09/06/10 12:23, Wim Feijen wrote: > > > He

Re: Generate thumbnails from videos

2010-06-09 Thread Dmitry Dulepov
Hi! Venkatraman S wrote: > Say, a user uploads a video in my website, then how can i generate a > thumbnail version of the video on the go? In addition to ffmpeg I would give user an option to provide a thumbnail. The reason is simple: you cannot automatically choose the best frame where to take

Re: limit on date in postgres/django

2010-06-09 Thread Kenneth Gonsalves
On Wednesday 09 June 2010 17:49:50 Wim Feijen wrote: > It is a production machine with a lot of custom software, so I cannot > change that right now. For me, it worked fine under Django 1.0.3 alpha > and postgres 8.2.7 ! ?? > are you using psycopg1 or 2? -- Regards Kenneth Gonsalves Senior Assoc

Re: Generate thumbnails from videos

2010-06-09 Thread Baurzhan Ismagulov
On Wed, Jun 09, 2010 at 05:20:07PM +0530, Venkatraman S wrote: > Say, a user uploads a video in my website, then how can i generate a > thumbnail version of the video on the go? Executing "mplayer -vo jpeg -frames 1 -ao null FILE" and using 0001.jpg is one way; I'm not aware of a python-only s

Re: Generate thumbnails from videos

2010-06-09 Thread Tom Evans
On Wed, Jun 9, 2010 at 1:43 PM, Baurzhan Ismagulov wrote: > On Wed, Jun 09, 2010 at 05:20:07PM +0530, Venkatraman S wrote: >> Say, a user uploads a video in my website, then how can i generate a >> thumbnail version of the video on the go? > > Executing "mplayer -vo jpeg -frames 1 -ao null FILE" a

Problems with unicode chars in model descriptions?

2010-06-09 Thread Benjamin Reitzammer
Hi, I'm having a strange problem right now, and I couldn't find any reference yet. I'm starting with a fresh new project, add a very simple model and register this model with the admin app. Like the example files below. Point is, that I use translated texts as field names. The problem I'm having:

Re: Introducing ImageFlow for Django (Django-ImageFlow)

2010-06-09 Thread simon
> Is their an option of positioning the Captions associated with the images? The captions for the images are positioned below the image by default. To change this, you would have to dive into the javascript in /static/ css/imageflow.jss. Search for captionDiv. The JS between lines 218 =and 280 ba

Re: Problems with unicode chars in model descriptions?

2010-06-09 Thread racingrat
Hi Benjamin, You are almost there. Only need to prefix the UTF string with the character 'u': street = models.CharField(_(u'Straße'), max_length=200) cheers, Martin Martin Bouma egoactive.com On 9 jun, 15:15, Benjamin Reitzammer wrote: > Hi, > I'm having a strange problem right now, and

Re: pg_get_serial_sequence("unknown", "unknown") - revision 13336

2010-06-09 Thread Federico Capoano
I see. I think I'd like to upgrade postgresql .. but I don't know what would happen with webmin. Maybe I'll go to ask to the webmin support. Do you think upgrading from 7 to 8 is a difficult task on debian? I also think it should be written in the documentation and release notes. On Jun 9, 1:2

ordering integers with regroup

2010-06-09 Thread Nick
Has anyone come across an ordering issue with the regroup tag whereby if the field that is being ordered is an integer you get the following problem: say you have the grouped field "District" and the following groupings District 1 District 2 District 3 District 10 District 14 District 20 District

Re: ordering integers with regroup

2010-06-09 Thread Scott Gould
If you're ordering on "District 1", "District 2", etc. then the number is part of a string and will be sorted alphabetically. I image your only recourse will be to use the numeric field directly, and deal with prepending "District " to it in some other fashion. On Jun 9, 10:38 am, Nick wrote: > H

Re: Admin Foreign Key "Add" Link Issue

2010-06-09 Thread bfrederi
The problem was that I had a custom instance of admin, as well as my normal instance of admin that I created using admin.site.register() and admin.autodiscover(). The problem is that when you have two versions of admin, you need to differentiate them using the AdminSite "name" attribute. Otherwise

Re: Admin Foreign Key "Add" Link Issue

2010-06-09 Thread bfrederi
This thread really helped: http://groups.google.com/group/django-users/browse_thread/thread/974c36053d40a38/00f7ff4760aa7d6f -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To

Re: Help: Custom ManyRelatedManager Behavior

2010-06-09 Thread tsmets
I seem to hit a similar problem A News or Comment may have multiple Authors I would like the representation of the News / Comment to display the list of authors So I coded this : [code] def __unicode__(self): return self.title + " : " + self.txt [0:20] + ' ... (Authors : ' + show_authors

Re: ordering integers with regroup

2010-06-09 Thread Nick
You are right, I wasn't even thinking about it like that. This is bad news as the information is coming across as "District 45" from another source and so I don't have just a district number to go off of. State government data is always terrible to work with. On Jun 9, 10:04 am, Scott Gould wrote

Re: pg_get_serial_sequence("unknown", "unknown") - revision 13336

2010-06-09 Thread Matt Hoskins
Hi Federico, >From the discussion on django-developers it looks like the patch will be reverted soon so you may find in due course things will start working again with SVN for the 1.2 branch (however with Django 1.3 support for 7 will likely be dropped). It doesn't sound like you particularly need

Re: Generate thumbnails from videos

2010-06-09 Thread Venkatraman S
On Wed, Jun 9, 2010 at 6:33 PM, Tom Evans wrote: > Oooh, theres also a python wrapper around ffmpeg, and their example on > their frontpage does precisely what you asked for: > > http://code.google.com/p/pyffmpeg/ > > Perfect. Wish they had Windows installs for python 2.6 :( -V- http://twitter.c

Re: assigning data based on a comparison between two tables

2010-06-09 Thread Nick
Just to let you know, this code worked out nicely. I made a few changes to the bottom save function: if len(candidates) > 1: raise Exception candidates.update(incumbent=True) On Jun 8, 6:11 pm, Nick wrote: > Thanks Dan, I'll give it a shot > > On Jun 8, 6:00 pm, Dan Harris wrote: > > > Pe

Re: Ajax header not sent in all browsers

2010-06-09 Thread Ryan
If you simplify things down to something like the snippets below, does the alert display 'Said it was NOT ajax' for you? It shouldn't (and doesn't for me). Also, do you have the Tamper Data Firefox add-on installed to validate the headers being sent in? That could help narrow things down. urls.py

list_editable duplicate queries

2010-06-09 Thread chadc
Hi there, I think that I have found a bug with the rendering of list_editable objects in the change list. The problem that I am running into is that if I include a field that is a foreign key in list_editable, the change_list hits the database every time that it renders the foreign key's widget. T

Django Debug Toolbar -- getting 404s for javascript file when using request.GET in SHOW_TOOLBAR_CALLBACK

2010-06-09 Thread Brian S
I am using the Django Debug Toolbar and getting some odd results with a custom SHOW_TOOLBAR_CALLBACK. I have added the debug toolbar to my INSTALLED_APPS and MIDDLEWARE_CLASSES, per the install instructions, and using the defaults, everything works fine. But instead of always showing the toolbar wh

date based generic views

2010-06-09 Thread Michel Thadeu Sabchuk
Hi guys, I make use of archive_month to a monthly navigation of an object_list. I have a previous month and a next month context variables that helps me to create a navigation menu. Now I must use archive_week to do the same approach but I missed next_week and previous week context variables. I

problem with encoding "utf-8", postgresql 8.3

2010-06-09 Thread refreegrata
Hello list. I'm a newbie with django and have a problem with the encoding. I use postgreSQL 8.3 with psycopg2. My database is in latin1 and i can't change this to utf-8(i don't have the permission), however the database have a client-encoding in utf-8. I think this solves the problem. Now my probl

RE: Generate thumbnails from videos

2010-06-09 Thread Joe Goldthwaite
You could also check into MTN - Movie Thumbnailer; http://moviethumbnail.sourceforge.net/ _ From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com] On Behalf Of Venkatraman S Sent: Wednesday, June 09, 2010 4:50 AM To: django-users@googlegroups.com Subject: Generate t

Django fcgi deployment on bluehost

2010-06-09 Thread Jeliuc Alexandr
Hello. Is there any one using django on bluehost? Two days I'm trying to set up it... :( Please help me!! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscr

CSRF token not adding hidden form field

2010-06-09 Thread joelklabo
I have added the {% csrf_token %} to my template. and I have the django.middleware.csrf.CsrfViewMiddleware installed. I am on Django 1.2.1 but I keep getting 403 errors. And, when I view the source of my page there is no hidden form field. No sign of the token. -- You received this message becaus

Re: CSRF token not adding hidden form field

2010-06-09 Thread joelklabo
The error I am getting is: "CSRF token missing or incorrect" I went and looked in the source for the place where it gives that error and it was this point: request_csrf_token = request.POST.get('csrfmiddlewaretoken', None) if request_csrf_token != csrf_token: if cookie_is_new: # probab

Re: CSRF token not adding hidden form field

2010-06-09 Thread Lee Hinde
On Wed, Jun 9, 2010 at 6:08 PM, joelklabo wrote: > The error I am getting is: "CSRF token missing or incorrect" I went > and looked in the source for the place where it gives that error and > it was this point: > > request_csrf_token = request.POST.get('csrfmiddlewaretoken', None) > if request_csr

unable to download django

2010-06-09 Thread JRMAbock
I have tried everythign. I have downloaded subversion from collabnet and it actually did load the files until a message said that the host forcibly closed. Now it is saying that the files are corrupted. is there anything I can do? I really like what ive read about django and ive committed myself t

django.views.i18n doesn't fallback to NullTranslations

2010-06-09 Thread Shiro
django.views.i18n loads English catalog first, then loads default locale catalog, and finally loads the selected locale catalog. Only for English, it takes care a case without the locale catalog. In my case, I write Japanese strings in my source code. I create English catalog for English locale, a

Django Send Mail

2010-06-09 Thread Sudharshan
Hello Ppl, We have a server maintained by site5.com(have a cPanel interface) and that we have installed django ! I remember send_mail function working well last year and also the mail_admins() function were working properly, but right now we get this error... SMTPDataError: (550, 'Please

Re: Django Send Mail

2010-06-09 Thread Kenneth Gonsalves
On Thursday 10 June 2010 09:58:52 Sudharshan wrote: > We have a server maintained by site5.com(have a cPanel > interface) and that we have installed django ! I remember send_mail > function working well last year and also the mail_admins() function > were working properly, but right now we

Re: unable to download django

2010-06-09 Thread Kenneth Gonsalves
On Thursday 10 June 2010 07:53:51 JRMAbock wrote: > I have tried everythign. I have downloaded subversion from collabnet > and it actually did load the files until a message said that the host > forcibly closed. Now it is saying that the files are corrupted. > looks like you have a very bad inter

Re: Django Send Mail

2010-06-09 Thread Roshan Mathews
On Thu, Jun 10, 2010 at 09:58, Sudharshan wrote: > SMTPDataError: (550, 'Please use SMTP authentication or check your > POP3 mail before attempting to\nsend mail.') > Given that error, maybe this will help, http://en.wikipedia.org/wiki/POP_before_SMTP -- http://roshan.mathews.in/ -- You receiv

Re: CSRF token not adding hidden form field

2010-06-09 Thread joelklabo
This is the login view. I tried to simplify it as much as I possibly could. def login(request): return render_to_response('base.html', context_instance = RequestContext(request)) the form in the template looks like this: {% csrf_token %}

Re: CSRF token not adding hidden form field

2010-06-09 Thread Roshan Mathews
On Thu, Jun 10, 2010 at 11:08, joelklabo wrote: > MIDDLEWARE_CLASSES = ( >    'django.middleware.common.CommonMiddleware', >    'django.contrib.sessions.middleware.SessionMiddleware', >    'django.middleware.csrf.CsrfViewMiddleware', >    'django.contrib.auth.middleware.AuthenticationMiddleware',

Re: CSRF token not adding hidden form field

2010-06-09 Thread joelklabo
Looks like it did something, I didn't get a 403 but I got this error: Traceback: File "/Library/Python/2.6/site-packages/django/core/handlers/base.py" in get_response 91. request.path_info) File "/Library/Python/2.6/site-packages/django/core/urlresolvers.py" in resolve

Re: CSRF token not adding hidden form field

2010-06-09 Thread Kenneth Gonsalves
On Thursday 10 June 2010 11:37:36 Roshan Mathews wrote: > On Thu, Jun 10, 2010 at 11:08, joelklabo wrote: > > MIDDLEWARE_CLASSES = ( > >'django.middleware.common.CommonMiddleware', > >'django.contrib.sessions.middleware.SessionMiddleware', > >'django.middleware.csrf.CsrfViewMiddleware'

Re: unable to download django

2010-06-09 Thread Daniel Roseman
On Jun 10, 3:23 am, JRMAbock wrote: > I have tried everythign. I have downloaded subversion from collabnet > and it actually did load the files until a message said that the host > forcibly closed. Now it is saying that the files are corrupted. > > is there anything I can do? I really like what iv

Re: CSRF token not adding hidden form field

2010-06-09 Thread Roshan Mathews
On Thu, Jun 10, 2010 at 11:45, joelklabo wrote: > Looks like it did something, I didn't get a 403 but I got this error: > Okay, so it seems, 'django.middleware.csrf.CsrfResponseMiddleware' is not required. Please remove that. Are your forms working without csrf protection turned on? That stack