Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added files conf/loc dir and edited README.md and core/settings/loc.py #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
14 changes: 14 additions & 0 deletions conf/loc/apache
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<VirtualHost *:80>
ServerName twxplorer
ServerAlias twxplorer
ServerAdmin [email protected]
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
</VirtualHost>
2 changes: 2 additions & 0 deletions conf/loc/flask_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DEBUG = True
SECRET_KEY = 'EDIT_THIS'
14 changes: 14 additions & 0 deletions conf/loc/wsgi.py
Original file line number Diff line number Diff line change
@@ -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
12 changes: 6 additions & 6 deletions core/settings/loc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
Expand All @@ -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')
os.environ['FLASK_CONFIG_MODULE'] = os.path.normpath(os.path.join(PROJECT_ROOT, 'conf/loc/flask_config.py'))