Update example project.

This commit is contained in:
Juan Ignacio Fiorentino 2018-03-23 17:06:44 -03:00
parent 8545ada615
commit b803f8917d
15 changed files with 15 additions and 16 deletions

View file

@ -1,4 +1,4 @@
FROM python:2-onbuild
FROM python:3-onbuild
RUN [ "python", "manage.py", "migrate" ]
RUN [ "python", "manage.py", "creatersakey" ]

View file

@ -2,7 +2,7 @@
![Example Project](https://s17.postimg.org/4jjj8lavj/Screen_Shot_2016_09_07_at_15_58_43.png)
Run your own OIDC provider in a second. This is a Django app with all the necessary things to work with `django-oidc-provider` package.
On this example you'll be running your own OIDC provider in a second. This is a Django app with all the necessary things to work with `django-oidc-provider` package.
## Setup & Running
@ -14,15 +14,12 @@ Run your own OIDC provider in a second. This is a Django app with all the necess
Setup project environment with [virtualenv](https://virtualenv.pypa.io) and [pip](https://pip.pypa.io).
```bash
# For Python 2.7.
$ virtualenv project_env
# Or Python 3.
$ virtualenv -p /usr/bin/python3.4 project_env
$ virtualenv -p /usr/bin/python3 project_env
$ source project_env/bin/activate
$ git clone https://github.com/juanifioren/django-oidc-provider.git
$ cd django-oidc-provider/example_project
$ cd django-oidc-provider/example
$ pip install -r requirements.txt
```
@ -53,7 +50,7 @@ After you run `pip install -r requirements.txt`.
# Remove pypi package.
$ pip uninstall django-oidc-provider
# Go back and add the package again.
# Go back to django-oidc-provider/ folder and add the package on editable mode.
$ cd ..
$ pip install -e .
```

View file

@ -20,7 +20,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'myapp',
'app',
'oidc_provider',
]
@ -51,9 +51,9 @@ TEMPLATES = [
},
]
ROOT_URLCONF = 'myapp.urls'
ROOT_URLCONF = 'app.urls'
WSGI_APPLICATION = 'myapp.wsgi.application'
WSGI_APPLICATION = 'app.wsgi.application'
# Database

View file

@ -3,7 +3,7 @@
{% block content %}
<section class="text-xs-center">
<section>
<div class="container">
<h1 class="jumbotron-heading">{% trans 'Welcome' %}{% if user.is_authenticated %} {{ user.username }}{% endif %}!</h1>
<p class="lead text-muted">{% trans 'This is an example of an OpenID Connect 1.0 Provider. Built with the <a href="https://www.djangoproject.com/" target="_BLANK"><u>Django Framework</u></a> and <a href="https://github.com/juanifioren/django-oidc-provider" target="_BLANK"><u>django-oidc-provider</u></a> package.' %}</p>

View file

@ -1,6 +1,8 @@
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myapp.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')
application = get_wsgi_application()

View file

@ -3,7 +3,7 @@ import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myapp.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')
from django.core.management import execute_from_command_line

2
example/requirements.txt Normal file
View file

@ -0,0 +1,2 @@
django
https://github.com/juanifioren/django-oidc-provider/archive/master.zip

View file

@ -1,2 +0,0 @@
django==1.10
https://github.com/juanifioren/django-oidc-provider/archive/v0.4.x.zip