I have no problems with jac in my flask application on my local CentOS 7 dev stack, but I can't deploy it to an AWS EB instance: the browser GET request doesn't get any response back.
The AWS EB /var/log/httpd/access_log just repeats this line about one hundred times:
127.0.0.1 (-) - - [12/Apr/2016:19:54:11 +0000] "GET / HTTP/1.1" 301 243 "-" "Python-urllib/2.7"
and ath the end:
xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) - - [12/Apr/2016:19:55:35 +0000] "GET / HTTP/1.1" 301 247 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0"
So on github jac repository there's a requirement.txt that is the following:
Jinja2
beautifulsoup4==4.3.2
rjsmin==1.0.10
ordereddict==1.1
six==1.9.0
but I didn't have to add anything since all the above lines are yet included in the requirements.txt file that I got from pip freeze.
I thought that the problem could be the lack of less library, since I have some css to compress, so I added the following to .ebextensions:
commands:
01-install-nodejs-npm:
command: yum install -y --enablerepo=epel nodejs npm
02-install-less:
command: npm install -g less
but that didn't resolve the issue.
I don't think there's something wrong with the code, since it works on the dev environment, but just to be sure, the following lines are in flaskApp init.py:
app.config['COMPRESSOR_DEBUG'] = app.config.get('DEBUG')
app.config['COMPRESSOR_OUTPUT_DIR'] = './flaskApp/static/mydomain-dev'
app.config['COMPRESSOR_STATIC_PREFIX'] = '/static/mydomain-dev'
jac = JAC(app)
env = jinja2.Environment(extensions=[CompressorExtension])
env.compressor_output_dir = './flaskApp/static/mydomain-dev'
env.compressor_static_prefix = '/static/mydomain-dev'
#env.compressor_source_dirs = './flaskApp/staticLib/'
I'm stuck at this point.
The only difference between CentOS venv app and AWS app is that, since the app uses flask_sslify, then every request on AWS is redirect to https (not in CentOS since flask_sslify deosn't redirect if app.debug = True).
Any idea please?