Re: new project directory not defined when starting :

2012-02-21 Thread Jisson Varghese
Hi, the linkmay help you. -- 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

Re: new project directory not defined when starting :

2012-02-21 Thread Babatunde Akinyanmi
Hi niceseb, Please be more specific about what you mean by nothing happens. That way you'll be able to quickly get useful assistance. On 2/21/12, niceseb wrote: > Hi Python experts, > > I want to start a new project with : > > C:\Users\Django_Projects>django-admin.py

Re: import error

2012-02-21 Thread dummyman dummyman
Hi i fixed the error . I didnt add the parent directory of project to sys.path.append in the standalone script thanks On Wed, Feb 22, 2012 at 10:35 AM, kalyani ram wrote: > every time you import something, plz done forget to include that in > installed_apps. this mostly

Re: Associating Form Data with Users

2012-02-21 Thread Kelly Nicholes
And by "API" do you mean "ORM?" On Feb 21, 10:45 pm, Kelly Nicholes wrote: > errr-- > > django.contrib.auth.models import User > > class YourModel(models.Model): >     user = models.ForeignKey(User) > > On Feb 21, 10:42 pm, Kelly Nicholes wrote: >

Re: Associating Form Data with Users

2012-02-21 Thread Kelly Nicholes
errr-- django.contrib.auth.models import User class YourModel(models.Model): user = models.ForeignKey(User) On Feb 21, 10:42 pm, Kelly Nicholes wrote: > Your YourModelForm is a modelform of a model.  If you're setting a > property of that model, AND YOU WANT IT TO

Re: Associating Form Data with Users

2012-02-21 Thread Kelly Nicholes
Your YourModelForm is a modelform of a model. If you're setting a property of that model, AND YOU WANT IT TO PERSIST IN THE DATABASE, you set the property equal to the request.user and save that object. If you don't have a foreignkeyfield to User, there's no way you're going to associate that

Validation For all form fields in Django templates

2012-02-21 Thread shaini sasidhar
How can I do the automatic client side form validation in django? -- 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

Re: Different classes uses different databases

2012-02-21 Thread kalyani ram
I kinda understand your doubt. are you aware of the class meta: ?? I am not aware of any such meta attributes, but thuis class is used to querying the db like you know, grouping and ordering etc. If this is doubt, well and good Thanks. Regards, Kalyani On Feb 22, 2:01 am, airween

Re: import error

2012-02-21 Thread kalyani ram
every time you import something, plz done forget to include that in installed_apps. this mostly solves the import errors and templatedoesnotexist errors problem On Feb 21, 2:28 pm, dummyman dummyman wrote: > Hi , > > I have a django project and a standalone python script .

Re: Calling "manage.py shell" from the Python Shell in Tutorial Part 1

2012-02-21 Thread kalyani ram
Hey I am a begginer too and i went tru the same tutorial and trust me i had so many errors and i just struggled tru.. now indentation errors are quite common. what u need to do is, go to u models.py, admin.py, views.py or any other .py file for which ever the code is written, and plz try using

a simple doubt

2012-02-21 Thread kalyani ram
I am working with django for past 1 week, and i ve done a lot of study on few resources. Now i am thinking of doing a simple email application using Django- python. So wer shud i start? What and shud i ve? Cz i am skeptical about one thing. can i just use two active email ids and as test? Plz help

Re: Production server on windows

2012-02-21 Thread Eugeny Klementev
I'm deploying my application to Windows Azure cloud. I prefer python web servers. Yes apache is good solution, and i'll use it if will not find any other alternatives. On Feb 21, 8:04 pm, Bill Freeman wrote: > Sorry, but I have to ask the obligatory question: why Windows? > >

Re: [re-open] viewing generated SQL without running the query

2012-02-21 Thread Russell Keith-Magee
On 22/02/2012, at 10:32 AM, diafygi wrote: > There's a previous thread about this[1], but it was closed back in > 2006 without resolution. So I'd like to check back in and see if there > is a way to get a complete query string without executing the query. > > At first, I thought I could just

[re-open] viewing generated SQL without running the query

2012-02-21 Thread diafygi
There's a previous thread about this[1], but it was closed back in 2006 without resolution. So I'd like to check back in and see if there is a way to get a complete query string without executing the query. At first, I thought I could just use the QuerySet.query.__str__(), but that does not put

