Django Redmine Auth
Django app for Redmine authentication.
Application development and testing with django v1.10, Redmine v3.3.1
Contents
- Add lib python-redmine => https://github.com/maxtepkeev/python-redmine
Add
redmine_auth
to your INSTALLED_APPS setting like this:INSTALLED_APPS = ( ... 'redmine_auth', )
Add
backend
to your AUTHENTICATION_BACKENDS setting like this:AUTHENTICATION_BACKENDS = ( ... 'redmine_auth.backends.RedmineBackend', )
Edit the information to connect to your server Redmine in
redmine_auth/settings.py
REDMINE_SERVER_URL = getattr(settings, 'REDMINE_SERVER_URL', 'http://localhost')
Run
python manage.py syncdb
to create the redmine_auth models.For call
redmine_auth
, use standard authenticatefrom django.contrib.auth import authenticate user = authenticate(username=username, password=password)
Access in template to
redmine_auth
{{ user.redmineuser.redmine_user_id }} {{ user.redmineuser.username }}
Also accessing built-in model
User
can be used.{{ user.username }} -- equals to user.redmineuser.username {{ user.first_name }} {{ user.last_name }} {{ user.email }} -- may be blank, depend on personal settings
(Optional) For allowing users which belong to specified projects, add REDMINE_AUTHZ_PROJECTS to your
settings.py
like this:REDMINE_AUTHZ_PROJECTS = ('test-proj',)
- Julien Drecq ( https://github.com/JulienDrecq/ )
- eisin ( https://github.com/eisin )