Hallo Leute,
bräuchte dringend Wissen:
will ein Testscript in der art print("huhu") auf telekom server im Rahmen einer HP laufen lassen.
Python (3.9) ist vorhanden. Pfad /usr/bin/Pathon usw. wird offensichtlich auch benutzt....
Aber irgendwie krieg ich Meldungen, die ich leider nicht verstehe wie...
AttributeError: module 'test2' has no attribute 'application'
args = ("module 'test2' has no attribute 'application'",)
with_traceback = <built-in method with_traceback of AttributeError object>
Irgendwas hab ich da frundsätzlich nicht gerafft...
Hat jemand ein Beispiel, was da im script drinstehen muss, damit das läuft ?
beste Grüsse FZ
python script auf Homepage
- __blackjack__
- User
- Beiträge: 14334
- Registriert: Samstag 2. Juni 2018, 10:21
- Wohnort: 127.0.0.1
- Kontaktdaten:
@freddy_z: Offenbar verwendet der Serveranbieter irgendein Rahmenwerk das den Namen `application` in Deinem Modul erwartet. Und ich vermute mal, dass ein `print()` dann maximal irgendwo im Protokoll des Web- oder Anwendungsservers landen wird, selbst wenn es `application` gibt. Und Wahrscheinlich ist das WSGI es als Schnittstelle verwendet wird. Genau kannst das aber nur Du wissen, beziehungsweise der Anbieter vom Server.
„Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.“ — Brian W. Kernighan
- __blackjack__
- User
- Beiträge: 14334
- Registriert: Samstag 2. Juni 2018, 10:21
- Wohnort: 127.0.0.1
- Kontaktdaten:
Falls es WSGI ist, wäre das kompakteste ”print("huhu")”-Äquivalent übrigens das hier:
Und bevor Du anfängst Dich in pures WSGI einzuarbeiten, schau Dir `bottle` oder `flask` an.
Code: Alles auswählen
def application(_environ, start_response):
start_response("200 OK", [("Content-type", "text/plain")])
return ["huhu\n"]„Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.“ — Brian W. Kernighan
