Skip to content

Instantly share code, notes, and snippets.

"""
To evaluate the good or bad score of a tweet, we first tokenize the tweet, and then
stemmize each word in our tweet. We also associate each stem with positive and negative values,
respectively, using a dictionary.
Finally, we caculate the average word weight of a tweet, and decide if it's a good or bad one
based on that.
"""
import json
import environ
import os
root = environ.Path(__file__) - 2 # two folders back (/a/b/ - 2 = /)
env = environ.Env(DEBUG=(bool, False),) # set default values and casting
GOOGLE_ANALYTICS_ID=env('GOOGLE_ANALYTICS_ID')
SITE_DOMAIN = env('SITE_DOMAIN')
SITE_ROOT = root()
DEBUG = env('DEBUG') # False if not in os.environ
#!/bin/bash
WORKING_DIR=/home/myuser/example.com/example-django
cd ${WORKING_DIR}
source .server.envrc
source ENV/bin/activate
exec $@
example.com/
example-dango/
homepage/
[supervisord]
nodaemon=true
logfile=supervisord.log
[supervisorctl]
[inet_http_server]
port = 127.0.0.1:9001
[rpcinterface:supervisor]
server {
server_name www.example.com;
access_log /var/log/nginx/example.com.log;
error_log /var/log/nginx/example.com.error.log debug;
root /home/myuser/example.com/homepage;
sendfile on;
# if the uri is not found, look for index.html, else pass everthing to gunicorn
location / {
index index.html;