Python Skript nicht zum laufen zu bringen

2 years ago

Mein Ziel ein einfaches Test-Pytonscript über den Browser zum laufen zu bringen scheitert gnadenlos. 

Scrript liegt im   -> /home/www/public_html

Script sieht so aus

#!/usr/bin/python3
print("Content-Type: text/html\n\n")
print("Hello world! Here is Python!")

wird aufgerufen mit www.mindmake.de/start.py

Es hagelt folgende Fehlermeldung (die man sich auch durch anklicken auf den Link anschauen kann):

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

 /usr/lib/python3/dist-packages/flup/server/fcgi_base.py in run(self=<flup.server.fcgi_base.Request object>)
    565         """Runs the handler, flushes the streams, and ends the request."""
    566         try:
=>  567             protocolStatus, appStatus = self.server.handler(self)
    568         except:
    569             output = io.StringIO()
protocolStatus undefined, appStatus undefined, self = <flup.server.fcgi_base.Request object>, self.server = <flup.server.fcgi.WSGIServer object>, self.server.handler = <bound method BaseFCGIServer.handler of <flup.server.fcgi.WSGIServer object>>
 /usr/lib/python3/dist-packages/flup/server/fcgi_base.py in handler(self=<flup.server.fcgi.WSGIServer object>, req=<flup.server.fcgi_base.Request object>)
   1129         try:
   1130             try:
=> 1131                 result = self.application(environ, start_response)
   1132                 try:
   1133                     for data in result:
result = None, self = <flup.server.fcgi.WSGIServer object>, self.application = <function application>, environ = {'CONTENT_LENGTH': '0', 'CONTEXT_DOCUMENT_ROOT': '/home/www/public_html/', 'CONTEXT_PREFIX': '', 'DOCUMENT_ROOT': '/home/www/public_html/', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTPS': 'on', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;...,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', 'HTTP_ACCEPT_CHARSET': 'utf-8', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br', 'HTTP_ACCEPT_LANGUAGE': 'de,de-DE;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6', ...}, start_response = <function BaseFCGIServer.handler.<locals>.start_response>
 /usr/lib/python3/dist-packages/cm4all/fcgi/launcher.py in application(environ={'CONTENT_LENGTH': '0', 'CONTEXT_DOCUMENT_ROOT': '/home/www/public_html/', 'CONTEXT_PREFIX': '', 'DOCUMENT_ROOT': '/home/www/public_html/', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTPS': 'on', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;...,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', 'HTTP_ACCEPT_CHARSET': 'utf-8', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br', 'HTTP_ACCEPT_LANGUAGE': 'de,de-DE;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6', ...}, start_response=<function BaseFCGIServer.handler.<locals>.start_response>)
     15 
     16 def application(environ, start_response):
=>   17     return cache[environ['SCRIPT_FILENAME']](environ, start_response)
     18 
     19 def launch():
global  Cache  = {}, environ = {'CONTENT_LENGTH': '0', 'CONTEXT_DOCUMENT_ROOT': '/home/www/public_html/', 'CONTEXT_PREFIX': '', 'DOCUMENT_ROOT': '/home/www/public_html/', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTPS': 'on', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;...,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', 'HTTP_ACCEPT_CHARSET': 'utf-8', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br', 'HTTP_ACCEPT_LANGUAGE': 'de,de-DE;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6', ...}, start_response = <function BaseFCGIServer.handler.<locals>.start_response>
 /usr/lib/python3/dist-packages/cm4all/fcgi/launcher.py in __missing__(self={}, path='/home/www/public_html/start.py')
      9         else:
     10             mod = imp.load_source(name, path)
=>   11         self[path] = value = getattr(mod, 'application')
     12         return value
     13 
self = {}, path = '/home/www/public_html/start.py', value undefined, builtin getattr = <built-in function getattr>, mod = <module 'start' from '/home/www/public_html/start.py'>

AttributeError: module 'start' has no attribute 'application'
      args = ("module 'start' has no attribute 'application'",)
      with_traceback = <built-in method with_traceback of AttributeError object>








1187

0

31

    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...

    This could help you too

    Popular tags last 7 days

    Loading...Loading...Loading...Loading...Loading...Loading...Loading...Loading...Loading...Loading...