Re: mod_wsgi, apache, windows XP

2010-09-05 Thread Elim Qiu
I followed a installation instruction and got Apache/2.2.15 (Win32) SVN/1.6.12 mod_wsgi/3.3 Python/2.7 PHP/5.2.5 DAV/2 installed OK. Meaning that I inserted the following lines to my httpd.conf: LoadModule wsgi_module modules/mod_wsgi.so WSGIScriptAlias /wsgi "F:/Apache/appwsgi/wsgi_handler.py" #

Generate a daily serial/batch/lot number

2010-09-05 Thread kmpm
I have a project running in a manufacturing industry that is actually built upon django. In this I need to generate a unique serial, batch or lot number (depending on what you would like to call it) that is a running number from 0 to whathever for each and every day. There is a high risk of concurr

Re: Django template : For Loop

2010-09-05 Thread Jagdeep Singh Malhi
> > I tried this, its not working. > > Sorry, but "not working" does not constitute useful information. > > My car isn't working. Can you fix it? ;-) model.py from django.db import models from django.forms import ModelForm class Input(models.Model): input1 = models.FloatField() input2 =

Re: django-twitter-oauth connection refused

2010-09-05 Thread ashy
Hi All, Now I am getting 'Cannot send request' exception. Exception Location: /usr/lib/python2.6/httplib.py in putrequest, line 802 Some problem with httplib. Any ideas? thanks ashwin On Sep 4, 1:16 am, Bill Freeman wrote: > No.  I'm not actually using twitter anywhere.  I just remember th

Re: Pylons vs. Django

2010-09-05 Thread Steven Elliott Jr
You can use sqlalchemy with django too Sent from my iPad On Sep 5, 2010, at 2:37 PM, Juan Hernandez wrote: > Well, just by using SQLAlchemy makes this framework worth a try > > On 9/5/10, Feross wrote: >> Hey everyone, >> >> I'm a new Python user and I'm looking for a web development framewo

Re: Question/Suggestion on using mod_wsgi with Django

2010-09-05 Thread DaveP
Thanks again Graham. FWIW, based on your feedback I'm going to roll with the version below. As you say its not obvious to newbies, but the two things I do like about it are: 1) It "enforces" putting the wsgi file in a sub-directory. Since its assuming the sub directory in use it will bomb without i

Re: Question/Suggestion on using mod_wsgi with Django

2010-09-05 Thread Graham Dumpleton
I don't disagree that calculating paths based off __file__ in some way, where WSGI script is contained somewhere within the Django project, is a good idea. The problem is that the majority of newbies wouldn't understand what that non obvious bit of code is actually doing. Thus as far as supporting

Re: Django with PyPy JIT?

2010-09-05 Thread Alex_Gaynor
On Sep 5, 4:40 pm, Andy wrote: > Anyone tried running Django with PyPy JIT? > > What are the steps to set it up? Is it stable? > > PyPy benchmark shows almost 3X speed up of Django and they also said > it would reduce memory consumption. I'm interested in trying it out. > Just want to learn abou

Re: Question/Suggestion on using mod_wsgi with Django

2010-09-05 Thread DaveP
Thanks Graham, It kind of felt that os.path.dirname & os.path.basename were accomplishing the same thing as using the split, I didn't realize one was better than the other, thanks for calling that out. I had glazed over dropping the WSGI file into the Apache subfolder, so thanks also for pointing

Re: Question/Suggestion on using mod_wsgi with Django

2010-09-05 Thread Graham Dumpleton
On Sep 6, 5:01 am, DaveP wrote: > Let me first state, I'm fairly new to Python and even newer to Django, > so if what I'm mentioning is already an ongoing effort, I apologize. > > I was reviewing the following > documentation:http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/. > > I

Question/Suggestion on using mod_wsgi with Django

