Re: PostgreSQL backend - Ident authentication failed?

2010-06-21 Thread Kenneth Gonsalves
On Monday 21 June 2010 12:24:58 Torsten Bronger wrote: > > Also, is this recommended practice, to use "www-data" as the > > backend database username? > > No, not recommended, but not forbidden either. > should be forbidden - one does not want apache to have direct access to the database -- Re

Re: PostgreSQL backend - Ident authentication failed?

2010-06-21 Thread Victor Hooi
heya, Using "www-data" as the backend database username in settings.py doesn't quite work. If you try to run a ./manage.py syncdb, it spits out: Traceback (most recent call last): File "./manage.py", line 11, in execute_manager(settings) File "/usr/local/lib/python2.6/dis

Apache + Gunicorn + Django? Sample Configs?

2010-06-21 Thread Victor Hooi
Hi, I'm currently deploying Django on Apache with WSGI. Anyhow, I've heard really good things about the Gunicorn (http:// gunicorn.org/) WSGI server, so I was hoping to try it out. I'm running Ubuntu 10.04, so I've installed the packages from the official PPA (https://launchpad.net/~bchesneau/+a

Re: PostgreSQL backend - Ident authentication failed?

2010-06-21 Thread Kenneth Gonsalves
On Monday 21 June 2010 12:45:11 Victor Hooi wrote: > I'm still curious what changed? Perhaps Ubuntu's default pg_hba.conf > default always has ident in all distros that I am aware of -- Regards Kenneth Gonsalves Senior Associate NRC-FOSS at AU-KBC -- You received this message because you are s

Re: Django templates and libraries

2010-06-21 Thread shofty
i think i'd be right in saying that template tags are different to the eggs issue. i found a post on b-list which explained templatetags and where to put them. http://www.b-list.org/weblog/2007/dec/04/magic-tags/ so pretty much always drop the tags inside a folder named templatetags in your app fo

Re: PostgreSQL backend - Ident authentication failed?

2010-06-21 Thread Sam Lai
On 21 June 2010 17:04, Kenneth Gonsalves wrote: > On Monday 21 June 2010 12:24:58 Torsten Bronger wrote: >> > Also, is this recommended practice, to use "www-data" as the >> > backend database username? >> >> No, not recommended, but not forbidden either. >> > > should be forbidden - one does not

Re: Actions after HttpResponse rendered?

2010-06-21 Thread Daniel Roseman
On Jun 21, 6:46 am, DaNmarner wrote: > There's a similar question as mine on stackoverflow.com: > > http://stackoverflow.com/questions/1081340/how-do-you-do-something-af... > > and there isn't a satisfactory answer there. > > Basically, how do I do some thing after a view returns the response? > D

How much would you charge for this? £5k? £15k? £5 0k?

2010-06-21 Thread ALJ
I'm just starting out with Django so using an hourly rate isn't really applicable because I'm going to be much slower that a 'real' developer. So far I've spent about 6 months part time. What kind of ballpark amounts would people suggest this is worth? I'm not going to tell you how much they thin

Re: PostgreSQL backend - Ident authentication failed?

2010-06-21 Thread Kenneth Gonsalves
On Monday 21 June 2010 13:39:42 Sam Lai wrote: > > should be forbidden - one does not want apache to have direct access to > > the database > > Storing a password in plaintext file makes me uneasy, even though it > is locked away through file-system permissions. > > Having spent some time recentl

RE: Problem trying to configure Django with FastCGI and Lighttpd

2010-06-21 Thread JoeManFoo
I know this thread is rather old but for those who come across this trying to identify their issues here's how I got things working for me on Ubuntu 10.04. The major issue to the above poster's issue was with permissions. The www-data user that's running the lighttpd process needs to be able to e

Mysql-Python error

2010-06-21 Thread Eduan
When installing Mysql-Python I get this error. Traceback (most recent call last): File "setup.py", line 5, in from setuptools import setup, Extension ImportError: No module named setuptools Can anyone please help me. -- You received this message because you are subscribed to the Google G

Re: Mysql-Python error

2010-06-21 Thread Kenneth Gonsalves
On Monday 21 June 2010 13:04:19 Eduan wrote: > When installing Mysql-Python I get this error. > > Traceback (most recent call last): > File "setup.py", line 5, in > from setuptools import setup, Extension > ImportError: No module named setuptools > install setuptools -- Regards Kenneth G

Re: PostgreSQL backend - Ident authentication failed?

2010-06-21 Thread Sam Lai
On 21 June 2010 19:47, Kenneth Gonsalves wrote: > On Monday 21 June 2010 13:39:42 Sam Lai wrote: >> > should be forbidden - one does not want apache to have direct access to >> > the database >> >> Storing a password in plaintext file makes me uneasy, even though it >> is locked away through file-

Re: PostgreSQL backend - Ident authentication failed?

2010-06-21 Thread Kenneth Gonsalves
On Monday 21 June 2010 15:37:50 Sam Lai wrote: > > and a single point of entry to all systems for a cracker > > I'm not running them all as admin (aka. root) obviously. Integrated > auth doesn't mean every user account can access every resource. It's > really just delegating an application's authe

Re: Actions after HttpResponse rendered?

2010-06-21 Thread David De La Harpe Golden
On 21/06/10 06:46, DaNmarner wrote: There's a similar question as mine on stackoverflow.com: http://stackoverflow.com/questions/1081340/how-do-you-do-something-after-you-render-the-view-django and there isn't a satisfactory answer there. Basically, how do I do some thing after a view returns t

Re: UnicodeDecodeError (ordinal not in range) when deleting an inline item - 1.2.1

2010-06-21 Thread Matt Hoskins
Federico, When trying out what Karen suggests then in the unlikely event that Red Hat doesn't load the environment variables from /etc/apache2/ envvars, one way to find it without consulting documents is to look at the apache start-up script (e.g. /usr/sbin/apache2ctl) so find that on your server

Re: PostgreSQL backend - Ident authentication failed?

2010-06-21 Thread Sam Lai
On 21 June 2010 20:16, Kenneth Gonsalves wrote: > On Monday 21 June 2010 15:37:50 Sam Lai wrote: >> >> You do bring up a interesting point though, and I don't know much >> >> about the architecture of Apache and how holes are exploited when they >> >> exist, but if the trespasser can execute arbit

Re: fieldsets django

2010-06-21 Thread Waleria
I don't know I'm wondering how to use the fieldsets.can you help me...how to use the fieldsets...? On 20 jun, 15:01, Francis Gulotta wrote: > You might want to look into a css solution. > > -Francis > > --- > Francis Gulotta > wiz...@roborooter.com > > On Fri, Jun 18, 2010 at 3:40 PM, Wa

Re: PostgreSQL backend - Ident authentication failed?

2010-06-21 Thread Kenneth Gonsalves
On Monday 21 June 2010 16:21:10 Sam Lai wrote: > >From the PGSQL docs [1], > > "On systems supporting SO_PEERCRED requests for Unix-domain sockets > (currently Linux, FreeBSD, NetBSD, OpenBSD, BSD/OS, and Solaris), > ident authentication can also be applied to local connections. In this > case, no

Re: How much would you charge for this? £5k? £15k? £50k?

2010-06-21 Thread ALJ
... I've just noticed the title and hope this doesn't look too much like spam!! On Jun 21, 11:12 am, ALJ wrote: > I'm just starting out with Django so using an hourly rate isn't really > applicable because I'm going to be much slower that a 'real' > developer. So far I've spent about 6 months par

Re: fieldsets django

2010-06-21 Thread Tom Evans
On Mon, Jun 21, 2010 at 12:12 PM, Waleria wrote: > I don't know I'm wondering how to use the fieldsets.can you > help me...how to use the fieldsets...? > Be a bit clearer please. Fieldset is a HTML tag, it has nothing to do with django. It is used to group similar fields and surround th

outer join in orm

2010-06-21 Thread JeffH
I have some models that (simplified) look like the following. class Answer(models.Model): id = models.CharField(max_length=32, primary_key=True) text = models.TextField(blank=False) question = models.ForeignKey(Question) candidate = models.ForeignKey(Candidate) class Question(mode

FW: google search

2010-06-21 Thread Henrik Genssen
Hi, I am trying to optimize the search of users, as google does. So I thought having a 2. column in DB with a "normalized" version of the string. By normalize I mean convert ä to ae etc. Someone done this before? On my way searching for a solution, I found this lib for a "did you mean" search:

Re: outer join in orm

2010-06-21 Thread Daniel Roseman
On Jun 21, 12:51 pm, JeffH wrote: > I have some models that (simplified) look like the following. > > class Answer(models.Model): >     id = models.CharField(max_length=32, primary_key=True) >     text = models.TextField(blank=False) >     question = models.ForeignKey(Question) >     candidate = m

Re: FW: google search

2010-06-21 Thread Tom Evans
On Mon, Jun 21, 2010 at 1:37 PM, Henrik Genssen wrote: > Hi, > > I am trying to optimize the search of users, as google does. > So I thought having a 2. column in DB with a "normalized" version of the > string. > By normalize I mean convert ä to ae etc. > > Someone done this before? > > On my way

Force ContentType id

2010-06-21 Thread donato.gr
I had to clean my application database from old models without losing data. So, I copied my tables to another db, dropped them, run syncdb and copied data back. But the app stopped working, because some tables used GenericRelations and still pointed to the old ContentType; so, I had to change that

escapejs inside {% trans %}

2010-06-21 Thread donato.gr
Hi, I had this code in a template file: alert('{% trans "a string" %}') It gave error when translated bacause the translated string had a ' inside. So, I replaced " with ' in the template line and all worked fine. To avoid any problem with 'escape chars', is there a way to escape translated strin

Re: escapejs inside {% trans %}

2010-06-21 Thread Tom Evans
On Mon, Jun 21, 2010 at 2:17 PM, donato.gr wrote: > Hi, > I had this code in a template file: > alert('{% trans "a string" %}') > > It gave error when translated bacause the translated string had a ' > inside. So, I replaced " with ' in the template line and all worked > fine. > > To avoid any pro

Re: Mysql-Python error

2010-06-21 Thread Eduan
Ok thanks. I've installed the setuptools but now i get another error. setup_windows.py", line 7, in get_config serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key']) WindowsError: [Error 2] The system cannot find the file specified Thanks for all your effort. Regards Ed