Re: django 1.1: nonexistent URLs display 500.html instead of 404.html

2012-02-21 Thread rabousha
Yes, only for TEMPLATE_CONTEXT_PROCESSORS, the commas aren't added by default after the strings. I suspect it's an old bug. TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.auth' 'django.core.context_processors.debug' 'django.core.context_processors.i18n'

Re: Calling "manage.py shell" from the Python Shell in Tutorial Part 1

2012-02-21 Thread Furbee
Python is indentation-specific. It determines the semantics of your code by it's levels of indentation. For instance: # print False if False: print "false" print "done" if False: print "false" else: print "true" Note that inside the if block, all lines which are indented belong to

Calling "manage.py shell" from the Python Shell in Tutorial Part 1

2012-02-21 Thread Django_for_SB
Django Gurus, I'm an absolute beginner using Python in Django. I'm currently going through the tutorial, part 1, on the djangoproject.com main website: https://docs.djangoproject.com/en/1.3/intro/tutorial01/. I keep trying to complete part 1 of the tutorial, step by step, meaning, I'll go through

Re: Need help on a (maybe complex) query with aggregate/annotate

2012-02-21 Thread Michael Elkins
On Tue, Feb 21, 2012 at 01:10:28PM -0800, Enrico wrote: But your query counts all the books, even the bad ones. I only need to count the good ones... For example, if my books are: 1. name: LOTR, rating: 10, publisher: A ... 2. name: ASOIAF, rating: 10, publisher: A ... 3. name: Twilight,

Re: django 1.1: nonexistent URLs display 500.html instead of 404.html

2012-02-21 Thread Ian Clelland
By 'missing commas', do you mean that there are *syntax errors* in your settings.py file? That will definitely cause a 500 error, and I would be surprised if it didn't do it on *every* request. It seems odd that you would get a 404 when Debug is turned on, but that may be related to the handling

Re: Associating Form Data with Users

2012-02-21 Thread ds39
I just have one final question. The method suggested by Thorsten appears to work. But, is the attached user object an accessible filter parameter in the API now ? For instance, I don't see it listed as a part of the actual model in the API. How would I go about accessing it ? On Feb 20, 5:25 pm,

Re: Need help on a (maybe complex) query with aggregate/annotate

2012-02-21 Thread Enrico
Thanks Micheal for the response! But your query counts all the books, even the bad ones. I only need to count the good ones... For example, if my books are: 1. name: LOTR, rating: 10, publisher: A ... 2. name: ASOIAF, rating: 10, publisher: A ... 3. name: Twilight, rating 1, publisher: B ...

Different classes uses different databases

