ubuntu - Flask wsgi python Import Error: no module named catalog -


i have been following along tutorials digitalocean , flask set flask wsgi python application served on ubuntu amazon lightsail, , i'm getting following error:

error

[tue jul 25 16:09:14.573839 2017] [wsgi:error] [pid 19081:tid 140056986322688] [remote 65.102.85.13:26759]     catalog import app application [tue jul 25 16:09:14.573903 2017] [wsgi:error] [pid 19081:tid 140056986322688] [remote 65.102.85.13:26759] importerror: no module named catalog [tue jul 25 18:11:00.019707 2017] [wsgi:error] [pid 19082:tid 140056977929984] [client 91.196.50.33:42031] target wsgi script not found or unable stat: /var/ 

this current file structure

root@:/var/www/catalog# ls -la total 24 drwxr-xr-x  . drwxr-xr-x  .. drwxr-xr-x  catalog drwxr-xr-x  catalog.egg-info -rw-r--r--  catalog.wsgi -rw-r--r--  setup.py 

and

root@:/var/www/catalog/catalog# ls -la total 120 drwxr-xr-x . drwxr-xr-x .. -rw-r--r-- 1 client_secrets.json -rw-r--r-- 1 database_setup.py -rw-r--r-- 1 fb_client_secrets.json drwxr-xr-x 8 .git -rw-r--r-- 1 lotsofmenus.py -rw-r--r-- 1 lotsofmenususers.py -rw-r--r-- 1 readme.md -rw-r--r-- 1 restaurant_menu_app.py -rw-r--r-- 1 restaurantmenu.db -rw-r--r-- 1 restaurantmenuwithusers.db drwxr-xr-x 4 static drwxr-xr-x 2 templates drwxr-xr-x 6 venv 

my python.wsgi file import sys

import logging logging.basicconfig(stream=sys.stderr) sys.path.insert(0, "/var/www/catalog")  catalog import app application application.secret_key = 'super_secret_key' 

my /etc/apache2/sites-enabled/catalog.config

<virtualhost *:80>     servername 52.34.254.190     serveralias ec2-52-34-254-190.us-west-2.compute.amazonaws.com     serveradmin admin@52.34.254.190     wsgidaemonprocess catalog python-path=/var/www/catalog:/var/www/catalog/venv/lib/python2.7/site-packages     wsgiprocessgroup catalog     wsgiscriptalias / /var/www/catalog/catalog.wsgi     <directory /var/www/catalog/catalog/>         order allow,deny         allow     </directory>         alias /static /var/www/catalog/catalog/static     <directory /var/www/catalog/catalog/static/>         order allow,deny         allow     </directory>     errorlog ${apache_log_dir}/error.log     loglevel warn     customlog ${apache_log_dir}/access.log combined </virtualhost> 

my setup.py file

from setuptools import setup  setup(     name='catalog',     packages=['catalog'],     include_package_data=true,     install_requires=[         'flask',     ], ) 

i can virtual env running, broswer ip still getting 500 internal server error. can't figure out why module isn't found, what's happening?

this solved changing main app file init.py


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -