django-politico-civic-biography
Quickstart
- Install the app.
$ pip install django-politico-civic-biography
- Add the app to your Django project and configure settings.
INSTALLED_APPS = [
# ...
'rest_framework',
'entity',
'geography',
'government',
'election',
'biography',
]
#########################
# biography settings
BIOGRAPHY_API_AUTHENTICATION_CLASS = 'rest_framework.authentication.BasicAuthentication' # default
BIOGRAPHY_API_PERMISSION_CLASS = 'rest_framework.permissions.IsAdminUser' # default
BIOGRAPHY_API_PAGINATION_CLASS = 'biography.pagination.ResultsPagination' # default
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 biography/staticapp
$ gulp
Want to not worry about it? Use the shortcut make command.
$ make dev
Setting up a PostgreSQL database
- Run the make command to setup a fresh database.
$ make database
- Add a connection URL to the
.env
file.
DATABASE_URL="postgres://localhost:5432/biography"
- Run migrations from the example app.
$ cd example
$ pipenv run python manage.py migrate