2012-02-21 Thread airween
Hello there, I have to create two (or more) classes, and rows of classes are stored in different databases. I've read about multi-db: https://docs.djangoproject.com/en/dev/topics/db/multi-db/ - that's clear for me. (Or may be I'm confused...) Is it the only way to handle the databases and

Re: Need help on a (maybe complex) query with aggregate/annotate

2012-02-21 Thread Michael Elkins
On Feb 21, 6:11 am, Enrico wrote: > This query: > Publisher.objects.filter(book__rating__gt=3.0).annotate(num_books=Count('bo > ok')) > returns all the publishers with at least one good book (ranked > 3) > with annotated the number of good books for each publisher. > > How can

django 1.1: nonexistent URLs display 500.html instead of 404.html

2012-02-21 Thread rabousha
I am using django 1.1, with DEBUG = False, and TEMPLATE_CONTEXT_PROCESSORS is missing commas, all nonexistent URLs display 500.html instead of 404.html. If I set DEBUG to True, it displays the default 404 page. if I add the commas to TEMPLATE_CONTEXT_PROCESSORS, then it displays the 404 page. The

Re: I am getting TypeError: coercing to Unicode: need string or buffer, long found. Please help.

2012-02-21 Thread Tom Evans
On Tue, Feb 21, 2012 at 5:18 PM, Daniel Marquez wrote: > Wow, I should've caught that. Thanks guys. However, since I needed a > string, what I did was add "default=x" to the integer field as > follows: > > class Phone(models.Model): >        phonenumber =

Re: I am getting TypeError: coercing to Unicode: need string or buffer, long found. Please help.

2012-02-21 Thread Shawn Milochik
On Tue, Feb 21, 2012 at 12:18 PM, Daniel Marquez < daniel.marquez0...@gmail.com> wrote: > Wow, I should've caught that. Thanks guys. However, since I needed a > string, what I did was add "default=x" to the integer field as > follows: > > class Phone(models.Model): >phonenumber =

Re: I am getting TypeError: coercing to Unicode: need string or buffer, long found. Please help.

2012-02-21 Thread Daniel Marquez
Wow, I should've caught that. Thanks guys. However, since I needed a string, what I did was add "default=x" to the integer field as follows: class Phone(models.Model): phonenumber = models.IntegerField(default=10) pub_date = models.DateTimeField('date published') def

new project directory not defined when starting :

2012-02-21 Thread niceseb
Hi Python experts, I want to start a new project with : C:\Users\Django_Projects>django-admin.py startproject mysite but nothing happens I have already checked that I have Python and Django installed and defined Env Path: C:\Python27\Lib\site-packages\django\bin, where the django_admin.py is

Re: About managing dependencies in a collaborative development team and good practices.

2012-02-21 Thread Tom Evans
On Tue, Feb 21, 2012 at 3:54 PM, Shawn Milochik wrote: > On 02/21/2012 10:53 AM, Javier Guerra Giraldez wrote: >> >> >> i do exactly that.  just a tip: to create and maintain the pip >> requirements file do: >> >> pip freeze>  piprequirementsfile.txt >> > > > +1 > > And it's

Re: Installing Django from GIT/Subversion - package dependency in virtual environment

2012-02-21 Thread shacker
Even easier, just pip install django or in requirements.txt, simply: Django To upgrade later: pip install --upgrade django ./s -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: Production server on windows

2012-02-21 Thread Bill Freeman
Sorry, but I have to ask the obligatory question: why Windows? But apart from that, I suggest that even on Windows you should use Apache and mod_wsgi. It'f fast, effective, free (as in beer and as in speech), widely used (meaning it's easier to get help for this configuration on the web). Bill

Re: About managing dependencies in a collaborative development team and good practices.

2012-02-21 Thread Shawn Milochik
On 02/21/2012 10:53 AM, Javier Guerra Giraldez wrote: i do exactly that. just a tip: to create and maintain the pip requirements file do: pip freeze> piprequirementsfile.txt +1 And it's checked into version control. Shawn -- You received this message because you are subscribed to the

Re: About managing dependencies in a collaborative development team and good practices.

2012-02-21 Thread Javier Guerra Giraldez
On Tue, Feb 21, 2012 at 8:24 AM, Sébastien Billion wrote: > Set a virtualenv is good thing. You can write a shell script which set the > virtualenv and install all the external module with pip -r. Use pip -r > nameofrequriementsfile.txt. In this file, put the list of

Re: email - inline image

2012-02-21 Thread ionic drive
Tom, you are totally right! The problem was me - not google ;-) I knew that. Did not know what I am looking for. I am sorry! & thank you very much Tom! Cheers ionic On Tue, 2012-02-21 at 14:23 +, Tom Evans wrote: > On Tue, Feb 21, 2012 at 2:18 PM, ionic drive

Need help on a (maybe complex) query with aggregate/annotate

2012-02-21 Thread Enrico
I'm having a bit of hard time with aggregation. For simplicity's sake consider the models available in the aggregation docs: https://docs.djangoproject.com/en/1.3/topics/db/aggregation/# This query: Publisher.objects.filter(book__rating__gt=3.0).annotate(num_books=Count('book')) returns all the

Re: email - inline image

2012-02-21 Thread Tom Evans
On Tue, Feb 21, 2012 at 2:18 PM, ionic drive wrote: > Thx Tom, > > as you guess I have already googled quite a lot. > 5hours. > My search was kind of "django inline image email" and subcultures. > And I actually found some techniques ... but I guess your approach is > best.

Re: dropdown select box in django

2012-02-21 Thread larry.mart...@gmail.com
On Feb 21, 6:11 am, Mario Gudelj wrote: > not sure what you mean there, I have a class that inherits from Model, and I want my field to be in that class. > but take a look at > thishttps://docs.djangoproject.com/en/dev/ref/forms/fields/#modelchoicefield That looks to

Re: email - inline image

2012-02-21 Thread ionic drive
Thx Tom, as you guess I have already googled quite a lot. > 5hours. My search was kind of "django inline image email" and subcultures. And I actually found some techniques ... but I guess your approach is best. I did not know that the magic chain I am looking for is "django mime multipart