Re: outer join in orm

2010-06-21 Thread JeffH
To clarify: Each race has a set of questions. The candidate may have responded to none, some, or all. The answers are linked to the candidate (and to the question). For each candidate, I want to display all the questions, with or without answer. The way it works currently, only the questions with a

djapian not working with apach2

2010-06-21 Thread watad
hi all, im using djapian for my search , it seems to work fine when i run it in django development server but when i configure my sites to use apach2 im always getting this error when i try to search : "Caught OSError while rendering: [Errno 13] Permission denied: '/ index'" i am sure it is not a

Re: How much would you charge for this? £5k? £15k? £50k?

2010-06-21 Thread euan.godd...@googlemail.com
It sounds like your project is pretty fully featured and if you claim to be "inexperienced" in Django development this much work is pretty impressive on a part-time basis over 6 months! Currently the Django project I am working on has taken over 2.5 years (and is ongoing). Although we don't just d

Re: outer join in orm

2010-06-21 Thread Scott Gould
There may well be a better way to do this, especially since it's been a good year since I was struggling with this myself. (Very similar case to yours, different subject matter of course.) The way I ended up doing it was to use a template tag and some list comprehensions to whittle things down. E.

Price fixing (was Re: How much would you charge for this? £5k? £15k? £50k?)

2010-06-21 Thread Nick Arnett
On Mon, Jun 21, 2010 at 2:12 AM, ALJ wrote: > I'm just starting out with Django so using an hourly rate isn't really > applicable because I'm going to be much slower that a 'real' > developer. So far I've spent about 6 months part time. > > What kind of ballpark amounts would people suggest this

