Re: problem with deploying django using mod wsgi

2013-08-07 Thread Nick Dokos
sah writes: > Though i remove those two line it did not change anything. It works > the same as before, i get the search_form page and if i give some > value for search, I get a 404 error page saying that the page is not > available in the server. > Then check the

Re: Returning random model objects - is order_by('?') on Postgres safe to use now?

2013-08-07 Thread Victor Hooi
Hi, The issue is that apparently, for ORDER BY RANDOM, the database will foo through and generate a random number for *every* row in a new column, then do a sort by that be column. Obviously that's an expensive operation and since that column is random, it's a worst case sort. For my code I was

Re: Returning random model objects - is order_by('?') on Postgres safe to use now?

2013-08-07 Thread Tom Lockhart
I haven't used the feature, but there is no reason to think that having the db backend do a random sort is any slower than you doing it yourself. If your query can reduce the number of rows returned to a relatively small number, any "order by" should have acceptable performance. If not, it will

Returning random model objects - is order_by('?') on Postgres safe to use now?

2013-08-07 Thread Victor Hooi
Hi, We have some code to return randomised Django model instances. Initially, I was using random.randint(), and returning objects by index between 0 < max_id. This was based on the Django docs: https://docs.djangoproject.com/en/dev/ref/models/querysets/#order-by specifically, the part:

Re: NuoDB released 1.2 along with a Django Driver

2013-08-07 Thread Russell Keith-Magee
This is deeply concerning -- from my initial inspection of the code, it's pretty clear that the NuoDB backend has been substantially copied from Django's postgresql_psycopg2 backend. The code in the Django postgresql_psycogpy2 backend, like all of Django, is covered by Django's BSD license, which

Re: Exception Value: Could not parse the remainder: '().order_by('-votes')' from 'poll.altword_set.all().order_by('-votes')'

2013-08-07 Thread Ramiro Morales
On Wed, Aug 7, 2013 at 6:59 PM, Pepsodent Cola wrote: > How come when I replace this: > {% for choice2 in poll.altword_set.all %} > to this: > {% for choice2 in poll.altword_set.all().order_by('-votes') %} > then I get this error: > > Exception Type:

Re: problem with deploying django using mod wsgi

2013-08-07 Thread sah
Though i remove those two line it did not change anything. It works the same as before, i get the search_form page and if i give some value for search, I get a 404 error page saying that the page is not available in the server. On Wednesday, August 7, 2013 5:25:01 PM UTC-4, sah wrote: > >

Re: Exception Value: Could not parse the remainder: '().order_by('-votes')' from 'poll.altword_set.all().order_by('-votes')'

2013-08-07 Thread Pepsodent Cola
I wrote one line wrong at: 4.) >>> *p.altword_set.all().order_by('-votes')* [, ] How do I write the correct syntax for ordering my list? On Wednesday, August 7, 2013 11:59:38 PM UTC+2, Pepsodent Cola wrote: > > Hi, > I have some database query ordering problems. > > 1.) > On my webpage I

Exception Value: Could not parse the remainder: '().order_by('-votes')' from 'poll.altword_set.all().order_by('-votes')'

