Metadata-Version: 2.1
Name: huscy.subjects
Version: 2.1.2
Summary: Managing subjects in a human research context.
Home-page: https://bitbucket.org/huscy/subjects
Author: Alexander Tyapkov, Mathias Goldau, Stefan Bunde
Author-email: tyapkov@gmail.com, goldau@cbs.mpg.de, stefanbunde+git@posteo.de
License: AGPLv3+
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Framework :: Django
Classifier: Framework :: Django :: 3.2
Classifier: Framework :: Django :: 4.1
Classifier: Framework :: Django :: 4.2
Description-Content-Type: text/markdown
Requires-Dist: Django (>=3.2)
Requires-Dist: django-countries (>=7.1)
Requires-Dist: django-guardian (>=2.2)
Requires-Dist: django-phonenumber-field[phonenumberslite] (>=5)
Requires-Dist: django-reversion (>=3)
Requires-Dist: djangorestframework (>=3.11)
Requires-Dist: drf-nested-routers (>=0.90)
Requires-Dist: python-dateutil (>=2.7)
Provides-Extra: development
Requires-Dist: psycopg2-binary ; extra == 'development'
Provides-Extra: testing
Requires-Dist: tox ; extra == 'testing'
Requires-Dist: watchdog (==0.9) ; extra == 'testing'

huscy.subjects
======

![PyPi Version](https://img.shields.io/pypi/v/huscy-subjects.svg)
![PyPi Status](https://img.shields.io/pypi/status/huscy-subjects)
![PyPI Downloads](https://img.shields.io/pypi/dm/huscy-subjects)
![PyPI License](https://img.shields.io/pypi/l/huscy-subjects?color=yellow)
![Python Versions](https://img.shields.io/pypi/pyversions/huscy-subjects.svg)
![Django Versions](https://img.shields.io/pypi/djversions/huscy-subjects)



Requirements
------

- Python 3.8+
- A supported version of Django

Tox tests on Django versions 3.2, 4.1 and 4.2.



Installation
------

To install `husy.subjects` simply run:

    pip install huscy.subjects

Add `huscy.subjects` and further required apps to `INSTALLED_APPS` in your `settings.py`:

```python
INSTALLED_APPS = (
	...
	'django_countries',
	'guardian',
	'phonenumber_field',
	'rest_framework',

	'huscy.subjects',
)
```

Hook the urls from `huscy.subjects` into your `urls.py`:

```python
urlpatterns = [
	...
	path('api/', include('huscy.subjects.urls')),
]
```

Create `huscy.subjects` database tables by running:

    python manage.py migrate



Configuration
------

There are some settings to configure the service. These settings have be added to `settings.py`.


| Name | Default value | Description |
| -------- | -------- | -------- |
| HUSCY_SUBJECTS_AGE_OF_MAJORITY | 18 | Specifies the age of majority. |
| HUSCY_SUBJECTS_SUBJECT_VIEWSET_MAX_RESULT_COUNT | 500 | Specifies the maximum number of subjects returned by the queryset in the SubjectViewSet. |



Development
------

Install PostgreSQL and create a database user called `huscy` and a database called `huscy`.

    sudo -u postgres createdb huscy
    sudo -u postgres createuser -d huscy
    sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE huscy TO huscy;"
    sudo -u postgres psql -c "ALTER USER huscy WITH PASSWORD '123';"

Check out the repository and start your virtual environment (if necessary).

Install dependencies:

    make install

Create database tables:

    make migrate

Run tests to see if everything works fine:

    make test


