Closed saish29 closed 5 years ago
Yes for graphs to be seen there should be some data in database. To populate data in db, after activating the virtualenv you can use the following management commands. At the root of the repo, activate virtualenv and do the following:
The following is one time command and should be run only once.
python manage.py populate_alliance
this command enables tweet collection. This populates a database table called Alliance
and maps hashtags or queries with parties. For example this command will have some preconfigured keywords like modi, bjp etc. The command will associate modi and bjp with nda and likewise.
This is also one time command.
python manage.py textblob_download_corpora
This downloads some nlp data for sentiment analysis.
Now time to fetch and save tweets.
python manage.py fetch_and_save_tweets modi
python manage.py fetch_and_save_tweets rahulgandhi
This will fetch some tweets related to modi
and rahulgandhi
and save them in db. If you try downloading tweets other than those in the file https://github.com/v-adhithyan/india-elections/blob/master/core/management/commands/populate_alliance.py KeyError
will be thrown. To fix the issue, add an entry to Alliance
table.
Now if you restart the server, visualizations will be shown. Feel free to ping me in case if you run into any difficulties. Also provide screenshots, that would be helpful.
I will try to update README regarding these and add some commands for bootstrapping the server for first time users and make it easy for anyone to run this project without much difficulty. 😃
@saish29 I have updated the latest master branch with a command that does all the above mentioned steps in one shot.
Pull the latest master branch.
Activate virtual env and type python manage.py setup_dev_env
at the root of the repo. After this start the server. Visualizations would be shown.
Do let me know if this solves this issue. Also, I have updated the readme with the command. Commit link https://github.com/v-adhithyan/india-elections/commit/acef82a7a0b0c945bd208aefd19edf93abd2ca99 Closing this out, reopen if you face any difficulties.
I followed all the steps mentioned and the python manage.py runserver command is running successfully although I am not able to see any visualizations i.e.graphs are not working. Can you help me with it please? I used my sentry.io api token and also my twitter application secrets as you said.