2013-08-07 Thread Pepsodent Cola
Hi, I have some database query ordering problems. 1.) On my webpage I see this output: * Option-1 = 18 votes * Option-2 = 50 votes 2.) *altword_list.html* {% for choice2 in poll.altword_set.all %} {{ choice2.rosword }} - {{ choice2.alt_ros_word }} - {{ choice2.alt_transl_word }} - {{

Re: problem with deploying django using mod wsgi

2013-08-07 Thread Bill Freeman
I think that AddHandler stuff sounds like a ghost of mod_python days. I don't use it in my mod_wsgi deployments. See http://code.google.com/p/modwsgi/ for good information. Bill On Wed, Aug 7, 2013 at 5:25 PM, sah wrote: > Hello , I am trying to deploy django using apache

problem with deploying django using mod wsgi

2013-08-07 Thread sah
Hello , I am trying to deploy django using apache and mod_wsgi but not able to , can anyone help me on this : httpd.conf -- LoadModule wsgi_module modules/mod_wsgi.so WSGIScriptAlias /mice /home/getMice/webproject/wsgi.wsgi Order deny,allow Allow from all AddHandler

Re: connecting to MS SQL server in addition to default MySQL

2013-08-07 Thread Andre Terra
You can use django-mssql[0] as a backend, and then either use the ORM as usual, write RAW queries with Django[1] or just use SQL directly[2]. Cheers, AT [0] http://django-mssql.readthedocs.org/en/latest/ [1] https://docs.djangoproject.com/en/dev/topics/db/sql/ [2]

Re: handling FileField and FileSystemStorage in WizardView - Django 1.4

2013-08-07 Thread pravasi
On Tuesday, 29 January 2013 02:12:38 UTC-6, devver wrote: > > I created a form wizard of 6 steps, > in step sixth, have filefield for uploading docfile1 > > django docs is poor on this topic, google does not help. > > > my code working ok, but how handle filefield. > > need example, thanks > > >

Re: Query Set and Output

2013-08-07 Thread Arnold Krille
Hi, On Tue, 6 Aug 2013 20:19:01 -0700 (PDT) Muhammed TÜFEKYAPAN wrote: > def home(request): > output = Excuse.objects.order_by('?')[:1] [:1] selects all elements from the beginning up to the first and returns that list. true, its a list with only one member, but still

connecting to MS SQL server in addition to default MySQL

2013-08-07 Thread Larry Martell
I have a django app that connects to a MySQL server in the usual way. I've noe been asked to add some new functionality that requires that I pull data from a MS SQL server database running on a Windows box. I don't want to use the django ORM with the db, just access it directly with some sql in my

Re: NuoDB released 1.2 along with a Django Driver

2013-08-07 Thread Michael Manfre
Copyright (c) 2012, NuoDB, Inc. All rights reserved. You might want to update the license to reflect that most of the code is actually a copy & paste from Django's postgresql_psycopg2 backend, which was obvious because whoever worked on the backend forgot to remove all of the "postgresql"

Re: Django 1.5.1 and clearsessions

2013-08-07 Thread Derrick Jackson
Thanks Richard. I'll double-check and try again. On Wed, Aug 7, 2013 at 10:39 AM, Richard E. Cooke wrote: > Works fine for me. Must be a path issue. > > > > > On Wednesday, August 7, 2013 9:41:37 AM UTC-4, Derrick Jackson wrote: > >> Hmm... >> >> When I attempt to run

How to integrate my app into a theme / template

2013-08-07 Thread Christian Erhardt
Hi, currently i'm using pinax for my project and therefor pinax-theme-bootstrap. I wrote some apps and want to integrate them into my template. Right now, i copied the file site_base.html into my projects template directory and added the menu links i needed to the {% block nav %} in this

Re: Django 1.5.1 and clearsessions

2013-08-07 Thread Richard E. Cooke
Works fine for me. Must be a path issue. On Wednesday, August 7, 2013 9:41:37 AM UTC-4, Derrick Jackson wrote: > > Hmm... > > When I attempt to run django-admin.py clearsessions while using django > 1.5.1 I am told that clearsessions is an unknown command. Has anyone > successfully used

Re: Django 1.5.1 and clearsessions

2013-08-07 Thread Derrick Jackson
UPDATE: I am able to run this via PyCharm's Tools > Run manage.py Task. However, for the life of me I cannot figure out how to run this from the command line. What am I missing? On Wednesday, August 7, 2013 9:41:37 AM UTC-4, Derrick Jackson wrote: > > Hmm... > > When I attempt to run

Django 1.5.1 and clearsessions

2013-08-07 Thread Derrick Jackson
Hmm... When I attempt to run django-admin.py clearsessions while using django 1.5.1 I am told that clearsessions is an unknown command. Has anyone successfully used clearsessions as of yet? -- You received this message because you are subscribed to the Google Groups "Django users" group. To

How do I find out how many AdminSites exist?

2013-08-07 Thread Richard E. Cooke
I want to use Grappelli and Django-extensions with my Admin site. But I also need to use modelAdmin.queryset to restrict my records. Both Grappelli and Django-extensions Auto Complete Lookups use the model's base queryset. I want to put in a request to change the code, which is easy - so long

Re: Query Set and Output

2013-08-07 Thread Muhammed TÜFEKYAPAN
"outout = Excuse.objects.order_by('?')[0]" This works well. Thank you. On Wednesday, August 7, 2013 6:19:01 AM UTC+3, Muhammed TÜFEKYAPAN wrote: > > Hello everyone, > > I write a basic model in django 1.5.1 > > My model is looks like this: > class Excuse(models.Model): > text =

Re: Query Set and Output

2013-08-07 Thread abhijeet shete
Hi, If you tries to access values from list using slice it returns you the subset of list not a single value.The query *(*Excuse.objects.order_by('?')* )* from your view returns a list and you are trying to access values from that list using slice which in turn returns subset of list and

Re: Query Set and Output

2013-08-07 Thread Muhammed TÜFEKYAPAN
It looks like this: {{ output }} On Wednesday, August 7, 2013 6:58:17 AM UTC+3, Bulkan-Savun Evcimen wrote: > > Hi there, > > What does your template index.html look like ? > > Cheers > > http://bulkan-evcimen.com > > > On Wed, Aug 7, 2013 at 1:19 PM, Muhammed TÜFEKYAPAN >

Re: Internationalization - top level locale .mo files generated but not recognised in Django 1.5

2013-08-07 Thread katstevens
To follow up on this - when I moved my locale files to a completely new location and used a different path in my LOCALE_PATHS settings, the translations worked fine. I think it may have been a folder permissions issue. On Tuesday, August 6, 2013 5:02:03 PM UTC+1, katstevens wrote: > > I am