- Python 2.7
- You also will need pip and virtualenv
git clone the repo with the code in a local directory
git clone https://github.com/Miki-AG/tag_battle.git
- Create a virtualenv tb
virtualenv tb
- Activate the new environment
source ./tb/bin/activate
- Install all required packages
pip install -r ./tag_battle/requirements.txt
Enter your Twitter dev credentials in the file settings.py located in the ht_battle_project/ht_battle_project folder. You need to replace the below values with your own:
TWITTER_APP_KEY = 'xxxxxxxxx'
TWITTER_APP_KEY_SECRET = 'xxxxxxxxx'
TWITTER_ACCESS_TOKEN = 'xxxxxxxxx'
TWITTER_ACCESS_TOKEN_SECRET = 'xxxxxxxxx'
Move to ./tag_battle/ht_battle_project/ and create all the models:
Create migration scripts for the app:
cd ./tag_battle/ht_battle_project/
python manage.py makemigrations ht_battle_app
Migrate the app
python manage.py migrate
python manage.py createsuperuser
Youn will be prompted to enter a username/email and a password.
python manage.py runserver
The console will show the status of all battles set up in the system every 10 seconds. Additional information wil be shown regarding status, data pulled out from Twitter and typos.
Use the admin user and password you have created to access the admin console in the below url:
You can add, remove and edit battles throught the Admin Console.
The application exposes an endpoint that provides information about battles in the url:
http://127.0.0.1:8000/api/battles/1/
(Replace the number at the end of the url with the id of the battle)
python manage.py test
Built and tested in Mac OS Sierra 10.12.5