Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Commit

Permalink
Uses Createnv
Browse files Browse the repository at this point in the history
  • Loading branch information
cuducos committed Mar 18, 2020
1 parent 6de9658 commit 0540415
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 187 deletions.
32 changes: 32 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Twitter API
# You can get yours at https://developer.twitter.com/en/apps
TWITTER_CONSUMER_KEY= # API Key
TWITTER_CONSUMER_SECRET= # API secret key
TWITTER_ACCESS_TOKEN_KEY= # Access token
TWITTER_ACCESS_TOKEN_SECRET= # Access token secret

# Botometer API
# You can get yours at https://rapidapi.com/OSoMe/api/botometer
BOTOMETER_MASHAPE_KEY= # Application Key

# Django settings
# You can find details about them at https://docs.djangoproject.com/3.0/en/topics/settings/
DEBUG=False # Debug mode (use True if in a development environment)
ALLOWED_HOSTS=127.0.0.1,localhost # Allowed hosts
SECRET_KEY=<random> # Secret key

# PostgreSQL credentials
# Use the default values for Docker Compose within a developing environment
POSTGRES_PASSWORD=ehmelhorjair # Host
POSTGRES_USER=borsalino # Database name
POSTGRES_DB=bot_followers # User name
POSTGRES_HOST=db # Password
DATABASE_URL=postgres://{POSTGRES_USER}:{POSTGRES_PASSWORD}@{POSTGRES_HOST}/{POSTGRES_DB}

# Celery settings
# Use the default values for Docker Compose within a developing environment
CELERY_BROKER_URL=amqp://guest:guest@broker// # Broker URL

# Cache
# This helps us to avoid unnecessary requests to Botometer API
CACHE_BOTOMETER_RESULTS_FOR_DAYS=180 # Number of days to keep results in cache
2 changes: 1 addition & 1 deletion .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
pipenv install --dev
- name: Run Mypy static type checker
run: pipenv run mypy env.py
run: pipenv run mypy
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
createnv = "*"
flower = "*"
ipdb = "*"
isort = "*"
Expand Down
111 changes: 101 additions & 10 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ If you're looking for the CLI version, [it's tagged](https://github.com/cuducos/
1. [Botometer API key](https://market.mashape.com/OSoMe/botometer)
1. **For development**, [Docker Compose](https://docs.docker.com/compose/)
1. **For production**, [Dokku](http://dokku.viewdocs.io/dokku/)
1. Run `python env.py` to create a `.env` file with the required environment variables. Feel free to explore the options available with the `--help` argument.
1. Set up your local configuration variables; you can:
* run [Createnv](https://github.com/cuducos/createnv),
* or manually copy `.env.sample` as `.env` editing it accordingly.

### Development environment

Expand Down Expand Up @@ -82,6 +84,5 @@ Please, write tests, run checks, and format your code with [Black](https://githu

```bash
$ python manage.py test
$ mypy env.py
$ black .
```
Loading

0 comments on commit 0540415

Please sign in to comment.