Hello again.
I am at an impasse. I'm sure whatever is amiss is a simple thing that has to do with me not knowing which wires to plug to which. I went back and on your advice moved everything out of my virtualenv
and tried to better replicate Miguel's setup in the tutorial. (The "Flask" folder is of his design) I figure I'll give it one last try, lay all of my files bare, and someone might spot the obvious mistake:
Virtual Environment lives here:
/home/briandigital/.virtualenvs/bd1-virtualenv
I don't know where to look for the Flask modules I installed with pip
, though. I did not see them in bin
in this dir, though, it could well not be the right place to look!
Dir structure
~/microblog/Flask/app/
- __init__.py
- static
- templates
- views.py
__init__.py
file contents:
from flask import Flask
app = Flask(__name__)
from app import views
end init
views.py file contents:
from app import app
@app.route('/')
@app.route('index')
def index():
return "Hello, World!(BD1)"
end views
Start WSGI config file
import os #(error read) os imported but unused
import sys
path = '/home/briandigital/microblog/Flask/app'
if path not in sys.path:
sys.path.append(path)
from app import app as application #(error read) application imported but unused
** End WSGI config file**
Start briandigital.pythonanywhere.com.error.log -- trimmed to show one call to index.
2015-09-07 13:59:06,057 :/usr/lib/python2.7/threading.py:1160: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
2015-09-07 13:59:06,058 : return _active[_get_ident()]
2015-09-07 13:59:06,058 :Traceback (most recent call last):
2015-09-07 13:59:06,058 : File "/bin/user_wsgi_wrapper.py", line 134, in __call__
2015-09-07 13:59:06,058 : self.error_log_file.logger.exception("Error running WSGI application")
2015-09-07 13:59:06,058 : File "/usr/lib/python2.7/logging/__init__.py", line 1185, in exception
2015-09-07 13:59:06,059 : self.error(msg, *args, **kwargs)
2015-09-07 13:59:06,059 : File "/usr/lib/python2.7/logging/__init__.py", line 1178, in error
2015-09-07 13:59:06,059 : self._log(ERROR, msg, args, **kwargs)
2015-09-07 13:59:06,059 : File "/usr/lib/python2.7/logging/__init__.py", line 1270, in _log
2015-09-07 13:59:06,059 : record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra)
2015-09-07 13:59:06,059 : File "/usr/lib/python2.7/logging/__init__.py", line 1244, in makeRecord
2015-09-07 13:59:06,060 : rv = LogRecord(name, level, fn, lno, msg, args, exc_info, func)
2015-09-07 13:59:06,060 : File "/usr/lib/python2.7/logging/__init__.py", line 284, in __init__
2015-09-07 13:59:06,060 : self.threadName = threading.current_thread().name
2015-09-07 13:59:06,060 : File "/usr/lib/python2.7/threading.py", line 1160, in currentThread
2015-09-07 13:59:06,060 : return _active[_get_ident()]
2015-09-07 13:59:06,060 : File "/bin/user_wsgi_wrapper.py", line 126, in __call__
2015-09-07 13:59:06,060 : app_iterator = self.app(environ, start_response)
2015-09-07 13:59:06,061 : File "/bin/user_wsgi_wrapper.py", line 140, in import_error_application
2015-09-07 13:59:06,061 : raise e
2015-09-07 13:59:06,061 :ImportError: No module named app
2015-09-07 13:59:36,580 :Traceback (most recent call last):
2015-09-07 13:59:36,580 : File "/bin/user_wsgi_wrapper.py", line 134, in __call__
2015-09-07 13:59:36,581 : self.error_log_file.logger.exception("Error running WSGI application")
2015-09-07 13:59:36,581 : File "/usr/lib/python2.7/logging/__init__.py", line 1185, in exception
2015-09-07 13:59:36,581 : self.error(msg, *args, **kwargs)
2015-09-07 13:59:36,581 : File "/usr/lib/python2.7/logging/__init__.py", line 1178, in error
2015-09-07 13:59:36,581 : self._log(ERROR, msg, args, **kwargs)
2015-09-07 13:59:36,581 : File "/usr/lib/python2.7/logging/__init__.py", line 1270, in _log
2015-09-07 13:59:36,582 : record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra)
2015-09-07 13:59:36,582 : File "/usr/lib/python2.7/logging/__init__.py", line 1244, in makeRecord
2015-09-07 13:59:36,582 : rv = LogRecord(name, level, fn, lno, msg, args, exc_info, func)
2015-09-07 13:59:36,582 : File "/usr/lib/python2.7/logging/__init__.py", line 284, in __init__
2015-09-07 13:59:36,582 : self.threadName = threading.current_thread().name
2015-09-07 13:59:36,582 : File "/usr/lib/python2.7/threading.py", line 1160, in currentThread
2015-09-07 13:59:36,583 : return _active[_get_ident()]
2015-09-07 13:59:36,583 : File "/bin/user_wsgi_wrapper.py", line 126, in __call__
2015-09-07 13:59:36,583 : app_iterator = self.app(environ, start_response)
2015-09-07 13:59:36,583 : File "/bin/user_wsgi_wrapper.py", line 140, in import_error_application
2015-09-07 13:59:36,583 : raise e
2015-09-07 13:59:36,583 :ImportError: No module named app
End briandigital.pythonanywhere.com.error.log
I hope the problem is obvious to experts, because if not, I guess I have to give up on PA and instead this tutorial locally, and I was really hoping to learn in this lovely environment here.
Thank you, and sorry to be a hassle.