Re: outer join in orm

2010-06-21 Thread JeffH
That looks reasonable... but I wonder if the ORM can do it directly somehow. Anyone? On Jun 21, 10:14 am, Scott Gould wrote: > There may well be a better way to do this, especially since it's been > a good year since I was struggling with this myself. (Very similar > case to yours, different subj

optional ForeignKey

2010-06-21 Thread Magnus Valle
Hi, I'm trying to make model that has itself as a foreign key, in an attempt to store a reverse tree in Django. However, I can't find a way to set a default value to models.ForeignKey or make it optional. My model is like this: class Node(models.Model): name = models.CharField(max_length=100)

Re: optional ForeignKey

2010-06-21 Thread euan.godd...@googlemail.com
You want: parent = models.ForeignKey('self', null=True, blank=True) On Jun 21, 3:37 pm, Magnus Valle wrote: > Hi, > I'm trying to make model that has itself as a foreign key, in an > attempt to store a reverse tree in Django. > However, I can't find a way to set a default value to > models.Forei

Re: optional ForeignKey

2010-06-21 Thread Karen Tracey
On Mon, Jun 21, 2010 at 10:37 AM, Magnus Valle wrote: > Hi, > I'm trying to make model that has itself as a foreign key, in an > attempt to store a reverse tree in Django. > However, I can't find a way to set a default value to > models.ForeignKey or make it optional. > > My model is like this: >

