Changes between Version 1 and Version 2 of UoL LAMP HowTo Install Python Flask Applications


Ignore:
Timestamp:
10/07/15 13:23:21 (9 years ago)
Author:
Richard Bramley
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UoL LAMP HowTo Install Python Flask Applications

    v1 v2  
    3232== Proceduce
    3333
    34 1. [[HowTo Compile mod_wsgi for LAMP servers]]
    35 2. Copy the Telomere application from the `git` repository into `/local/` directory.
     341. 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.
     372. Clone the application from the `git` repository into `/local/` directory.
    36383. Install virtualenv:
    3739
     
    4143
    4244    ''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 telomere application directory.
     454. Create a virtual environment in the application directory.
    4446
    4547{{{
    46 cd /local/telomere
     48cd /local/{application directory}
    4749/local/python/virtualenv --no-site-packages BASELINE
    4850}}}
     
    5052    ''`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`.''
    5153
    52 5. Activate the environment, install the required packages, then deactivate:
     545. Activate the environment, install the required packages, then deactivate.  This example shows some common requirements:
    5355
    5456{{{
     
    5759easy_install flask-sqlalchemy
    5860easy_install mysql-python
    59 easy_install flask-login
    60 easy_install python-ldap
    6161easy_install flask-wtf
    6262easy_install WTForms-Components
    63 easy_install openpyxl
    6463deactivate
    6564}}}
     
    7069LoadModule wsgi_module /local/apache2/etc/mod_wsgi.so
    7170}}}
    72 
    73     ''This presumes that you've copied the compiled `mod_wsgi.so` file into the `/local/apache2/etc/` directory.''
    7471
    75727. Add the WSGI config to the Apache config file `/local/apache2/etc/httpd.conf`: