First, git clone and navigate inside the directory by running these commands:
git clone https://github.com/umd-python-cas/django-demo.git
cd django-demoThen, install the dependencies:
pip install -r requirements.txtSet up the database
./manage.py migrateFinally, run the django webserver locally.
./manage.py runserverGo to http://127.0.0.1:8000/ in your browser to view the app.
The following are instructions on how this template was made, so you can better understand how to integrate umd-cas-python into your project.
First, install django and umd-python-cas, and start a new django project, by running these commands:
pip install django umd-python-cas
django-admin startproject django_client_demoThis will create a new folder called django_client_demo and initialize it with all the normal django template files.
Navigate into that new project folder, set up the database, and create a sub-app called cas, by running these commands:
cd django_client_demo
./manage.py migrate
./manage.py startapp casThis will create a sub-folder called cas, where we will put the code for authenticaion.
Create a file cas/views.py with the contents of this file.
Create a file cas/urls.py with the contents of this file.
Replace django_demo/urls.py with the contents of this file.
Create a templates folder.
mkdir templatesCreate templates/index.html with the contents of this file.
To allow this templates folder to be detected, inside django_client_demo/settings.py, change the line that reads:
'DIRS': [],to be:
'DIRS': [''],Run the django webserver locally.
./manage.py runserverGo to http://127.0.0.1:8000/ in your browser to view the app.