File upload from python client to Django app

2010-06-21 Thread srn
Hello to all, I'm trying to do a POST from a python client to a Django webapp using urllib2 but I'm getting http 403 error. On the Django side I'm using a Form so I suspect the problem is {% csrf_token %} (csrf middleware enabled) which I can't provide from the client side. Is there other way to

Re: File upload from python client to Django app

2010-06-21 Thread euan.godd...@googlemail.com
urllib2 can handle cookies and therefore you should be able to handle the login. It will probably be a fair bit of work to get the client to submit the various parts, but I'm sure I've seen some examples around on how to do such a thing. Euan On Jun 21, 3:52 pm, srn wrote: > Hello to all, > > I'

Re: Price fixing (was Re: How much would you charge for this? £5k? £15k? £50k?)

2010-06-21 Thread Michael Schade
I'm no master of the law, I have a lawyer for that, but a quick read about price fixing seems to suggest that this is not that at all. Rather, price fixing is an agreement made so that competition in a market is lost by vendors agreeing upon a rate to sell a product or service for current and futur

Re: optional ForeignKey

2010-06-21 Thread Magnus Valle
Ah, OK, Thanks! I didn't know that blank and null are available for all field-types, I should have known. Thanks!! On Mon, Jun 21, 2010 at 15:41, Karen Tracey wrote: > On Mon, Jun 21, 2010 at 10:37 AM, Magnus Valle wrote: >> >> Hi, >> I'm trying to make model that has itself as a foreign key, i

Re: outer join in orm

2010-06-21 Thread backdoc
I hope you get an ORM answer, too. I'm a newbie following this thread and this sounds like the type of problem I have run into a couple of times already. On Mon, Jun 21, 2010 at 9:37 AM, JeffH wrote: > That looks reasonable... but I wonder if the ORM can do it directly > somehow. Anyone? > >

Re: outer join in orm

2010-06-21 Thread euan.godd...@googlemail.com
AFAIK there is no direct way to do this sort of thing in a single query. select_related will only get foreign key relations into the query so the ORM will always do an SQL query for each row in your many to many. In these types of situations I tend to select everything I need and then run some sort

Re: How much would you charge for this? £5k? £15k? £50k?

2010-06-21 Thread ALJ
Hi Euan, Cheers for that. It's my first Django project and I think in hindsight I should have started on something a little easier. Nevermind. It's been a good learning experience. Before they told me the spec, they said they thought it would cost about £3k! Cheers ALJ On Jun 21, 4:12 pm, "eua

Re: Actions after HttpResponse rendered?

2010-06-21 Thread DaNmarner
For one, I want to know if request_finished works here. On Jun 21, 3:39 am, Daniel Roseman wrote: > On Jun 21, 6:46 am, DaNmarner wrote: > > > There's a similar question as mine on stackoverflow.com: > > >http://stackoverflow.com/questions/1081340/how-do-you-do-something-af... > > > and there is

HOW TO? multiple sites, one virtual host, routing settings.py?

2010-06-21 Thread ringemup
I'll soon be deploying a project that will need to be able to dynamically add domains. Each domain will have different users, separate data, and a different SITE_ID, but will all run off a single Django instance. The data will all be housed in a single database, since all domains' data will need

