Re: same code runs on two machines and barfs on the third

2012-02-06 Thread kenneth gonsalves
On Tue, 2012-02-07 at 08:06 +0100, Babatunde Akinyanmi wrote: > Perhaps you made a change to a model and forgot to syncdb on your > Fedora 15 machine. no -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: same code runs on two machines and barfs on the third

2012-02-06 Thread Babatunde Akinyanmi
Perhaps you made a change to a model and forgot to syncdb on your Fedora 15 machine. On 2/7/12, kenneth gonsalves wrote: > hi, > > this is the relevant part of my model: > > class Team(models.Model): > name = models.CharField(_("Team Name"),max_length=150,unique=True) > members = >

same code runs on two machines and barfs on the third

2012-02-06 Thread kenneth gonsalves
hi, this is the relevant part of my model: class Team(models.Model): name = models.CharField(_("Team Name"),max_length=150,unique=True) members = tournament = models.ForeignKey(Tournament) in my view I have the following line of code: cr = Team.objects.filter(tournament_id=tournid)

Re: Problems with Django Form Processing

2012-02-06 Thread Jason
Your numerical values might be considered strings for that comparison. Try: if int(p) > 2: ... On Jan 16, 11:05 pm, zhyr28 wrote: > Hi all, I want to develop a survey app that has ten radio selects. > After people submit the survey, the data will be processing and then > output the result. I met

django on windows azure

