Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-25 Thread Graham Dumpleton
On May 26, 12:03 pm, Kenneth Gonsalves wrote: > On Wednesday 26 May 2010 03:52:16 Chris Seberino wrote: > > > I tried adding paths to sys.path in the wsgi file. > > you need to add the path to the *parent* directory of your project, and your > project should have __init__.py

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-25 Thread Kenneth Gonsalves
On Wednesday 26 May 2010 03:52:16 Chris Seberino wrote: > I tried adding paths to sys.path in the wsgi file. > you need to add the path to the *parent* directory of your project, and your project should have __init__.py in every folder where there are python files -- Regards Kenneth Gonsalves

Re: Turning "DEPUG=False" results in missing CSS

2010-05-25 Thread Brian Neal
On May 25, 2:51 pm, tom wrote: > Hi, > > I have currently built a website with Django. After developing > everything locally with "python manage.py runserver", I have switched > for testing to Apache and mod_python. > > Everything worked fine there as well. All pages

templatetag processing order

2010-05-25 Thread Jason Persampieri
(cross-posted to StackOverflow) I am trying to write a set of template tags that allow you to easily specify js and css files from within the template files themselves. Something along the lines of {% requires global.css %}, and later in the request, {% get_required_css %}. I have this mostly

mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-25 Thread Chris Seberino
I can successfully run a toy WSGI app with my Apache/mod_wsgi set up. When I try to run my Django app with mod_wsgi it can't ever find the modules to load and Apache's error.log gives ImportError's. I tried adding paths to sys.path in the wsgi file. Not what else to try. cs -- You received

Re: Resize uploaded file file with PIL

2010-05-25 Thread Gonzalo Delgado
El 25/05/10 19:12, Igor Rubinovich escribió: > I want to resize the uploaded file before saving a form. I'd like to > do something like > > img = request.FILES['image'] > img.thumbnail( (200,200), Image.ANTIALIAS) > img.save(request.FILES['image'], "JPG") > > photo_form =

Resize uploaded file file with PIL

2010-05-25 Thread Igor Rubinovich
Hi, I want to resize the uploaded file before saving a form. I'd like to do something like img = request.FILES['image'] img.thumbnail( (200,200), Image.ANTIALIAS) img.save(request.FILES['image'], "JPG") photo_form = forms.PhotoEditForm(request.POST, request.FILES, instance=photo)

EmailField etc. and VARCHAR / TEXT

2010-05-25 Thread Jonathan Hayward
For CharField, EmailField, URLField, etc., is VARCHAR implementation (meaning a fixed limit on length) absolutely non-negotiable, or there a way to make e.g. a CharField that won't truncate if you cross some arbitrary length? (If you don't specify a length, does it assign a default length, or use

Re: multi table inheritance ordering bug in postgreSQL backend?

2010-05-25 Thread gentlestone
seems to be there was no problem with postrgeSQL backend the reason was multiple model inheritance - first ancestor with ordering, second whitout ... was interpreted randomly in model query maybe helps to someone ... On May 24, 9:08 pm, gentlestone wrote: > class

ModelForm gives invalid option.

2010-05-25 Thread Joshua Frankenstein Lutes
I have a Model that looks something like this: == class Turtle(models.Model): turtle_type = models.IntegerField(null=False, blank=False, choices=TURTLE_TYPES) == I use it to create a ModelForm:

Turning "DEPUG=False" results in missing CSS

2010-05-25 Thread tom
Hi, I have currently built a website with Django. After developing everything locally with "python manage.py runserver", I have switched for testing to Apache and mod_python. Everything worked fine there as well. All pages are rendered correctly (PS: For the layouting, I use 3 CSS files). Now,

Email Backend setting needed, a potential bug

2010-05-25 Thread Lakshman Prasad
Hi, Since I upgraded to 1.1.2, I am unable to send mails as django seems expecting a EMAIL_BACKEND. I tried to simply downgrade back to 1.1.1 not having to bother, but the error continues. I seems like a bug, but I don't know how it can be one, because, I cant see how sending email can go

XML serialize - sql cursor

