Re: Can't access database with normal Ubuntu Terminal user

2012-04-17 Thread kenneth gonsalves
On Tue, 2012-04-17 at 14:50 +0800, Guillaume Chorn wrote: > FATAL: Peer authentication failed for user "postgres" suitably edit pg_hba.conf -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, se

Re: High Traffic

2012-04-17 Thread Phang Mulianto
I think this is just a bad practice in the app logic, or bad logic. you have only 9000records, what other languange out there will be process it faster anyway . if you have 1Mill records, do you will retreive all that object first and do the processing, and no caching at all . this will make eve

Re: Can't access database with normal Ubuntu Terminal user

2012-04-17 Thread Guillaume Chorn
Thanks for the input, but I think I'm going to need more help than this. I was able to find the pg_hba.conf file, but have no idea how to edit it. Can anyone help with this? Sorry, I'm pretty new to all of this (SQL, Linux, etc.) so I'm hoping someone can provide me fairly detailed instructions.

Re: Returning template data from a ManyToMany model

2012-04-17 Thread Phang Mulianto
On Tue, Apr 17, 2012 at 2:10 PM, LJ wrote: > I am having trouble figuring out how to query the database and return > the results in a format that my template can render appropriately. > I have a model that has a ManyToMany field: > > class Student() > ... > parents = models.ManyToManyFiel

Re: Dynamically generated models using exec. Is it too custly?

2012-04-17 Thread Philip Mountifield
Are you changing the definition of the function each time, or just effectively making duplicates of some common function under different names? You can do things like this: def make_funct(blah): def inner(): print blah return inner Then make a few of them with different names

Re: High Traffic

2012-04-17 Thread Tom Evans
On Mon, Apr 16, 2012 at 9:49 PM, Yarden Sachs wrote: > Sure, > > I experienced unknown performance issues(slow responses) when high traffic > would hit that site. > > so, started to test what happens if i hit the web site with a big > calculation, like len function on an 9k objects. > when i try t

Re: row level permissions - why?

2012-04-17 Thread bruno desthuilliers
On Apr 17, 8:07 am, Mike wrote: > In my app I need a way to associate objects with a specific user.  Users > should not have access to other users objects. I'm implementing this in my > model by setting a ForeignKey to the user that owns the object: > > owner = models.ForeignKey(User) > > Is this

Re: Returning template data from a ManyToMany model

2012-04-17 Thread Daniel Roseman
On Tuesday, 17 April 2012 07:10:35 UTC+1, LJ wrote: > > I am having trouble figuring out how to query the database and return > the results in a format that my template can render appropriately. > I have a model that has a ManyToMany field: > > class Student() > ... > parents = model

Re: Admin site not working

2012-04-17 Thread mohamed elsebaey
Dear andrea thanks for your reply i'd ran the syncdb many times with no effect ,but i found the problem, there is no records in site table. with the following script the problem was fixed from django.contrib.sites.models import Site Site.objects.create(pk=1, domain='mdev.5buckchuck.com', name='5bu

Re: row level permissions - why?

2012-04-17 Thread Mike
One problem I see is that if User 1 somehow obtains a url to a view that displays an object owned by User 2. User 1 will be able to view User 2's object. I'll have to write code in every view function that displays user-owned data to make sure that the user actually has permission to view it.

Re: row level permissions - why?

2012-04-17 Thread Tom Evans
On Tue, Apr 17, 2012 at 12:42 PM, Mike wrote: > One problem I see is that if User 1 somehow obtains a url to a view that > displays an object owned by User 2.  User 1 will be able to view User 2's > object.  I'll have to write code in every view function that displays > user-owned data to make sur

Help - ImportError: No module named django.core.management

2012-04-17 Thread Michael Lewis
Hi everyone, I've seen a lot of info regarding this error, but I can't seem to find anything that solves my problem. I am starting my first project - "Writing your first Django app, part 1". I've downloaded Django and can see that it's installed by running "import django". I then move on to this s

Is there such a open source django project?

2012-04-17 Thread James Deng
Hi all, I have a case to manage my staff for customer support, basically I need a time based schedule table. the point is that we need to know WHO at WHEN should take care of WHICH customer, we should be able to input a bunch of support schedule, and get a simple view of it. So my question is

Re: Is there such a open source django project?

2012-04-17 Thread Marcos Moyano
If there is, this is a good place to look for it: http://djangopackages.com/ Marcos On Tue, Apr 17, 2012 at 7:12 AM, James Deng wrote: > Hi all, > > I have a case to manage my staff for customer support, basically I need a > time based schedule table. the point is that we need to know WHO at WH

