Django Data Collection tool using ODK Collect mobile App
Project description
django-odk
Django data collection tool using ODK-collect mobile app.
Prerequisite
- Django web site up and running
- Smartphone or tablet with ODK-Collect installed
- Set of forms in Xforms format available in xml. Use https://getodk.org/xlsform/ to validate and export your forms in xml format.
Installation
- Run
$ pip install django-odk
$ python manage.py migrate
$ python manage.py createsuperuser
- Add django_odk to your INSTALLED_APPS settings
INSTALLED_APPS = (
...
'odk',
)
- Add LOCALE_PATHS and appropriate language_code in settings
LOCALE_PATHS = [os.path.join(BASE_DIR, 'odk', 'locale')]
LANGUAGE_CODE = 'en'
# LANGUAGE_CODE = 'fr'
# possible LANGUAGE_CODE on 05/10/2021 are: en, fr
- Add appropriate AUTH_USER_MODEL in settings.py
AUTH_USER_MODEL = 'auth.user'
- Add is_odk_admin property to your AUTH_USER_MODEL (django.contrib.auth.models file or specific accounts.models)
@property
def is_odk_admin(self):
return self.groups.filter(name='odk-admin').exists()
- Add odk.urls to the main urls.py file:
urlpatterns = [
...
path('odk/', include('odk.urls'), name='odk'),
]
- Add menu or buttons to access Available form
# bootstrap5 menu item example
<li><a class="dropdown-item" href="{% url 'odk:xform_list' %}">{% trans "ODK available forms" %}</a></li>
- Add menu or buttons to access Submitted form
# bootstrap5 menu item example
<li><a class="dropdown-item" href="{% url 'odk:xformsubmit_list' %}">{% trans "ODK submitted forms" %}</a></li>
Connect to the Django admin site
- create a group 'odk-admin' with create, read, update access on odk objects
- Associate this group to the appropriate users
Upload Xforms
Connect to django-odk => Available form => Add and follow instructions to upload xml forms
Once it is done, you are ready to go with form encoding on your smartphone!
Follow ODK instructions to configure the connexion to the server
Get, fill-in and submit data using ODK Collect
Get submitted data on server
Go to Submitted form menu of your server to see submitted data
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
django-odk-0.2.4.tar.gz
(37.7 kB
view hashes)
Built Distribution
django_odk-0.2.4-py3-none-any.whl
(47.2 kB
view hashes)
Close
Hashes for django_odk-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8aa9cfd3bd7c39170b3d1cd5aa6d0cfa07a5898ddc6f51bee6a0efa115e05ee9 |
|
MD5 | 9a1569474e16baee6670797f5b06c4ef |
|
BLAKE2b-256 | ada09c3486ba88271519581af22e72df2dc770edcb26bda155b91803a0b9469f |