2010-05-25 Thread Bruno Galindro da Costa
Hi all, I need to serialize in XML, through django.core.serializers class, the result of the function bellow. Is it possible? If not, how can I execute the query bellow through Django´s API? *MY FUNCTION:* def select_site_sql(): cursor = connection.cursor() cursor.execute("""select

Re: Post and Comment with the same Model.

2010-05-25 Thread Scott Gould
>From your description thus far I'd probably try to use django.contrib.comments and be done with it. Build the specific models you need for your app, but don't reinvent the wheel when there's a perfectly good generic commenting app out there already. On May 25, 12:01 pm, nameless

Re: Post and Comment with the same Model.

2010-05-25 Thread nameless
mmm so I could use Post model with a foreign key to blog and a Comment model with a generic foreign key ( because I could comment post, images, videos, ecc ). Is this a wrong ? What is the better solution in your opinion ? Thanks ^_^ - On 25 Mag, 13:32, Tom Evans

testing the comment framework using the test client

2010-05-25 Thread Thierry
How do you guys test implementations of the django comment framework? A regular post doesnt seem to work because it depends on data from a previous get. An thoughts? def test_comment(self): item_url = reverse('item', args=['4558']) self.client.login(username=self.username,

Re: ordering inside regroup

2010-05-25 Thread maciekjbl
I just refer to : "Regroup can't do that alone" by zinckiwi. Maybe regroup in this situation is useless I don't know this. If not regroup then what ? Any ideas ? On 25 Maj, 14:30, Scott Gould wrote: > On May 25, 3:57 am, maciekjbl wrote: > > > Thank

Re: Security Question...

2010-05-25 Thread ringemup
Ah, I see what you mean about sending things in plaintext over SSL. You're right, that would be a lot simpler. That said, I think I can handle the API keys with one model plus less than a dozen lines of verification code, so it's not a huge burden. I just don't have a whole lot of experience

Grouping of applications in admin

2010-05-25 Thread Dejan Noveski
Hello, Is there a way i can group admin models from different applications to show in one container in admin initial page? Thanks, Dejan -- -- Dejan Noveski Web Developer dr.m...@gmail.com Twitter: http://twitter.com/dekomote | LinkedIn: http://mk.linkedin.com/in/dejannoveski -- You received

Re: Running all the tests of a clean Django 1.1.1 installation on my machine shows many internal django errors

2010-05-25 Thread Sebastian Sanitz
I am sorry - this problem was already adressed: http://code.djangoproject.com/changeset/11821 I upgraded to Django 1.1.2 and everything is fine! On Tue, May 25, 2010 at 4:29 PM, Sebastian wrote: > Hello, running all the tests of a clean Django 1.1.1 installation on > my

Running all the tests of a clean Django 1.1.1 installation on my machine shows many internal django errors

2010-05-25 Thread Sebastian
Hello, running all the tests of a clean Django 1.1.1 installation on my machine shows many internal django errors. You can see the complete output and stacktraces here: http://gist.github.com/411942 Any idea? -- You received this message because you are subscribed to the Google Groups "Django

Re: Unicode Error when Saving Django Model

2010-05-25 Thread vjimw
Thanks. It was actually a combination of issues. The database was UTF8, I should have added to my original post that I could manually insert and retrieve UTF8 data. The data we are pulling (migrating one system to a new one, built on django) is a bit of a nest of encoding issues. So things that

Re: Security Question...

2010-05-25 Thread Alex Robbins
Yeah, I understand that the data doesn't need to be encrypted. I just agree with you that SSL would be ideal. If you had SSL, then I don't think you'd need to work as hard with the public/private key hashing stuff. If all the transmitted data was encrypted (SSL) you could just send a clear-text

Re: Security Question...

2010-05-25 Thread ringemup
By app-level solution you mean some sort of custom encryption / decryption scheme for the data dictionaries? I'm still not convinced the data needs encryption -- I mean, it wouldn't hurt and in an ideal world I'd just push everything over SSL, but the worst thing that happens if someone gets

Re: Security Question...

2010-05-25 Thread Alex Robbins
It might be worth a try to see if the self-signed cert gets you into trouble or not. Some url libraries might complain about it, but I don't think that the behavior is universal. As I think about it, I think it is normally browsers that whine about self-signed certs. Maybe the other server

QuerySet for view from RawQuerySet (lacks _clone), or select_related with M2M?

2010-05-25 Thread Jeff Kowalczyk
I am trying to use a raw sql query in a model manager method. RawQuerySet lacks method _clone, is there a recommended way to return a normal QuerySet for views to consume? The models are included below. If there is a way to get the Django ORM to make the M2M join via select_related and extra, I'd

Re: view permission on django admin

2010-05-25 Thread Alex Robbins
If you want something like the admin, that lets users view objects from the database but not edit them, you could check out the databrowse contrib app. It is kind of a read-only admin. http://docs.djangoproject.com/en/dev/ref/contrib/databrowse/ Hope that helps, Alex On May 24, 3:49 pm, rahul

Re: ordering inside regroup

2010-05-25 Thread Scott Gould
On May 25, 3:57 am, maciekjbl wrote: > Thank you, for your answer. > > I didn't have time to check this because of flood in my company. > > I thought that 'regroup' can't be order by any other sorting beside > it's own. > > So I have to order it right and then use 'regroup'

Re: Post and Comment with the same Model.

2010-05-25 Thread Tom Evans
On Tue, May 25, 2010 at 12:20 PM, nameless wrote: > Generic field because on my project you can post and comment in Blogs, > Gallery pages, Foto pages, video pages, ecc. > So I want to use my Post_comment models for post and comment > anythings. > Is this a wrong solution ?

An unhandled exception was thrown by the application.

2010-05-25 Thread mohammadmonther
0 Hello I've created my new site using DjANGO AT FIRST Everything is okay startapp,syncdb..Etc but the problems its this massage Unhandled Exception An unhandled exception was thrown by the application. you can see http://www.daqiqten.com/ this is my index.fsgi and .htacces index.fcgi

Re: Post and Comment with the same Model.

2010-05-25 Thread nameless
Generic field because on my project you can post and comment in Blogs, Gallery pages, Foto pages, video pages, ecc. So I want to use my Post_comment models for post and comment anythings. Is this a wrong solution ? Are there problems with the performances ? Thanks ;) On 25 Mag, 12:19,

MongoDB backend for Django-nonrel

2010-05-25 Thread Waldemar Kornewald
Hi everyone, now there's a MongoDB backend for Django-nonrel. With that backend you can write your DB code with Django's model layer (from django.db import models). A more detailed explanation can be found here:

Re: Post and Comment with the same Model.

2010-05-25 Thread Scott Gould
Presumably you want the same object to be able to be a comment on someone else's post as well as a post in it's own right, that others could comment on? Looks straightforward enough, though I can't see why you'd need the generic fields in the model. Regards Scott On May 25, 5:54 am, nameless

Re: rendering to template help

2010-05-25 Thread Daniel Roseman
On May 25, 10:30 am, Pirate Pete wrote: > sorry for this one last question, > > do you have any idea how i would go about rounding these values and > converting them from numbers to *'s ? > > i tried using the round() function on the annotation however it kept > giving

Post and Comment with the same Model.

2010-05-25 Thread nameless
I have created a simple project where everyone can create one or more Blog. I want to use this models for Post and for Comment: class Post_comment(models.Model): content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField(_('object ID')) content_object =

Re: rendering to template help

2010-05-25 Thread Pirate Pete
sorry for this one last question, do you have any idea how i would go about rounding these values and converting them from numbers to *'s ? i tried using the round() function on the annotation however it kept giving me a type error "a float is required." cheers On May 25, 7:10 pm, Daniel

Re: rendering to template help

2010-05-25 Thread Pirate Pete
You sir have saved me many a headache, i can't honestly thank you enough All the best! On May 25, 7:10 pm, Daniel Roseman wrote: > On May 25, 9:52 am, Pirate Pete wrote: > > > Thank you very very much for your reply. > > > There is still a few

Re: rendering to template help

2010-05-25 Thread Daniel Roseman
On May 25, 9:52 am, Pirate Pete wrote: > Thank you very very much for your reply. > > There is still a few things i need to grasp. > > Firstly, why did you do this : > annotate(rating_count=Count('rating')).annotate(rating_avg=Avg('rating__rat > ing')) > as opposed to

Re: rendering to template help

2010-05-25 Thread Pirate Pete
Thank you very very much for your reply. There is still a few things i need to grasp. Firstly, why did you do this : annotate(rating_count=Count('rating')).annotate(rating_avg=Avg('rating__rating')) as opposed to annotate(rating_count=Count('rating'), rating_avg=Avg('rating__rating')) Secondly,

A question about form inheritance and form media as a dynamic property

2010-05-25 Thread Vasil Vangelovski
I have a form class, call it MyBaseForm which defines some media as a dynamic property (by providing a media property, not defining a Media class). Then I have MyForm which inherits from MyBaseForm and overrides some widgets on it's fields, these widgets have their own media definitions. The

Re: rendering to template help

2010-05-25 Thread Daniel Roseman
On May 25, 6:09 am, Pirate Pete wrote: > I have been trying to get some kind of kind response from django for a > few days now and it has been very unkind to me :P > > basically i need to create a page that has a video title (link) and an > average rating with the amount

Re: ordering inside regroup

2010-05-25 Thread maciekjbl
Thank you, for your answer. I didn't have time to check this because of flood in my company. I thought that 'regroup' can't be order by any other sorting beside it's own. So I have to order it right and then use 'regroup' or 'regroup' then ordering, this is what I don't get. On 17 Maj, 16:55,

Admin ModelMultipleChoiceField does not keep order

2010-05-25 Thread Eric
Hi, I'm using a ModelMutlipleChoiceField for a comma separated field and the list of selected object does not respect order of the html field. After several hours of tracing, understanding how it all work, I discovered that the raw data of the field(widget) has the right order but that