Re: Can't access database with normal Ubuntu Terminal user

2012-04-17 Thread kenneth gonsalves
On Tue, 2012-04-17 at 15:45 +0800, Guillaume Chorn wrote: > Thanks for the input, but I think I'm going to need more help than > this. I > was able to find the pg_hba.conf file, but have no idea how to edit > it. > Can anyone help with this? > > look at the last few lines - change the authentic

Re: Is there such a open source django project?

2012-04-17 Thread Timothy Makobu
Or just use a ticketing system like Mantis On Tue, Apr 17, 2012 at 3:29 PM, Marcos Moyano wrote: > If there is, this is a good place to look for it: > http://djangopackages.com/ > > Marcos > > > On Tue, Apr 17, 2012 at 7:12 AM, James Deng wrote: > >> Hi all, >> >> I h

Re: Is there such a open source django project?

2012-04-17 Thread development
hello James, your options are: 1) find such a django-app. 2) develop it on your own. 3) if you are not depending on web-browsers -> you are looking for a kind of resource planner - as you are python related - you could check out http://www.tryton.org/ ERP system. -> its open source - easy to use,

Re: Dynamically generated models using exec. Is it too custly?

2012-04-17 Thread Arruda
yes, I see, but how can I measure this? Do you know the function that is used? Thanks for the help. Em terça-feira, 17 de abril de 2012 05h39min24s UTC-3, Philip escreveu: > > Are you changing the definition of the function each time, or just > effectively making duplicates of some common func

Re: Dynamically generated models using exec. Is it too custly?

2012-04-17 Thread Philip Mountifield
You probably want the profile module from the standard library. This will tell you all sorts of useful things about how much time functions are taking and how many times they are called etc... http://docs.python.org/library/profile.html#module-profile Regards Phil On 17/04/2012 13:48, Arruda

Django 1.4, Postgresql and partitioned table

2012-04-17 Thread Michaël Journo
Hello, I use postgresql 9.1 with postgresql_psycopg2 on debian (actually this also happens on my mac). I recently moved to django 1.4 and I got this error while creating a simple object : o = Object() o.fieldA = .. o.save() Traceback (most recent call last): File "", line 1, in File "/op

Re: Dynamically generated models using exec. Is it too custly?

2012-04-17 Thread Arruda
Nice, I'll test things out. Em terça-feira, 17 de abril de 2012 10h04min05s UTC-3, Philip escreveu: > > You probably want the profile module from the standard library. This will > tell you all sorts of useful things about how much time functions are > taking and how many times they are called e

Re: High Traffic

2012-04-17 Thread Javier Guerra Giraldez
On Mon, Apr 16, 2012 at 3:59 PM, Yarden Sachs wrote: > it took 20 times more for EACH request. that means that if 20 users accross > the web ask for differrent heavy data- instead of taking a second for each > one, every user will wait for 20 seconds before the response will answer. so the total

admin - how to change choices in inlines?

2012-04-17 Thread galgal
How can I change choices of a field in Inlines class? I can't use formfield_for_choice_field in Inlines, so what to use? I must generate it in admin, because I need request to be passed. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view t

external css and javascript files

2012-04-17 Thread dummyman dummyman
How to include external css and javascript files in django ? I tried many forums,django docs Couldnt get a solution Could u pl give me a step by step proc to include external css and javascript files ? -- You received this message because you are subscribed to the Google Groups "Django users" g

Django + Windows Server 2003 + IIS6 + MSSQL 2005

2012-04-17 Thread Enrique Juan de Dios
Hello Everyone, Please I need tips and common errors to this environment: Django 1.3 + Windows Server 2003 + IIS6 + MSSQL 2005 I found this project: https://code.djangoproject.com/wiki/DjangoOnWindowsWithIISAndSQLServer Have anyone tested this project? What is the best way to install to setup a

Re: external css and javascript files

2012-04-17 Thread Eugenio Minardi
Hi, you can find a detailed guide here https://docs.djangoproject.com/en/dev/howto/static-files/ On Tue, Apr 17, 2012 at 4:18 PM, dummyman dummyman wrote: > How to include external css and javascript files in django ? I tried many > forums,django docs > Couldnt get a solution > Could u pl give

Re: Django + Windows Server 2003 + IIS6 + MSSQL 2005