2010-09-05 Thread DaveP
Let me first state, I'm fairly new to Python and even newer to Django, so if what I'm mentioning is already an ongoing effort, I apologize. I was reviewing the following documentation: http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/. I has a question/possible suggestion. The docume

Re: Pylons vs. Django

2010-09-05 Thread Feross
Juan, Thanks for the reply - that's good to know. I think Django is best for me right now. Feross On Sun, Sep 5, 2010 at 2:25 PM, Juan Hernandez wrote: > On Sun, Sep 5, 2010 at 4:49 PM, Feross wrote: > >> SQLAlchemy is that hard to use? I've only heard good things about it... In >> any case,

how do forms select language to render?

2010-09-05 Thread Aljoša Mohorović
if django.utils.translation.get_language() and LANGUAGE_CODE returns one language what does form.as_p use that it renders localized stuff in another language? Aljosa Mohorovic -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this grou

Re: Setting a default value for a select widget in a modelformset

2010-09-05 Thread Roald de Vries
On Sep 2, 2010, at 4:41 PM, Steve McConville wrote: What would be the best way to go about this? Is it necessary to create a custom widget to achieve this? I guess the best way would be to use the 'initial' parameter. http://docs.djangoproject.com/en/dev/topics/forms/formsets/#using-initial-dat

Re: Pylons vs. Django

2010-09-05 Thread Juan Hernandez
On Sun, Sep 5, 2010 at 4:49 PM, Feross wrote: > SQLAlchemy is that hard to use? I've only heard good things about it... In > any case, I'm giving Django a shot right now. I'm still curious to hear some > opinions about Pylons vs. Django. > > The main difference between SQLAlchemy and Django's ORM

Re: Pylons vs. Django

2010-09-05 Thread Feross
SQLAlchemy is that hard to use? I've only heard good things about it... In any case, I'm giving Django a shot right now. I'm still curious to hear some opinions about Pylons vs. Django. Feross On Sun, Sep 5, 2010 at 2:18 PM, Feross Aboukhadijeh wrote: > SQLAlchemy is that hard to use? I've only

RE: mod_wsgi, apache, windows XP

2010-09-05 Thread Anna Leslie
Hello Reinout, I downgraded to python 2.6 and thus all the other programs and still no luck. But, didn't you say you've been able to run it with Python 2.6? Also, someone else says that Mysql runs fine. I don't like MySQL, because of its sloppy referential integrity, but my project isn't so la

Django with PyPy JIT?

2010-09-05 Thread Andy
Anyone tried running Django with PyPy JIT? What are the steps to set it up? Is it stable? PyPy benchmark shows almost 3X speed up of Django and they also said it would reduce memory consumption. I'm interested in trying it out. Just want to learn about anyone's experience with running Django on P

Re: mod_wsgi, apache, windows XP

2010-09-05 Thread Reinout van Rees
On 09/03/2010 05:38 PM, Anna Leslie wrote: This is in my settings file: 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. And it works fine with the local django server. The entire application works fine with

Re: Pylons vs. Django

2010-09-05 Thread Juan Hernandez
Well, just by using SQLAlchemy makes this framework worth a try On 9/5/10, Feross wrote: > Hey everyone, > > I'm a new Python user and I'm looking for a web development framework to > build a database-driven website. I've looked at the various Python web > frameworks out there and I've settled on

Re: Django images, can't load a simple image into html page when I using django!

2010-09-05 Thread leonardo.lozano
Any solution for this issue yet? On Aug 11, 7:23 am, Aljoša Mohorović wrote: > On Wed, Aug 11, 2010 at 1:14 PM, pj-linden wrote: > > I have yust started with a django project and have the default settup, > > I have followed the django tutorials and now I am trying to load an > > image into the h

Re: Django template : For Loop

2010-09-05 Thread Steve Holden
On 9/5/2010 12:29 PM, Jagdeep Singh Malhi wrote: > >> If these objects are lists, say list1 and list2, in your view just >> create a single object made up of pairs of elements from the original lists: >> >>values = zip(list1, list2) >> >> Then you can pass that item to your template and iterat

