Skip to main content

Shared utilities for POLITICO Civic apps

Project description

POLITICO

politico-civic-utils

Quickstart

  1. Install the app.
$ pip install politico-civic-utils
  1. Add the app to your Django project and configure settings.
INSTALLED_APPS = [
    # ...
    'rest_framework',
    'civic_utils',
]

#########################
# civic_utils settings

CIVIC_UTILS_SECRET_KEY = ''
CIVIC_UTILS_AWS_ACCESS_KEY_ID = ''
CIVIC_UTILS_AWS_SECRET_ACCESS_KEY = ''
CIVIC_UTILS_AWS_REGION = ''
CIVIC_UTILS_AWS_S3_BUCKET = ''
CIVIC_UTILS_CLOUDFRONT_ALTERNATE_DOMAIN = ''
CIVIC_UTILS_S3_UPLOAD_ROOT = ''

Developing

Running a development server

Developing python files? Move into example directory and run the development server with pipenv.

$ cd example
$ pipenv run python manage.py runserver

Developing static assets? Move into the pluggable app's staticapp directory and start the node development server, which will automatically proxy Django's development server.

$ cd civic_utils/staticapp
$ gulp

Want to not worry about it? Use the shortcut make command.

$ make dev
Setting up a PostgreSQL database
  1. Run the make command to setup a fresh database.
$ make database
  1. Add a connection URL to the .env file.
DATABASE_URL="postgres://localhost:5432/civic_utils"
  1. Run migrations from the example app.
$ cd example
$ pipenv run python manage.py migrate

Project details


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-utils-1.0a1.dev7.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

politico_civic_utils-1.0a1.dev7-py2-none-any.whl (25.2 kB view details)

Uploaded Python 2

File details

Details for the file politico-civic-utils-1.0a1.dev7.tar.gz.

File metadata

  • Download URL: politico-civic-utils-1.0a1.dev7.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.16

File hashes

Hashes for politico-civic-utils-1.0a1.dev7.tar.gz
Algorithm Hash digest
SHA256 3bb3b8a792565aed91ced826c470aaa4b3855970106a04be1428632b311abe92
MD5 9722dc6744d639d9e73925312acacee1
BLAKE2b-256 f4d5a80e0d4692019c7daba1800d703de33d16e79d7c98c342ab486eff3162b0

See more details on using hashes here.

File details

Details for the file politico_civic_utils-1.0a1.dev7-py2-none-any.whl.

File metadata

  • Download URL: politico_civic_utils-1.0a1.dev7-py2-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.16

File hashes

Hashes for politico_civic_utils-1.0a1.dev7-py2-none-any.whl
Algorithm Hash digest
SHA256 712d69f50f52c797e2d4750c1ce3429438caf5509708d18d58fc3853de81801f
MD5 5d26f41fbf06749aa3eac05774b541cd
BLAKE2b-256 706dadbb115aa1b7281672f23e0eba6510077629fdc24bd700b18b564fd426b3

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