Problem with broken link emails
Hi! I have a problem with email-reports of "Broken INTERNAL link" that doesn't seem correct. For example this one: Referrer: http://www.teamxstream.se/ Requested URL: /star_empty.gif When I access the referrer page, I get no error message myself and in the source there are only occurrences of "star_empty.gif" like this: I've had many similar issues that just seem wrong. I'm running Ubuntu with Apache 2.2, PostgreSQL 8.1 and Django development version. All help appreciated! /Henrik --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Setting up psycopg2
Thanks for the tip Brian! I checked with pg_config --configure and found out that Postgresql was indeed built with "enable-thread- safety". (I had to install libpq-dev with apt-get to get the pg_config-command) About psycopg, on this site: http://www.initd.org/tracker/psycopg it says that you're supposed to use psycopg2, and when I search the apt packages I can only find psycopg version 1.1.21. That is why I've chosen to install psycopg2 from source. About the note "make sure that your libpq has been compiled with the -- with-thread-safety option", would that be the same as saying that "make sure that postgresql has been compiled with tread-safety"? sincerely /Henrik On 28 Apr, 00:39, Brian Luft <[EMAIL PROTECTED]> wrote: > Well I'm checking against Debian here at work and can check my Ubuntu > installation at home later, but running pg_config shows that postgres > was built with the "enable-thread-safety" option - (not sure if that > is a different option or if the psycopg docs are incorrect). I would > assume the same for the version in the Ubuntu repos. Of course you > can always verify yourself by running "pg_config" > > Also, any reason you're building psycopg from source rather than using > the apt package? > > Cheers > -Brian > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Setting up psycopg2
Hi! I want to install psycopg2 on Ubuntu Dapper 6.06.1. I'm wondering about a note in a file called INSTALL in the psycopg2-source. It says: """ Important note: if you plan to use psycopg2 in a multithreaded application make sure that your libpq has been compiled with the -- with-thread-safety option. """ Do I need to worry about this? (I'm guessing I do) I found a very brief guide here: http://www.initd.org/tracker/psycopg/wiki/PsycopgTwoInstall but I'm not sure it will take care of the thread-safety-part. I'm setting up Django with Apache 2.0.55 and PostgreSQL 8.1. These versions were the latest in the apt-get repository, so I figured they would be stable and safe. But maybe I need to compile PostgreSQL to get the thread-safety working correctly? This will be my public server and I don't want to cheat with anything like I did with my development server... regards, Henrik --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: form_for_model and default values
On 11 Jan, 04:07, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > 2) I have a model with aUserfield so what I do (on the view) is the > following: > > Entry.fields['autor'].widget = forms.HiddenInput() > > if request.user.is_authenticated(): > Entry.fields['autor'].initial = (request.user.id, > request.user.username) > > So the field doesn't appears but theuseris selected > initialy. When the system process the form I get > > (Hidden field autor) Enter a list of values. > Hi! Try to set the author-field when you create the form, like this: form = forms.models.form_for_model ( Entry ) f = form( initial = { 'author': request.user } ) f.base_fields[ 'author' ].widget = forms.HiddenInput() I'm not sure if this works with user objects in Foreign key fields, but it works for simpler fields like CharField. If it fails, you could try to replace 'author'. request.user with 'author':request.user.id(?) /Henrik --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: newforms and umlaut
On 9 Jan, 02:16, "Todd O'Bryan" <[EMAIL PROTECTED]> wrote: > On Mon, 2007-01-08 at 06:41 -0800, Hans.Rauch wrote: > > I have a class like this > > > class dms_itemForm ( forms.Form) : > > title = forms.CharField(label='Überschrift') > > > If thisformis rendered, I see "Überschrift" instead of > > "Überschrift". > > > Any hints? > > Use a Unicode string and use the \u notation to give the character code > for the character you want? (The question mark indicates that I'm not > sure that will work, but it's worth a try.) > > Todd You can try this: ...CharField( label = '\xc3\x9cberschrift' ) I got the \xc3\x9c by typing this: 'Ü'.encode( 'utf-8' ) in the python shell. Here are some other codes that you might find useful: å = \xc3\xa5 ä = \xc3\xa4 ö = \xc3\xb6 Å = \xc3\x85 Ä = \xc3\x84 Ö = \xc3\x96 ü = \xc3\xbc Ü = \xc3\x9c ñ = \xc3\xb1 /Henrik --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ImproperlyConfigured: Error importing middleware django.contrib.sessions.middleware: "No module named mysite"
Hi John! I also started my Django-work on WinXP, but I used the built-in Django webbserver and I never had any "no module"-errors. I'm now using Ubuntu-Apache-modpython-PostgreSQL and when I started in Ubuntu, I had some of those errors. My solution was (except for recreating a corrupt database) putting the right stuff in the Location-directive in Apache-config and making sure the right user was running the Apache-server and owned the Django- files. I'm not sure if this helps you, but you can add this in Apache conf to set which user owns the Apache server thread: . User postgres Group postgres So, in my case, the user is called 'postgres'. On the django project directory, to make sure the apache thread could read the django files, I did this, being root: chown -R postgres . Explanation: -R = recursive . = files in current folder postgres = new owner to the files My biggest problem was to get the Location directive right in the httpd.conf. It now looks like this: SetHandler mod_python PythonHandler django.core.handlers.modpython PythonPath "sys.path + ['/usr/local/apache2/django']" SetEnv DJANGO_SETTINGS_MODULE myproject.settings PythonDebug On PythonAutoReload On OK, maybe that path isn't the smartest, but I'm a Linux noob and I'm learning. The "PythonAutoReload On" means that mod_python reloads all python modules automatically whenever they change. This is on by default, I read somewhere, but I figured it wouldn't hurt. To make apache update better, you could set this somewhere in httpd.conf: MaxRequestPerChild 1 I hope this helps. /Henrik --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ImproperlyConfigured: Error importing middleware django.contrib.sessions.middleware: "No module named mysite"
Hi Ron! Try changing '/home/rsie/projects/mysite' to '/home/rsie/projects' and also change SetEnv DJANGO_SETTINGS_MODULE settings to SetEnv DJANGO_SETTINGS_MODULE mysite.settings regards, /Henrik --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: What user does django server runs?
Well, I solved my connection problems. It seems I had two versions of PostgreSQL installed and I had created the database with one version and was running the server with the other version. When I used the "createdb" command for both versions, one of them said that the database was corrupt. So I removed the database and recreated it with the newest PostgreSQL and suddenly everything worked! I had some problems getting PostgreSQL to work when I installed it, so I tried several source codes and packages before it worked. That's probably why I had two different versions. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: What user does django server runs?
On 3 Jan, 02:54, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On 02-Jan-07, at 11:18 PM, Michel Thadeu Sabchuk wrote: > > > without success, the error message tells me: FATAL:Ident > > authentication failed for user "saraswati".edit pg_hba.conf - change > > authentication fromident'sameuser' to > password > > -- > > regards > kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/ I have this same error when i run "python manage.py syncdb". I tried changing "pg_hba.conf" but without success. I got around the problem temporarily by running manage.py logged in as user "postgres", but then I get: "psycopg2.OperationalError: FATAL: database "sp" does not exist" At this point, the Apache server isn't running, and it's not needed, right? So what else can be the problem? I created the database "sp" with the shell command "createdb" in postgresql and I can access it through the psql-shell. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: newforms - FileInput
akhen wrote: Hi there I'm trying to use FileInput widget in a Form: image = forms.Field(widget=forms.FileInput) But after a post, I just can get the filename not the data. form.clean_data['image'] Any ideas ? Thanks. I think the best thing is to wait until newforms is more developed and documented on FileInput, but if you really want you can try to add this to the place where you process your form: - out = '' if (request.FILES): out += 'request.FILES:' out += 'filename: ' + request.FILES['myfile']['filename'] out += 'content-type: ' + request.FILES['myfile']['content-type'] out += 'content: ' + request.FILES['myfile']['content'] return HttpResponse(out) - This code assumes you have called your form filefield "myfile" in the HTML-code, like this: Try this with a small text file as input only, since the whole file content will be dumped on the screen. This works for me. The next step would be for the server to create a new file on the HD and put the content into it. I haven't tried that myself. If you get that to work, please show the code. /Henrik --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---