Re: Django template : For Loop

2010-09-05 Thread Justin Myers
What error message is it giving you? I'd assume it's a problem with the objects you're passing it, since zip is a built-in Python function: http://docs.python.org/library/functions.html#zip On Sep 5, 11:29 am, Jagdeep Singh Malhi wrote: > > If these objects are lists, say list1 and list2, in yo

Re: Django template : For Loop

2010-09-05 Thread Jagdeep Singh Malhi
> If these objects are lists, say list1 and list2, in your view just > create a single object made up of pairs of elements from the original lists: > >    values = zip(list1, list2) > > Then you can pass that item to your template and iterate over it. I tried this, its not working. -- You recei

Re: ANN: PyMySQL 0.3

2010-09-05 Thread Andy
On Sep 5, 5:29 am, Daniel Roseman wrote: > If I get some time I'll try and work up an example. Please do Daniel. That'd really help. -- 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...@googlegro

Re: Where and how should I write translations [SOLVED]

2010-09-05 Thread Martin Tiršel
I solved it by creating a new python file with: # -*- coding: utf-8 -*- from django.utils.translation import ugettext as _ translation_strings = [ _(u'string'), _(u'another string'), ... ] So easy :) Martin On Thu, 02 Sep 2010 13:33:36 +0200, Martin Tiršel wrote: Hello, I

Announcing django-projector - django project management app with mercurial repositories support build-in

2010-09-05 Thread lukaszb
It took more time than I expected but there it is: project management with repositories support. So? What's in? Well, there is repository content browser, support for mercurial push/clone over http, simple issue tracker (which have to be revisited probably), members & teams, permissions etc. There

Re: Django template : For Loop

2010-09-05 Thread Steve Holden
On 9/5/2010 7:54 AM, Jagdeep Singh Malhi wrote: >> I have question about "for loop" used in Templates the correct >> Syntax of using For Loop in template is : {% for X in VALUE %} >> >> but I want to use For loop with two value Is it possible to use two >> value in one loop? For example : {% for X

Django template : For Loop

2010-09-05 Thread Jagdeep Singh Malhi
I have question about "for loop" used in Templates the correct Syntax of using For Loop in template is : {% for X in VALUE %} but I want to use For loop with two value Is it possible to use two value in one loop? For example : {% for X, Y in VALUE1, VALUE2 %} Or {% for X in VALUE1 && Y in VAL

Re: Getting last or max "id" value from database

2010-09-05 Thread Jagdeep Singh Malhi
> Given that the ModelForm save() method actually returns the Input object > it has just created, wouldn't you be better simply saying > >     p = form.save() > Problem solved Thanks Sir. -- You received this message because you are subscribed to the Google Groups "Django users" group. To pos

Re: ANN: PyMySQL 0.3

2010-09-05 Thread Daniel Roseman
On Sep 4, 9:58 pm, Pete Hunt wrote: > Hi Andy - > > Below is a patch that will let Django use pymysql if MySQLdb is not > available. Currently it is not in use in production anywhere but I am > hoping to change that soon. Currently its primary use is prototyping > applications that are being devel

Re: Getting last or max "id" value from database

2010-09-05 Thread Steve Holden
On 9/5/2010 3:12 AM, Jagdeep Singh Malhi wrote: > I try to get the max value of id from database using max() function > but a face this error. > { > TypeError at /add_db/ > > 'builtin_function_or_method' object is not iterable > > Request Method: POST > Request URL: http://localhost/django

Getting last or max "id" value from database

2010-09-05 Thread Jagdeep Singh Malhi
I try to get the max value of id from database using max() function but a face this error. { TypeError at /add_db/ 'builtin_function_or_method' object is not iterable Request Method: POST Request URL:http://localhost/django/add_db/ Django Version: 1.2.1 Exception Type: