Skip to main content

Manage electoral race ratings, the POLITICO way.

Project description

POLITICO

politico-civic-race-ratings

TK TK TK, the POLITICO way.

Quickstart

  1. Install the app.
$ pip install politico-civic-race-ratings
  1. Add the app to your Django project settings.
INSTALLED_APPS = [
    # ...
    'rest_framework',
    'entity',
    'geography',
    'election'
    'government',
    'raceratings',
]
  1. Migrate the database.
$ python manage.py migrate

Developing

Running a development server

Move into the example directory, install dependencies and run the development server with pipenv.

$ cd example
$ pipenv install
$ pipenv run python manage.py runserver

Setting up a PostgreSQL database

  1. Run the make command to setup a fresh database.
$ make database
  1. Make a copy of the example/.env.example file and save it as example/.env.
$ cp example/.env.example example/.env
  1. Add a connection URL to example/.env.
DATABASE_URL="postgres://localhost:5432/raceratings"
  1. Run migrations from the example app.
$ cd example
$ pipenv run python manage.py migrate

Configuration

The below configuration is automatically read from a .env file in the project's root during local development. When in production, these variables are read from environment variables on the server.

More details about what each variable does will be added shortly.

Variable name What it does Default value
RACE_RATINGS_AUTH_DECORATOR Description TK. `'django.contrib.auth.decorators.login_required'
RACE_RATINGS_SECRET_KEY Description TK. ""
RACE_RATINGS_AWS_ACCESS_KEY_ID Description TK. None
RACE_RATINGS_AWS_SECRET_ACCESS_KEY Description TK. None
RACE_RATINGS_AWS_REGION Description TK. None
RACE_RATINGS_AWS_S3_BUCKET Description TK. None
RACE_RATINGS_CLOUDFRONT_ALTERNATE_DOMAIN Description TK. None
RACE_RATINGS_S3_UPLOAD_ROOT Description TK. uploads/raceratings
RACE_RATINGS_AWS_S3_STATIC_ROOT Description TK. "https://s3.amazonaws.com"

Copyright

© 2019–present POLITICO, LLC

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

politico-civic-race-ratings-1.0a9.dev2.tar.gz (899.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file politico-civic-race-ratings-1.0a9.dev2.tar.gz.

File metadata

  • Download URL: politico-civic-race-ratings-1.0a9.dev2.tar.gz
  • Upload date:
  • Size: 899.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.11

File hashes

Hashes for politico-civic-race-ratings-1.0a9.dev2.tar.gz
Algorithm Hash digest
SHA256 a05d4ca7d954af9f6a85ba8f2863f9ce965f0b1ffc9a51bbaaa8be7df01d6bf7
MD5 3c517d802ed517bbeee5cea836a4b12d
BLAKE2b-256 454c5fa2fd92ea8a91d10f3d78ac2fe324208b2f35883345013dee155c22d819

See more details on using hashes here.

File details

Details for the file politico_civic_race_ratings-1.0a9.dev2-py3-none-any.whl.

File metadata

  • Download URL: politico_civic_race_ratings-1.0a9.dev2-py3-none-any.whl
  • Upload date:
  • Size: 951.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.11

File hashes

Hashes for politico_civic_race_ratings-1.0a9.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 261eb92eb4e38bc564ebce5939c3c243e1aebd18392c88151d70c6de2b1cfda3
MD5 c7dd1907becb64ec369c22cbdb991c7f
BLAKE2b-256 858d1eeffff93b6bd9a0d6c13f43bf4e9018a517ca8cd5962198a2ef29feb925

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page