
Hallo, da ich gerade gemerkt habe, dass mein Posting zu lang geworden ist, hier zu Anfang meine Frage: Wenn ich das Beispiel http://wiki.python.de/Colubrid/ObjectApplication ausführe kommt bei mir der Fehler: ======================================================================== Request' object has no attribute 'headers' wnfalbum.py in __init__, line 68 66 def __init__(self, *args): 67 super(DispatcherApplication, self).__init__(*args) 68 self.request.headers['Content-Type'] = 'text/html' ======================================================================== Woran kann das liegen? Und jetzt noch die Langfassung ;-) Hallo, ich möchte mir eine kleine Anwendung schreiben, die meine Fotosammlung im lokalen Netz über http und Browser allen Rechnern im Haus zur Verfügung stellt. Dazu habe ich mir Colubrid auserkoren. Wenn das ein falscher Ansatz sein sollte, dann sagt mir Bescheid (und was ich besser nehmen sollte) und ihr braucht auch nicht weiterlesen Das Beispiel aus http://wiki.python.de/Colubrid/Hello_World funktioniert. Dann wollte ich http://wiki.python.de/Colubrid/ObjectApplication testen und es kommt der Fehler (Brought to you by DON'T PANIC, your friendly Colubrid traceback interpreter system): ======================================================================== Request' object has no attribute 'headers' wnfalbum.py in __init__, line 68 66 def __init__(self, *args): 67 super(DispatcherApplication, self).__init__(*args) 68 self.request.headers['Content-Type'] = 'text/html' ======================================================================== wenn ich jetzt die Zeile 68 auskommentiere und das Programm neu starte, geht es weiter mit folgendem Fehler: ======================================================================== 'Request' object has no attribute 'write' wnfalbum.py in _info, line 18 self.request.write("<h3>Aufruf von '%s'</h3>\n" % methodname) ======================================================================== Also irgend etwas habe ich falsch gemacht. (vielleicht habe ich auch die Grundlagen von Python im Web falsch verstanden, oder ich habe irgendwelche Rechte falsch im Linux System gesetzt) 'SERVER_SOFTWARE' 'WSGIServer/0.1 Python/2.5.1' 'APPLICATION_REQUEST' '/' 'CONTENT_LENGTH' '' 'CONTENT_TYPE' 'text/plain' 'DBUS_SESSION_BUS_ADDRESS' 'unix:abstract=/tmp/dbus-TnIbWlFt4z,guid=437eb1ec16d3f0f8f4ec970047edc5b6' 'DESKTOP_SESSION' 'kde' 'DISPLAY' ':0.0' 'DM_CONTROL' '/var/run/xdmctl' 'GATEWAY_INTERFACE' 'CGI/1.1' 'GPG_AGENT_INFO' '/tmp/gpg-AUGZEb/S.gpg-agent:5299:1' 'GS_LIB' '/home/wnf/.fonts' 'GTK2_RC_FILES' '/home/wnf/.gtkrc-2.0-kde:/home/wnf/.kde/share/config/gtkrc-2.0' 'GTK_RC_FILES' '/etc/gtk/gtkrc:/home/wnf/.gtkrc:/home/wnf/.kde/share/config/gtkrc' 'HOME' '/home/wnf' 'HTTP_ACCEPT' 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5' 'HTTP_ACCEPT_CHARSET' 'ISO-8859-1,utf-8;q=0.7,*;q=0.7' 'HTTP_ACCEPT_ENCODING' 'gzip,deflate' 'HTTP_ACCEPT_LANGUAGE' 'de-de,de;q=0.8,en-us;q=0.5,en;q=0.3' 'HTTP_CACHE_CONTROL' 'max-age=0' 'HTTP_CONNECTION' 'keep-alive' 'HTTP_HOST' 'localhost:8080' 'HTTP_KEEP_ALIVE' '300' 'HTTP_REFERER' 'http://wiki.python.de/Colubrid/Hello_World' 'HTTP_USER_AGENT' 'Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.1.13) Gecko/20080325 Ubuntu/7.10 (gutsy) Firefox/2.0.0.13' 'KDE_FULL_SESSION' 'true' 'KDE_MULTIHEAD' 'false' 'KDE_SESSION_UID' '' 'LANG' 'de_DE.UTF-8' 'LOGNAME' 'wnf' 'PATH' '/home/wnf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' 'PATH_INFO' '/' 'PWD' '/media/sdb1/wnfwww/wnfalbum_2' 'QUERY_STRING' '' 'REMOTE_ADDR' '127.0.0.1' 'REMOTE_HOST' 'localhost' 'REQUEST_METHOD' 'GET' 'REQUEST_URI' 'http://localhost:8080/' 'SCRIPT_NAME' '' 'SCRIPT_ROOT' '/' 'SERVER_NAME' 'localhost' 'SERVER_PORT' '8080' 'SERVER_PROTOCOL' 'HTTP/1.1' 'SERVER_SOFTWARE' 'WSGIServer/0.1 Python/2.5.1' 'SESSION_MANAGER' 'local/c2004:/tmp/.ICE-unix/5881' 'SHELL' '/bin/bash' 'SHLVL' '0' 'SSH_AGENT_PID' '5322' 'SSH_AUTH_SOCK' '/tmp/ssh-PLQqIl5122/agent.5122' 'USER' 'wnf' 'XCURSOR_THEME' 'default' 'XDM_MANAGED' '/var/run/xdmctl/xdmctl-:0,maysd,mayfn,sched,rsvd,method=classic,auto' 'colubrid.request' <colubrid.request.Request object at 0xb7aa23ec> 'wsgi.errors' <open file '<stderr>', mode 'w' at 0xb7dee0b0> 'wsgi.file_wrapper' <class wsgiref.util.FileWrapper at 0xb7a9b8fc> 'wsgi.input' <socket._fileobject object at 0xb7aa3614> 'wsgi.multiprocess' False 'wsgi.multithread' True 'wsgi.run_once' False 'wsgi.url_scheme' 'http' 'wsgi.version' (1, 0) -- Uwe Wilske wnf@wlsoft.de