2012-02-06 Thread Eugeny Klementev
Hello, I'm porting django application on windows azure cloud. I looking for ways to use azure's database from django application. I see two ways: 1. Use Azure SQL and use the any open-source odbc backend (i found django-pyodbc http://code.google.com/p/django-pyodbc/) 2. Use the windows azure tab

Re: Somebody please attend to me

2012-02-06 Thread Kelly Nicholes
This is link holds the PERFECT answer for you: http://bit.ly/wc0psc If you want to do it differently, try: First you'll have to send an XMLHttpRequest (jQuery post() or get()) to your server to post a form (create a modelform with a "Comment" model with all of the required fields. You might want

Re: djangoproject.com

2012-02-06 Thread Russell Keith-Magee
http://www.isup.me/djangoproject.com I don't know what's happening at *your* end, but djangoproject.com is working for me right now, and I'm not aware of any major outages over the last couple of days. We hosted a sprint this past weekend, so if there was an outage, I think we would have notic

Multiple Django Virtual Hosts on Apache+mod_wsgi but only one gets served

2012-02-06 Thread Chris Cuilla
I've been struggling to figure out the following problem and am hoping someone else has seen this. I have a server running Apache 2 w/mod_wsgi. I've setup multiple, different Django apps. Each has its own virtual host configuration (see below). This is on a local test server and my client machine

djangoproject.com

2012-02-06 Thread DSblizzard
What's happening with it? It's unavailable for several days. -- 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 django-users+unsubscr

Re: django.core.handlers.wsgi not found

2012-02-06 Thread larry.mart...@gmail.com
On Feb 5, 4:13 pm, "larry.mart...@gmail.com" wrote: > On Feb 5, 4:05 pm, Dennis Lee Bieber wrote: > > > > > > > > > On Sun, 5 Feb 2012 14:08:52 -0800 (PST), "larry.mart...@gmail.com" > > > wrote: > > > >It's exactly the same sys.path I get from command line python, where > > >the import works.

Re: Checking template

2012-02-06 Thread Andy McKay
On Mon, Feb 6, 2012 at 9:04 AM, xina towner wrote: > How can I  check the template of a view?? .. >         self.assertTemplateUsed(resp, 'name_of_the_template', 'Bad > Template') Yes, the docs on assertTemplateUsed are at: https://docs.djangoproject.com/en/dev/topics/testing/#django.test.TestCa

Re: Django Tutorial Part 3 Decoupling the URLconfs

2012-02-06 Thread Thorsten Sanders
You are using the tutorial of the development version which is 1.4 alpha, but using yourself version 1.3.1, so you need to use django.conf.urls.defaults instead of django.conf.urls Better use the 1.3 tutorial instead of the development one to not run into such troubles. Am 06.02.2012 23:23,

Re: Django Tutorial Part 3 Decoupling the URLconfs

2012-02-06 Thread John Paton
Thanks for the help. Here's what it says: from django.conf.urls import patterns, include, url and then it says unresolved import: url, include, patterns. Can you tell me what is going wrong here. Thanks! On Feb 6, 12:02 pm, Pavlo Kapyshin wrote: > As this exception says, you have an error o

Re: How to check the HTTP_HOST from templates/404.html when using flat pages

2012-02-06 Thread tiff
I must have been tired! Simply added code to existing context processor to provide request.META['HTTP_HOST'] as a variable in the returned dictionary. Doh! -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: No Module named URLS

2012-02-06 Thread Sandro Dutra
If I understand you're writing a template for admin, and this is not required 'cause the admin template is called by the contrib 'django.contrib.admin', in INSTALLED_APPS (settings file), only if you want to customize admin, you can override the admin files, putting them o 'yourtemplatesdir/admin/'

Re: How to save a file from filesystem

2012-02-06 Thread Martin Tiršel
I found it: myfile = File(open('/some/filesystem/path/file.jpg', 'r')) myfile.name = os.path.basename(myfile.name) myobj = MyObj.objects.get(id=123) myobj.myfile = myfile myobj.save() This saves the file under upload_to path correctly. On Mon, 06 Feb 2012 11:46:19 +0100, Martin Tiršel wrot

Re: No Module named URLS

2012-02-06 Thread akaariai
On Feb 6, 5:09 pm, coded kid wrote: > Hey guys, I’m getting an error when trying to visit my admin page: > TemplateSyntaxError at /admin/ > Caught ImportError while rendering: No module named urls > > In urls.py > from django.conf.urls.defaults import patterns, include, url > from django.contrib i

Re: augmenting aggregated queries

2012-02-06 Thread akaariai
On Feb 6, 7:15 pm, Robert Lehmann wrote: > I'm trying to add additional data to an aggregated query, like so: > (there are many MyModels for any date, and I want to sum up > MyModel.value for every single date, and then do a calculation on that > sum) > >   qs = MyModel.objects.values('date').anno

Re: Error

2012-02-06 Thread Chris
It's unable to find the python module openid, I would assume, that you just don't have the openid python module installed. Since you appear to be using linux, you should just be able to, on the command line, do: pip install python-openid And it should download and install the module. On Feb 6, 7

augmenting aggregated queries

2012-02-06 Thread Robert Lehmann
I'm trying to add additional data to an aggregated query, like so: (there are many MyModels for any date, and I want to sum up MyModel.value for every single date, and then do a calculation on that sum) qs = MyModel.objects.values('date').annotate(count=Sum('value')) for item in qs: item

Checking template

2012-02-06 Thread xina towner
How can I check the template of a view?? can I do it like this: def test_request_invitation(self): resp = self.client.get('/accounts/invite/request/') self.assertEqual(resp.status_code, 200) self.assertTemplateUsed(resp, 'name_of_the_template', 'Bad Template') -- G

Re: Django Tutorial Part 3 Decoupling the URLconfs

2012-02-06 Thread Pavlo Kapyshin
As this exception says, you have an error on first line of urls.py. Double-check that line. -- 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

Django Tutorial Part 3 Decoupling the URLconfs

2012-02-06 Thread John Paton
Hi, I have just tried to decouple my polls urls. Everything was working before but when I now go to mysite I get the following error message. Do you have any idea how I could fix this? Thanks for the help! ImportError at / cannot import name patterns Request Method: GET Request URL:http://127

Possible issue in Django's Wsgi.py module

2012-02-06 Thread Harel Malka
I've done a fairly standard release of our application last night and apache refused to start afterwards. This kept on going even after I rolled back the codebase. All I got back was Apache's server error page, and the logs showed the dreaded: * * *Premature end of script headers: django.wsg

Re: Is there a way to prevent /static directory browsing?

2012-02-06 Thread Robert Steckroth
Thanks much guys. +1 Django community. On Mon, Feb 6, 2012 at 9:59 AM, Denis Darii wrote: > Under nginx you can set "autoindex" to "off" for "/static/" location: > > location /static/ > { > autoindex off; > root /path/to/your/static/; > } >

Re: VIM as Modern Python/Dajngo IDE

2012-02-06 Thread Vikas Ruhil
Sorry guys i forget to remove my signature extremely sorry for that to all On Mon, Feb 6, 2012 at 8:40 PM, Vikas Ruhil wrote: > sure soon i must update my blog with my .vimrc on github ,pastie.org.I am > busy in production of image and screen-cast for those plugins so people can > benefited from

Re: VIM as Modern Python/Dajngo IDE

2012-02-06 Thread Vikas Ruhil
sure soon i must update my blog with my .vimrc on github ,pastie.org.I am busy in production of image and screen-cast for those plugins so people can benefited from them because vim really enhance the productivity and saves a lot of time. Can be converted into best editor .Many textmate and others

Re: Is there a way to prevent /static directory browsing?

2012-02-06 Thread Denis Darii
Under nginx you can set "autoindex" to "off" for "/static/" location: location /static/ { autoindex off; root /path/to/your/static/; } More info here: http://wiki.nginx.org/HttpAutoindexModule On Mon, Feb 6, 2012 at 3:53 PM, Robert Steckrot

Re: Is there a way to prevent /static directory browsing?

2012-02-06 Thread Cherian Thomas
Direct your webserver to prevent this. .htaccess/conf in apace. Directory browsing is disabled by default in nginx http://www.ducea.com/2006/06/26/apache-tips-tricks-disable-directory-indexes/ Regards, Cherian On Mon, Feb 6, 2012 at 8:23 PM, Robert Steckroth wrote: > Hey Guys, I am looking fo

Is there a way to prevent /static directory browsing?

2012-02-06 Thread Robert Steckroth
Hey Guys, I am looking for a way to hide my media files from direct access. What is the common practice here? If one would browse to http://www.example.com/static in one of my Django sites there would be a list of all the files used therein. Is there a way to hide/prevent this url from having a dir

Re: VIM as Modern Python/Dajngo IDE

2012-02-06 Thread Piotr Zalewa
Good work with adding explanations to what plugins are doing, I'm too often just add plugins. It might be worth to put your setup (basically .vim directory) on github. I did so with mine, but it's a bit bloated (https://github.com/zalun/vimSetup) I advice to use pathogen plugin and keep all

How to check the HTTP_HOST from templates/404.html when using flat pages

2012-02-06 Thread tiff
Hi, I am using flatpages and I have a 404.html in my templates directory. I need the 404 page to extend different templates depending on the HTTP_HOST (the same app is delivering pages for multiple domains). What's the easiest way to achieve this from the 404 page without overriding the 404 handler

Re: Making login Testing

2012-02-06 Thread Denis Darii
Yes Rubén you are right, also you can use directly self.client.login() method: ... def setUp(self):login = self.client.login(username='myusername', password='mypass') self.assertTrue(login) On Mon, Feb 6, 2012 at 12:46 PM, xina towner wrote: > Hi, I've a question, how can I make l

Making login Testing

2012-02-06 Thread xina towner
Hi, I've a question, how can I make login while testing? shouldn't be enough to do something like this: def setUp(self): response = self.post('/accounts/login/', {'username': 'username', 'password': 'username'}) self.assertEqual(response.status_code, 200, "Login Failure") p

Release: django-email-as-username

2012-02-06 Thread Tom Christie
Okay, I know there are a handful of other apps that already do this, but I wasn't quite happy with anything that was out there. I've pushed the django-email-as-username package to PyPI. Source and docs available here: https://github.com/dabapps/django-email-as-username I think it's pretty comp

How to save a file from filesystem

2012-02-06 Thread Martin Tiršel
Hello, I have a model with FileField with upload_to callable to save it into secific directory structure. I have a list of paths on filesystem with some files I need to create a record for. How can I open a file on the filesystem, assign it to my model and save so the file will be copied to

Re: how to make a small change for apps installed under /site-packages dir

2012-02-06 Thread bruno desthuilliers
On Feb 5, 6:16 pm, Tom Lesters wrote: > hi all, > > I installed an app called idios into python2.6/site-packages/idios dir, Which is possibly not a great idea... as you now know . Generally speaking, using virtualenv (no-site-packages) + pip (with a requirement file you keep in your project) is