Finds Tweets that are more likely to be false information.
git clone https://github.com/dcalvo/dangertweet.git dangertweet && cd dangertweetpython3 -m venv env- Create a
.envfile in the root directory. Add the following:
source env/Scripts/activate
export APP_SETTINGS="config.DevelopmentConfig"
export DATABASE_URL="postgresql:///dangertweet_dev"
export CONSUMER_KEY="<consumer_key>"
export CONSUMER_SECRET="<consumer_secret>"
# Note! sometimes the database_url will need an additional username and password, which
# will look like "postgresql://user:pass@localhost:port/dangertweet_dev"
python -m pip install autoenvecho "source `which activate.sh`" >> ~/.bashrc && source ~/.bashrccd .. && cd dangertweet- Allow the script to run. Whenever you
cdinto this directory, you'll automatically enter your virtual python environment. - Install PostgreSQL.
python -m pip install -r requirements.txtsudo -u postgres psql -c "create database dangertweet_dev" && sudo -u postgres createuser $USERpython manage.py db upgradepython manage.py runserver
- Many of the steps above could go wrong. Troubleshoot as you go.
- Run
deactivateto leave the venv. - Run
psql dangertweet_devto get into the Postgres CLI for the DB. - Run
python manage.py runserverto run the localhost server at 127.0.0.1:5000 - Run
python manage.py db migrateafter changing models.py to save the changes. - Run
python manage.py db upgradeto commit the changes to the DB. - Run
python manage.py db downgradeif your changes break the DB. - If your file path contains spaces, manually open
~/.bashrcand add the necessary back slashes - Additionally, change the version number of autoenv to
pip install autoenv==0.2.0, which despite looking like an older version, is actually a newer version.
- Add heroku config section