Changes between Version 1 and Version 2 of UoL LAMP HowTo Install Python Flask Applications
- Timestamp:
- 10/07/15 13:23:21 (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UoL LAMP HowTo Install Python Flask Applications
v1 v2 32 32 == Proceduce 33 33 34 1. [[HowTo Compile mod_wsgi for LAMP servers]] 35 2. Copy the Telomere application from the `git` repository into `/local/` directory. 34 1. Install {{{mod_wsgi.so}}} into the directory {{{/local/apache2/etc/}}} 35 1. Compile `mod_wsgi`. See: [[HowTo Compile mod_wsgi for LAMP servers]] 36 2. Copy `mod_wsgi.so` from the directory {{{/local/apache2/etc/}}} of an existing UoL LAMP python Flask application. 37 2. Clone the application from the `git` repository into `/local/` directory. 36 38 3. Install virtualenv: 37 39 … … 41 43 42 44 ''For some reason that I can't work out (point 4. above), it would only pick up some of the python libraries from a virtual env and not when they were installed in `/local/python/`. Maybe this was because of the order that I installed things, but I couldn't get it to work without the virtual environment.'' 43 4. Create a virtual environment in the telomereapplication directory.45 4. Create a virtual environment in the application directory. 44 46 45 47 {{{ 46 cd /local/ telomere48 cd /local/{application directory} 47 49 /local/python/virtualenv --no-site-packages BASELINE 48 50 }}} … … 50 52 ''`BASELINE` is the name of the virtual environment. It could be called anything, but it's called that! Also note that you need to use the full path to the `virtualenv` utility, since `/local/python` isn't in `$PATH`.'' 51 53 52 5. Activate the environment, install the required packages, then deactivate :54 5. Activate the environment, install the required packages, then deactivate. This example shows some common requirements: 53 55 54 56 {{{ … … 57 59 easy_install flask-sqlalchemy 58 60 easy_install mysql-python 59 easy_install flask-login60 easy_install python-ldap61 61 easy_install flask-wtf 62 62 easy_install WTForms-Components 63 easy_install openpyxl64 63 deactivate 65 64 }}} … … 70 69 LoadModule wsgi_module /local/apache2/etc/mod_wsgi.so 71 70 }}} 72 73 ''This presumes that you've copied the compiled `mod_wsgi.so` file into the `/local/apache2/etc/` directory.''74 71 75 72 7. Add the WSGI config to the Apache config file `/local/apache2/etc/httpd.conf`: