We installed python version 3.6 and apache 2.4 on CentOS 8 and connect with 
postgresql. 
And then installed mod_wsgi for run python code.
After we make some configuration in /etc/httpd/conf.d/wsgi.conf  as follows 
-

--------------------------------------------------------------------------------
LoadModule wsgi_module /etc/httpd/modules/mod_wsgi_python3.so
Alias /map /var/www/map/

<Directory /var/www/orikomap/>
Options ExecCGI MultiViews Indexes
MultiViewsMatch Handlers

AddHandler wsgi-script .py
AddHandler wsgi-script .wsgi
DirectoryIndex index.html index.php index.py app.wsgi

Order allow,deny
Allow from all
</Directory>
----------------------------------------------------------------------------------------

And then we add python code to target directory -> /var/www/map/index.py as 
follow

-------------------------------------------------------------------------------------------
import sys

def application(environ, start_response):
status = '200 OK'
output = u'mod_wsgi.process_group = %s' % 
repr(environ['mod_wsgi.process_group'])
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)

return [output.encode('UTF-8')]
----------------------------------------------------------------------------------------

we got follow result -
https://gyazo.com/bcedcd91870832e1af231feabbd966c2

After we add a new python file on the same directory -> /var/www/map/map.py 
.

https://gyazo.com/0ace24266d716794a0961ce13454ca3a

but we can't call another python file as follow.
http//:ipaddress/polygon.py

----------------------------------------------------------------------------------------------
[Fri Oct 29 03:56:35.064042 2021] [wsgi:error] [pid 2840:tid 
140610811930368] [client 192.168.1.8:53246] mod_wsgi (pid=2840): Target 
WSGI script '/var/www/map/polygon.py' does not contain WSGI application 
'application'.


So how can we solve this problem, how to run other Python files on the same 
directory using wsgi.

Thank you.


-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/modwsgi/e33beebb-e3c7-4c0c-a573-21bc1a536b93n%40googlegroups.com.

Reply via email to