Python + html post

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Python + html post

    Guten Morgen,

    Ich glaub das ich gerade den ersten Python Thread erstellt habe denn in der suche findet man ueberhaupt nichts unter Python...

    Ich habe ein Apache Python Modul in mein Apache installatiert und moechte jetzt mit einen normalen Html Formular Python die werte mittels POST uebergeben und Python soll dann mit diesen Werten von Formular arbeiten.

    In der Dokumentation funktioniert auch alles super eigentlich nur sobald ich meine eigenen wege gehen moechte d.H eigene datei erstell im prinzip das gleiche mache... bekomm ich ein fehler :S

    Pyhton code:

    Code:
    def sendCommand():
        s = "woohooo"
        return s
    Apache Python module error:

    Code:
    MOD_PYTHON ERROR
    
    ProcessId:      5376
    Interpreter:    'localhost'
    
    ServerName:     'localhost'
    DocumentRoot:   'C:/xampp/htdocs'
    
    URI:            '/python/ONImap.py/sendCommand'
    Location:       None
    Directory:      'C:/xampp/htdocs/python/'
    Filename:       'C:\\xampp\\htdocs\\python\\ONImap.py'
    PathInfo:       '/sendCommand'
    
    Phase:          'PythonHandler'
    Handler:        'mod_python.publisher'
    
    Traceback (most recent call last):
    
      File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1537, in HandlerDispatch
        default=default_handler, arg=req, silent=hlist.silent)
    
      File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1229, in _process_target
        result = _execute_target(config, req, object, arg)
    
      File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1128, in _execute_target
        result = object(arg)
    
      File "C:\Python25\Lib\site-packages\mod_python\publisher.py", line 213, in handler
        published = publish_object(req, object)
    
      File "C:\Python25\Lib\site-packages\mod_python\publisher.py", line 425, in publish_object
        return publish_object(req,util.apply_fs_data(object, req.form, req=req))
    
      File "C:\Python25\Lib\site-packages\mod_python\util.py", line 554, in apply_fs_data
        return object(**args)
    
      File "C:\xampp\htdocs\python\ONImap.py", line 88, in sendCommand
        ip = SITE_MAP.get(site)
    
    NameError: global name 'site' is not defined
    
    
    MODULE CACHE DETAILS
    
    Accessed:       Thu Jan 31 10:04:55 2008
    Generation:     2
    
    _mp_82412a2cdd91ac83e6a0fcfdf04f620b {
      FileName:     'C:\\xampp\\htdocs\\python\\ONImap.py'
      Instance:     2 [RELOAD]
      Generation:   3
      Modified:     Thu Jan 31 10:04:47 2008
      Imported:     Thu Jan 31 10:04:55 2008
      Children:     'C:\\xampp\\htdocs\\python\\TAMdriver.py'
    }
    Mfg tetRa
    Zuletzt geändert von tetra; 31.01.2008, 10:11.

  • #2
    File "C:\xampp\htdocs\python\ONImap.py", line 88, in sendCommand
    ip = SITE_MAP.get(site)
    Die Fehlermeldung sagt ja schon ganz genau wo der Fehler liegt (und das er nicht in dem von dir geposteten Code liegt).
    Die Regeln | rtfm | register_globals | strings | SQL-Injections | [COLOR=silver][[/COLOR][COLOR=royalblue]–[/COLOR][COLOR=silver]][/COLOR]

    Kommentar

    Lädt...
    X