Re: About managing dependencies in a collaborative development team and good practices.

2012-02-21 Thread Tom Evans
On Tue, Feb 21, 2012 at 1:24 PM, Sébastien Billion wrote: > Hi, > > Set a virtualenv is good thing. You can write a shell script which set the > virtualenv and install all the external module with pip -r. Use pip -r > nameofrequriementsfile.txt. In this file, put the

Re: email - inline image

2012-02-21 Thread Tom Evans
On Tue, Feb 21, 2012 at 12:42 PM, ionic drive wrote: > Hello djangos, > > I want to add a *.jpg image to an html-formated/email signature. > > I am not sure if this approach is correct, please help: > > image_file = open(settings.PROJECT_ROOT+'/static/images/image_name.jpg',

Re: django with ajax without using jquery

2012-02-21 Thread Sébastien Billion
Hi, I understand you want to learn Ajax.. So google is your friend: http://www.xul.fr/en-xml-ajax.html 2012/2/21 dummyman dummyman > Which is the best place to start with using django and ajax without using > jquery ? > > I meant calling the view function from javascript

Re: django with ajax without using jquery

2012-02-21 Thread Masklinn
On 2012-02-21, at 12:00 , dummyman dummyman wrote: > Which is the best place to start with using django and ajax without using > jquery ? > > I meant calling the view function from javascript without using jquery > features The closest XMLHttpRequest tutorial? The Mozilla Developer Network is

Re: import error

2012-02-21 Thread Sébastien Billion
Hi, You must add 'mysite'' in your INSTALLED_APP list in settings.py 2012/2/21 dummyman dummyman > Hi , > > I have a django project and a standalone python script . From the view > function, i have invoked the standalone script. I am getting the error ." > No module named

Re: About managing dependencies in a collaborative development team and good practices.

2012-02-21 Thread Sébastien Billion
Hi, Set a virtualenv is good thing. You can write a shell script which set the virtualenv and install all the external module with pip -r. Use pip -r nameofrequriementsfile.txt. In this file, put the list of module with version. Exemple: django==1.3 PIL==1.1.7 If you want distribute your own

Production server on windows

2012-02-21 Thread Eugeny Klementev
I implement application on django framework. Now i select web server for production deployment of my application. Platform is Windows Azure. For development i used embedded 'python manage.py runserver'. django documentation does not recommend use it as production solution. I try to use rocket

Re: dropdown select box in django

2012-02-21 Thread Mario Gudelj
not sure what you mean there, but take a look at this https://docs.djangoproject.com/en/dev/ref/forms/fields/#modelchoicefield On 21 February 2012 23:36, larry.mart...@gmail.com wrote: > On Feb 20, 9:52 pm, Mario Gudelj wrote: > > Hey there, > >

django with ajax without using jquery

2012-02-21 Thread dummyman dummyman
Which is the best place to start with using django and ajax without using jquery ? I meant calling the view function from javascript without using jquery features -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

import error

2012-02-21 Thread dummyman dummyman
Hi , I have a django project and a standalone python script . From the view function, i have invoked the standalone script. I am getting the error ." No module named this is my code for standalone script import os os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings' from django.conf

email - inline image

2012-02-21 Thread ionic drive
Hello djangos, I want to add a *.jpg image to an html-formated/email signature. I am not sure if this approach is correct, please help: image_file = open(settings.PROJECT_ROOT+'/static/images/image_name.jpg', 'rb') #get the image file msg_image = MIMEImage(image_file.read()) #with proper MIME

Re: dropdown select box in django

2012-02-21 Thread larry.mart...@gmail.com
On Feb 20, 9:52 pm, Mario Gudelj wrote: > Hey there, > > Try this: > > In your forms.py create a field such as this > > message = forms.ChoiceField(label='Event Type', choices=EVENT_TYPE_CHOICES) > > That will create a dropdown. My app does not have a forms.py file. I

Re: RemoteUserBackend not creating user

2012-02-21 Thread Tom Evans
On Mon, Feb 20, 2012 at 11:29 PM, Roberto Bouza wrote: > Hello, > > I've been hitting my head pretty hard trying to figure out what the > problem is hope someone here can help. > > I've set up the remote backends and middleware as per the docs and > blatantly I'm coding the