title: How to create a requirements.txt file for OpenShift Online Next Gen Developer Preview?
body: <p><strong>tl;dr</strong> </p>
  
  <p>I am trying to create a <code>requirements.txt</code> file for an existing application that is running locally.  </p>
  
  <p>I want to know what contents should go in the <code>requirements.txt</code> file.  </p>
  
  <p>I'm doing this in order to get the local application running on:</p>
  
  <p><a href="https://docs.openshift.com/online/welcome/index.html" rel="nofollow">OpenShift Online (Next Gen) Developer Preview</a>  </p>
  
  <p><strong>Detail</strong></p>
  
  <p><code>myapplication.py</code> has a number of standard <code>import</code> statements, eg:</p>
  
  <pre><code>#  from python standard library
  
  import os
  import re
  import StringIO
  import json
  import ast
  import struct
  import time
  import collections
  </code></pre>
  
  <p>It also contains <code>import</code> statements in the format <code>from X import X</code>, eg:  </p>
  
  <pre><code>#  additional modules
  
  from bottle import route, post, default_app, template, view, TEMPLATE_PATH, response, request, static_file, install, redirect
  # BEGIN pymongo
  import pymongo
  from bson.json_util import dumps
  import gridfs
  # END pymongo
  import requests
  from bs4 import BeautifulSoup
  import lxml
  import base64
  import tldextract
  from PIL import Image
  import serial
  
  from beaker.middleware import SessionMiddleware
  from cork import Cork
  from cork.cork import AuthException
  from cork.cork import AAAException
  from cork.backends import MongoDBBackend
  
  import user_settings (a local .py file)
  </code></pre>
  
  <p>When setting up the app locally, I also had to install these from the Ubuntu Software Centre:</p>
  
  <pre><code>apache2
  virtualenv
  mod_wsgi
  </code></pre>
  
  <p>And these packages were required for pip installs in <code>virtualenv</code> to work:</p>
  
  <pre><code>python2.7-dev
  libxml2-dev
  libxslt1-dev
  apache2-dev
  zlib1g-dev
  libjpeg8-dev
  </code></pre>
  
  <p>These were installed in pip whilst <code>virtualenv</code> was activated:</p>
  
  <pre><code>pip install bottle
  pip install https://github.com/FedericoCeratto/bottle-cork/archive/master.zip
  pip install requests
  pip install pymongo==2.8
  pip install beautifulsoup4
  pip install lxml
  pip install Beaker
  pip install pillow
  pip install tldextract
  pip install serial
  </code></pre>
  
  <p><strong>Questions</strong></p>
  
  <p><strong>01)</strong>  Will the contents of my <code>requirements.txt</code> file just need to look like this:</p>
  
  <pre><code>pymongo
  requests
  lxml
  tldextract
  pyserial
  bottle
  git+git://github.com/FedericoCeratto/bottle-cork.git#egg=bottle-cork
  beautifulsoup4
  Beaker
  pillow
  </code></pre>
  
  <p><strong>02)</strong>  Will <code>myapplication.py</code> still need to have the import statements as defined above?  </p>
  
  <p><strong>03)</strong>  The following were required for pip installs to work in <code>virtualenv</code>, are these already in the OpenShift environment and, if not, how do I add them?  </p>
  
  <pre><code>python2.7-dev
  libxml2-dev
  libxslt1-dev
  apache2-dev
  zlib1g-dev
  libjpeg8-dev
  </code></pre>
  
  <p><strong>04)</strong>  Does <code>requirements.txt</code> live in the top directory of the repo directory?  </p>
  
  <p>For reference and further information, these are the results of running pip freeze locally in the <code>virtualenv</code>:</p>
  
  <pre><code>(ENV) me@my-computer:/var/www/html/site-name/ENV$ pip freeze
  -markerlib==0.0.0
  Beaker==1.8.0
  beautifulsoup4==4.4.1
  bottle==0.12.9
  bottle-cork==0.12.0a2
  funcsigs==1.0.0
  idna==2.1
  lxml==3.6.0
  ordereddict==1.1
  Pillow==3.2.0
  pkg-resources==0.0.0
  pycrypto==2.6.1
  pymongo==2.8
  pyserial==3.0.1
  requests==2.9.1
  tldextract==1.7.5
  </code></pre>