diff --git a/README.md b/README.md index 578645b..e3c3b25 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Install [MongoDB](http://www.mongodb.org/downloads) and start the Mongo server b # Make a virtual environment for twxplorer mkvirtualenv twxplorer - + # Change into the twxplorer repository cd twxplorer @@ -21,6 +21,9 @@ Install [MongoDB](http://www.mongodb.org/downloads) and start the Mongo server b # Install requirements pip install -r requirements.txt + + # If compilation fails with lxml installation error, install both libxml2-dev and libxslt-dev + apt-get install libxml2-dev libxslt-dev # Download nltk stopwords (if necessary) python -m nltk.downloader stopwords diff --git a/conf/loc/apache b/conf/loc/apache new file mode 100644 index 0000000..93f147a --- /dev/null +++ b/conf/loc/apache @@ -0,0 +1,14 @@ + + ServerName twxplorer + ServerAlias twxplorer + ServerAdmin admin@knightlab.com + ErrorLog /var/log/apache2/twxplorer.log + + LogLevel info + + SetEnvIf X-Forwarded-Protocol "^https$" HTTPS=on + + WSGIDaemonProcess twxplorer display-name=%{GROUP} maximum-requests=10000 + WSGIProcessGroup twxplorer + WSGIScriptAlias / /home/chris/projects/NUKnightLab/twxplorer/conf/prd/wsgi.py + diff --git a/conf/loc/flask_config.py b/conf/loc/flask_config.py new file mode 100644 index 0000000..1c06409 --- /dev/null +++ b/conf/loc/flask_config.py @@ -0,0 +1,2 @@ +DEBUG = True +SECRET_KEY = 'EDIT_THIS' diff --git a/conf/loc/wsgi.py b/conf/loc/wsgi.py new file mode 100644 index 0000000..cdc7e3a --- /dev/null +++ b/conf/loc/wsgi.py @@ -0,0 +1,14 @@ +""" +WSGI config for twxplorer project. +""" +import os +import sys +import site + +site.addsitedir('/usr/local/lib/python2.7/site-packages') +sys.path.append('/home/chris/projects/NUKnightLab/twxplorer') +sys.stdout = sys.stderr + +os.environ.setdefault('FLASK_SETTINGS_MODULE', 'core.settings.loc') + +from api import app as application diff --git a/core/settings/loc.py b/core/settings/loc.py index 199f079..12c1258 100644 --- a/core/settings/loc.py +++ b/core/settings/loc.py @@ -10,12 +10,12 @@ # a parallel directory structure next to where you have this code checked out such that the # secrets path defined below is a valid directory path. # see https://dev.twitter.com/apps to create an app that you can use for Twxplorer development -secrets_path = os.path.normpath(os.path.join(PROJECT_ROOT, '../secrets/twxplorer/loc')) -sys.path.append(secrets_path) -from secrets import * +# secrets_path = os.path.normpath(os.path.join(PROJECT_ROOT, '../secrets/twxplorer/loc')) +# sys.path.append(secrets_path) +# from secrets import * # or instead of importing from secrets, uncomment these lines and provide appropriate values -# TWITTER_CONSUMER_KEY = 'consumer key' -# TWITTER_CONSUMER_SECRET = 'consumer secret' +#TWITTER_CONSUMER_KEY = '' +#TWITTER_CONSUMER_SECRET = '' # Set static URL STATIC_URL = '/static/' @@ -32,4 +32,4 @@ # see http://flask.pocoo.org/docs/config/ for more. # Twxplorer has no special requirements for what goes in this file, but Flask will want you to have a SECRET_KEY # and you may want to set the DEBUG flag to True -os.environ['FLASK_CONFIG_MODULE'] = os.path.join(secrets_path, 'flask_config.py') \ No newline at end of file +os.environ['FLASK_CONFIG_MODULE'] = os.path.normpath(os.path.join(PROJECT_ROOT, 'conf/loc/flask_config.py'))