Twitter authentication using Tweepy API using Django. The application can do following functionalities:
- Fetch tweets from home timeline of authenticated user containing URLs.
- View all the tweets fetched till date using the following application.
- Display the most shared Domain from the database.
- Display the User who shared maximum URLs.
Link to the application - https://twitter-tweepy.herokuapp.com/
- Python 3.6 and pip should be preinstalled
- Twitter developer Credentials
- PostgreSQL database
-
Programming Languages
- Python 3.6
-
Frameworks
- Django 3.1.2
-
Database
- PostgreSQL
-
Frontend
- HTML 5
- CSS 3
- Jinja
- Bootstrap 4
-
APIs
- Tweepy Api
- Clone the repository
git clone https://github.com/tds-1/vouch-tweepy
- Generate CONSUMER_KEY and CONSUMER_KEY from Twitter Developer console (https://developer.twitter.com/en/portal/projects-and-apps) and paste them in the .env file .
# Django Secret Key
# ------------------
SECRET_KEY=
# Database config
# ----------------
POSTGRES_DB_NAME=
POSTGRES_DB_USER=
POSTGRES_DB_PASSWORD=
POSTGRES_DB_HOST=
POSTGRES_DB_PORT=
# Application key
# ----------------
CONSUMER_KEY =
CONSUMER_SECRET =
- Enter Database credentials in .env file along with the seceret key.
- Create a virtual environment.
- Install the dependenies
pip install -r requirements.txt
- Migrate the tables to the database.
python manage.py makemigrations
python manage.py migrate
- Run the django server on local host.
python manage.py runserver
- Sub-directories of the folders marked with ' * ' are not shown for clarity.
.
├── djangotweepy
│ ├── __init__.py
│ ├── __pycache__*
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── images*
├── manage.py
├── Pipfile
├── Pipfile.lock
├── Procfile
├── README.md
├── requirements.txt
├── runtime.txt
└── twitter_auth
├── admin.py
├── apps.py
├── forms.py
├── home_timeline.py
├── __init__.py
├── migrations*
├── models.py
├── __pycache__*
├── static
│ ├── css
│ │ ├── achievements.css
│ │ └── tweets.css
│ └── media*
├── templates
│ └── twitter_auth
│ ├── achievements_domain.html
│ ├── achievements.html
│ ├── base.html
│ ├── info.html
│ ├── login.html
│ ├── messages.html
│ ├── post_tweet.html
│ ├── public_tweets.html
│ └── view_tweets.html
├── tests.py
├── urls.py
├── utils.py
└── views.py