Re: apache ok (mod_wsgi) bue some issue with admin backend

2009-08-05 Thread Salvatore Leone
Graham Dumpleton ha scritto: > > > The mod_python documentation is not really appropriate for explaining > how static files are hosted when using mod_wsgi as mod_wsgi handles it > differently. Instead see documentation on mod_wsgi site. > > http://code.google.com/p/modwsgi/wiki/IntegrationWithDj

apache ok (mod_wsgi) bue some issue with admin backend

2009-08-05 Thread Salvatore Leone
Hello again... I have my site working with mod_wsgi, but I still have some problem using the admin interface and managing uploaded files. On the admin side all static files aren't loaded. So there is no css and you can imagine the way I see the admin pages... I also have some problem serving

Re: apache

2009-08-05 Thread Salvatore Leone
Graham Dumpleton ha scritto: > You must recompile mod_python to use a different Python version. > Changing the symlink like that will not make a difference and you > could break other stuff on your system which assumed default Python is > a specific version. > > I know, and I didn't do it(I'm o

Re: apache

2009-08-04 Thread Salvatore Leone
> chmod -R 777 /home/testpec/public_html/pecwizard > > I think you were right! but now I've got an error due to mod_python using python2.6 insteal fo 2.5: ImproperlyConfigured: Error loading MySQLdb module: No module named sets I've always had this error with the manage.py until I run it

Re: apache

2009-08-04 Thread Salvatore Leone
Graham Dumpleton ha scritto: > > On Aug 4, 8:42 pm, Salvatore Leone > wrote: > >> Hi, >> >> I'm trying to move my site from the developemente server to Apache but I >> always obtain this error: >> >> ImportError: Could not import settings

apache

2009-08-04 Thread Salvatore Leone
Hi, I'm trying to move my site from the developemente server to Apache but I always obtain this error: ImportError: Could not import settings 'pecwizard.settings' (Is it on sys.path? Does it have syntax errors?): No module named pecwizard.settings and here is my apache configuration:

[solved] processing html arrays

2009-07-31 Thread Salvatore Leone
Salvatore Leone ha scritto: > Hi, > > I've a form with a html array. How can I process this array in my view > after the submit? > > I'm pretty sure the html code is correct because I can manage the array > with a php script... so there must be a way to

processing html arrays

2009-07-31 Thread Salvatore Leone
Hi, I've a form with a html array. How can I process this array in my view after the submit? I'm pretty sure the html code is correct because I can manage the array with a php script... so there must be a way to do it in python. -Salvatore --~--~-~--~~~---~--~

dynamic form

2009-07-31 Thread Salvatore Leone
Hi, I've got a form with various information and a file upload widget. Is there a way to uploads many files at the same time? So to have a link "add file" (and even "remove" file for already selected files). A possible way is to use some ajax framework (like jquery). So my questin is: do I h

MEDIA_URL MEDIA_ROOT

2009-07-30 Thread Salvatore Leone
Hi again, I have configured MEDIA_ROOT = '/home/testpec/public_html/pecwizard/uploads/' and the file uploads works fine, so in the 'uploads' directory there are all my uploaded files. Two questions: 1. in models.py I have the following: class Attach(models.Model): attached_file = models.F

[SOLVED]Re: dictionaries in template

2009-07-30 Thread Salvatore Leone
> {% for answer,value in answers_list.items %} > > it works, thanks! -Salvatore --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-u

dictionaries in template

2009-07-30 Thread Salvatore Leone
Hi, I pass to my template a dictionary of answer -> [attach_list] so the data structure is answers_list[answer] = attach_list Inside the template I actually can read the answers: {% for answer in answers_list.keys %} #use the answer object # answer_list.answer returns a attach list

[solved]Re: file upload issue

2009-07-29 Thread Salvatore Leone
Again I found the answer... I forgot to put enctype="multipart/form-data" in my form... sorry for disturbing you. -S Salvatore Leone ha scritto: > Hello again, > > I know this is probably an already discussed question, but I can't get > out of this. I've got

file upload issue

2009-07-29 Thread Salvatore Leone
Hello again, I know this is probably an already discussed question, but I can't get out of this. I've got a form which may or may not send a file, here is the snippet of my view function: if request.method == POST: #process the form ... if request.FILES: att

Re: [solved]Re: test if GET is "empty"

2009-07-29 Thread Salvatore Leone
> Given the way boolean tests go in Python, you should just be able to > test for the dictionary itself: > > if request.GET: > > else: > > > E > mmm I don't think so, I think request.GET is true even if the dictionary is empty, isn't it? so the test will allways return tru

[solved]Re: test if GET is "empty"

2009-07-29 Thread Salvatore Leone
I answer my self: all I need is to test the length of the dictionary. if request.method == "GET" and len(request.GET) != 0: #do stuff > Hello, > > I need to test if the request.GET is empty or if it holds some variable. > So if is empty I can redirect to a page, and if there is some variable

test if GET is "empty"

2009-07-29 Thread Salvatore Leone
Hello, I need to test if the request.GET is empty or if it holds some variable. So if is empty I can redirect to a page, and if there is some variable (like user_id='2') I can process the request and do something with theese variables. Is there any way or do I have to test for every single v

iterating through user.groups

2009-07-27 Thread Salvatore Leone
Hi, anyone knows why this code: {% for group in user.groups%} {{group.name}} {%endfor%} raise this exception: "Caught an exception while rendering: 'ManyRelatedManager' object is not iterable" The same if I put the code inside my view (for group in user.groups:) any idea?

form and hidden input with user id

2009-07-27 Thread Salvatore Leone
Hello, I'm building an application with a simple form for asking questions to the site's administrators. I created the form using the ModelForm object. Every Question object has a text and an author_id, which is the id of the user currently logged in. Automagically generating the form is good