2012-04-17 Thread Leandro Ostera Villalva
Is there a real need for using Windows Server, IIS or MSSQL? I have had really bad experiences with MS stuff in general. On Tue, Apr 17, 2012 at 11:35 AM, Enrique Juan de Dios wrote: > Hello Everyone, > Please I need tips and common errors to this environment: > Django 1.3 + Windows Server 2003

Re: Django + Windows Server 2003 + IIS6 + MSSQL 2005

2012-04-17 Thread George Silva
If you are tied up to the Windows platform (not that it is bad, it does some good stuff, actually, it's just different) I suggest that you consider using other solution stack. If it's a must that Django + IIS + SqlServer, then you will need to sweat and work a lot to get your project running. The

Re: Is there such a open source django project?

2012-04-17 Thread Lee Hinde
On Tue, Apr 17, 2012 at 3:12 AM, James Deng wrote: > Hi all, > > I have a case to manage my staff for customer support, basically I need a > time based schedule table. the point is that we need to know WHO at WHEN > should take care of WHICH customer, we should be able to input a bunch of > suppo

Re: external css and javascript files

2012-04-17 Thread dummyman dummyman
hi, i tried it before but didnt get d required results. On Tue, Apr 17, 2012 at 8:16 PM, Eugenio Minardi wrote: > Hi, > > you can find a detailed guide here > https://docs.djangoproject.com/en/dev/howto/static-files/ > > On Tue, Apr 17, 2012 at 4:18 PM, dummyman dummyman wrote: > >> How to incl

Re: Help - ImportError: No module named django.core.management

2012-04-17 Thread Bill Freeman
Is there any chance that there is more than one python hanging around? For instance, a root python, and a virtualenv made with --no-site-packages (in newer virtualenv installs this is the default). Or try adding the following to your manage.py (just before the line in there that is in the stacktr

Re: external css and javascript files

2012-04-17 Thread Joel Goldstick
On Tue, Apr 17, 2012 at 11:53 AM, dummyman dummyman wrote: > hi, > > i tried it before  but didnt get d required results. > > On Tue, Apr 17, 2012 at 8:16 PM, Eugenio Minardi > wrote: >> >> Hi, >> >> you can find a detailed guide >> here https://docs.djangoproject.com/en/dev/howto/static-files/ >

Re: external css and javascript files

2012-04-17 Thread dummyman dummyman
Hi attached is the settings.py and i ve placed my css files in static directory of the app and in templates i ve given the path {{ STATIC_URL }} path On Tue, Apr 17, 2012 at 10:13 PM, Joel Goldstick wrote: > On Tue, Apr 17, 2012 at 11:53 AM, dummyman dummyman > wrote: > > hi, > > > > i tried it

Re: external css and javascript files

2012-04-17 Thread Joel Goldstick
On Tue, Apr 17, 2012 at 12:50 PM, dummyman dummyman wrote: > > Hi > > attached is the settings.py and i ve placed my css files in static directory > of the app and in templates i ve given the path > > {{ STATIC_URL }} path > > On Tue, Apr 17, 2012 at 10:13 PM, Joel Goldstick > wrote: >> >> On Tue

Re: external css and javascript files

2012-04-17 Thread dummyman dummyman
thank u will try and will get back if i have further doubts On Tue, Apr 17, 2012 at 10:36 PM, Joel Goldstick wrote: > On Tue, Apr 17, 2012 at 12:50 PM, dummyman dummyman > wrote: > > > > Hi > > > > attached is the settings.py and i ve placed my css files in static > directory > > of the app and

PRG with View classes

2012-04-17 Thread dmitry b
hi, Is there out of the box support for the PRG pattern with Django's new class-based views? If not, what's a good/preferred way of implementing one? Thanks D. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the w

Re: Help - ImportError: No module named django.core.management

2012-04-17 Thread Gerald Klein
I had to use prompts with python2 because I have 3.2 installed also. On Tue, Apr 17, 2012 at 11:35 AM, Bill Freeman wrote: > Is there any chance that there is more than one python hanging around? > For instance, a root python, and a virtualenv made with > --no-site-packages (in newer virtualenv

Re: Django 1.4, Postgresql and partitioned table

2012-04-17 Thread akaariai
The problem seems to be that INSERT INTO partitioned_table values(...) RETURNING ID isn't for some reason returning the ID. Can you confirm this is the case by running the insert query manually from dbshell? I believe 1.3 used SELECT currval(pg_get_serial_sequence('partitioned_table', 'id')) inste

ModelForm Validation Error

2012-04-17 Thread coded kid
I want to make sure users fill all the fields before they are redirected to the next page. And if they don’t fill the fields it should raise an error telling them to fill the fields before they proceed. So to do that, I wrote the codes below. But the problem I’m facing is that when I didn’t fill th

Re: ModelForm Validation Error

2012-04-17 Thread Mario Gudelj
Indent that redirect one more time so that it's wothin the if loop and you're redirected to good only when the form is valid On 18/04/2012 5:07 AM, "coded kid" wrote: > I want to make sure users fill all the fields before they are > redirected to the next page. And if they don’t fill the fields

PicklingError: Can't pickle : it's not the same object as pytz._UTC

2012-04-17 Thread fuxter fuxter
Hello all, Did anybody encounter the error above after upgrading to 1.4 and switching to timezones? Some pages start 500 randomly, really randomly. I've tried switching to pickle from cPickle. I've tried changing pickle protocols in the memcached module. I've tried pylibmc. All the same. As a h

Re: Is there such a open source django project?

2012-04-17 Thread Mario Gudelj
There is an app called django-helpdesk. Can't lookup the link for you but you should be able to google it On 18/04/2012 1:18 AM, "Lee Hinde" wrote: > On Tue, Apr 17, 2012 at 3:12 AM, James Deng wrote: > >> Hi all, >> >> I have a case to manage my staff for customer support, basically I need a >

Anyone using a javascript MVC on top of Django?

2012-04-17 Thread br
We have an extremely javascript & ajax heavy application. To put it one way, we have blatently disregarded graceful degradation in order to build the type of application we want to build. We're finding that as the thing grows, the interactions between the front end javascript and django are becom

Re: [Question] Filter Queryset in a Template

2012-04-17 Thread Nikhil Somaru
Thanks for the replies guys. I realised I was over thinking the matter. I'm just going to do the necessary work in the view for now, get it *working*, and then worry about optimising later. On 16 April 2012 19:16, Javier Guerra Giraldez wrote: > On Mon, Apr 16, 2012 at 6:00 AM, Nikhil Somaru w

Re: basci question about queryset for retrieving top element

2012-04-17 Thread NENAD CIKIC
OK, thanks Always learning. What I miss from my other programming is MSDN like style of help pages. I tend more and more to use the django pdf documentation because I can't get used to the web interface for this. On 17 Apr, 07:42, HarpB wrote: > Both patterns will produce same query. You can al

application startup signal

2012-04-17 Thread Josh J
Hi, What is the way to add a listener to receive an event notification when a django application starts? There is a ticket, though it is not clear what the actual solution or usage is https://code.djangoproject.com/ticket/13024 regards, Josh -- You received this message because you are subscri

Re: basci question about queryset for retrieving top element

2012-04-17 Thread HarpB
Like this http://readthedocs.org/docs/django/en/latest/py-modindex.html?highlight=django or perhaps this http://djangoapi.quamquam.org/trunk/ ? There is also a great book: http://www.djangobook.com/en/2.0/ -- You received this message because you are subscribed to the Google Groups "Django us

Re: basci question about queryset for retrieving top element

2012-04-17 Thread NENAD CIKIC
Thanks, I will check On 18 Apr, 04:34, HarpB wrote: > Like > thishttp://readthedocs.org/docs/django/en/latest/py-modindex.html?highlig... > or perhaps thishttp://djangoapi.quamquam.org/trunk/? > > There is also a great book:http://www.djangobook.com/en/2.0/ -- You received this message because

Re: Can't access database with normal Ubuntu Terminal user

2012-04-17 Thread kenneth gonsalves
On Tue, 2012-04-17 at 15:45 +0800, Guillaume Chorn wrote: > Thanks for the input, but I think I'm going to need more help than > this. I > was able to find the pg_hba.conf file, but have no idea how to edit > it. > Can anyone help with this? > > look at the last few lines - change the authentic

Extending the user profile. Admin creation

2012-04-17 Thread abisson
Good evening, Here is my situation: 1. I extended the user profile in order to add custom fields. 2. I added the model to the User Admin Model, so when I am adding a user, I can fill in directly the fields to create the profile. 3. Now, if I don't add ANYTHING in these new custom us

Re: Anyone using a javascript MVC on top of Django?

2012-04-17 Thread Piotr Zalewa
We use a very new framework called Shipyard https://github.com/seanmonstar/shipyard at Mozilla to build http://builder.addons.mozilla.org/. The goal is to have a nice framework working well with Django. MooTools style (classes etc.). A lot of requests on dev site, one file per project on produ