django-oidc-provider/example/README.md

57 lines
1.3 KiB
Markdown
Raw Normal View History

2015-04-29 17:04:57 +00:00
# Example Project
2015-03-19 20:10:00 +00:00
2016-09-07 19:02:31 +00:00
![Example Project](https://s17.postimg.org/4jjj8lavj/Screen_Shot_2016_09_07_at_15_58_43.png)
2016-02-02 16:18:40 +00:00
2018-03-23 20:06:44 +00:00
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.
2015-03-19 20:10:00 +00:00
## Setup & Running
2016-01-24 04:07:08 +00:00
- [Manually](#manually)
- [Using Docker](#using-docker)
### Manually
2015-03-19 20:10:00 +00:00
Setup project environment with [virtualenv](https://virtualenv.pypa.io) and [pip](https://pip.pypa.io).
```bash
2018-03-23 20:06:44 +00:00
$ virtualenv -p /usr/bin/python3 project_env
2015-07-01 21:18:57 +00:00
2015-03-19 20:10:00 +00:00
$ source project_env/bin/activate
2015-04-29 17:04:57 +00:00
2015-03-19 20:10:00 +00:00
$ git clone https://github.com/juanifioren/django-oidc-provider.git
2018-03-23 20:06:44 +00:00
$ cd django-oidc-provider/example
2015-03-19 20:10:00 +00:00
$ pip install -r requirements.txt
```
Run your provider.
```bash
$ python manage.py migrate
2015-07-17 14:37:05 +00:00
$ python manage.py creatersakey
2016-09-07 19:02:31 +00:00
$ python manage.py createsuperuser
2015-03-19 20:10:00 +00:00
$ python manage.py runserver
2015-04-29 17:04:57 +00:00
```
2015-05-07 23:40:36 +00:00
Open your browser and go to `http://localhost:8000`. Voilà!
2016-01-24 04:07:08 +00:00
### Using Docker
2016-01-24 01:04:34 +00:00
2016-01-24 04:07:08 +00:00
Build and run the container.
2016-01-24 01:04:34 +00:00
2016-01-24 04:07:08 +00:00
```bash
$ docker build -t django-oidc-provider .
$ docker run -d -p 8000:8000 django-oidc-provider
2016-01-24 01:04:34 +00:00
```
2015-07-01 21:18:57 +00:00
## Install package for development
After you run `pip install -r requirements.txt`.
```bash
# Remove pypi package.
$ pip uninstall django-oidc-provider
2018-03-23 20:06:44 +00:00
# Go back to django-oidc-provider/ folder and add the package on editable mode.
2015-07-01 21:18:57 +00:00
$ cd ..
$ pip install -e .
2015-08-28 21:46:40 +00:00
```