ModelForm with ManyToManyField on the other side

2010-06-21 Thread Skylar Saveland
class Material(models.Model): products = ManyToManyField('Product', related_name='materials') class Products(models.Model): ... class ProductForm(forms.ModelForm): class Meta: model = Product fields = ('materials', ) I want to do this. I saw this discussion: http

Re: djapian not working with apach2

2010-06-21 Thread Skylar Saveland
I would guess that you are trying to access /index with the webserver user but that is owned by another user and the user that owns the web process has not the sufficient permissions to do the attempted operation. Set the permissions on the directory accordingly, perhaps ownership as well. You co

Running django-admin.py Commands without a Shell

2010-06-21 Thread maxweld
I am working with my virtual hosting provider to enable him support Django. I have used him for ages, and having converted myself to Django would like to help establish another hosting provider with support for Django. I have a configuration for his servers and virtual hosting environment that wor

How to map url **kwargs

2010-06-21 Thread Sells, Fred
First I'm new 2 django and have made rapid progress building my app based on the tutorial. As soon as I get it a little better, I'll clean it up and remove the "mysite/polls" references. I have a series of url's like this /mysite/myapp/datagrid/clients?letter=A /mysite/myapp/datagrid/reports /my

Re: djapian not working with apach2

2010-06-21 Thread Graham Dumpleton
On Jun 22, 12:03 am, watad wrote: > hi all, > > im using djapian for my search , it seems to work fine when i run it > in django development server > but when i configure my sites to use apach2 im always getting this > error when i try to search : > > "Caught OSError while rendering: [Errno 13]

Re: Force ContentType id

2010-06-21 Thread Russell Keith-Magee
On Mon, Jun 21, 2010 at 8:49 PM, donato.gr wrote: > I had to clean my application database from old models without losing > data. > So, I copied my tables to another db, dropped them, run syncdb and > copied data back. > But the app stopped working, because some tables used GenericRelations > and

Weekly rss feed

2010-06-21 Thread TheIvIaxx
Hello all, i tried searching for a solution to this but didn't find it. If it's answered somewhere, please point me in the right direction :) I was wondering how to create a weekly feed for django. Lets say i have a table of objects that gets added to all week long. I'd like to allow people to

Re: Running django-admin.py Commands without a Shell

2010-06-21 Thread Russell Keith-Magee
On Tue, Jun 22, 2010 at 4:08 AM, maxweld wrote: > I am working with my virtual hosting provider to enable him support > Django. I have used him for ages, and having converted myself to > Django would like to help establish another hosting provider with > support for Django. > > I have a configurat

Re: outer join in orm

2010-06-21 Thread JeffH
Doing a nested list comp has to be less efficient than an outer join done at the db level. For my issue, it's a relatively small data set, so I'd rather be more pythonic than eg running raw sql. Nonetheless, I view this as a weakness in Django's ORM, and would plead with TPTB to provide a solution,

Re: Weekly rss feed

2010-06-21 Thread Andy McKay
On 2010-06-21, at 5:48 PM, TheIvIaxx wrote: > I was wondering how to create a weekly feed for django. Lets say i > have a table of objects that gets added to all week long. I'd like to > allow people to subscribe to a feed that would give a single update > with all items that were added that wee

One to many django pagination

2010-06-21 Thread Jx
Hi, i recently encountered a problem due to inefficient performance of django pagination. After researching, i realized that there is a need to use django database queries when dealing with django-pagination as "LIMIT" will automatically be added. This is useful especially when dealing with huge c

Re: Weekly rss feed

2010-06-21 Thread TheIvIaxx
The problem with the first is that users would get a bunch of single items whenever they were added to the DB. I need to give them a digest of what happened that week. I had thought of the range idea, but then you're hitting the DB every hour all week for a single update which doesn't sound corre

Re: automatic documentation (docutils) does not pull in class methods?

2010-06-21 Thread pk
Answering my own question -- it is django.contrib.admindocs.view that limits the admindocs view to only list methods on a model that has a single argument. The lines: for func_name, func in model.__dict__.items(): if (inspect.isfunction(func) and len(inspect.getargspec(func) [0]) == 1)