Basic features used in all PSU Django apps
Reusable Django app specifically for PSU's custom-built web applications.
It encapsulates the common functionality that we would otherwise need to program into each application we build. Features include:
- PSU Single Sign-On (SSO)
- Authentication and authorization features
- Feature toggles
- Template tags for our static content server
The following dependencies may be REQUIRED in your system:
sudo apt install libpq-dev
pip install psu-base
Configuring Your App
Add PSU-Base and its two required apps to INSTALLED_APPS in
INSTALLED_APPS = [ ... 'django_cas_ng', 'crequest', 'psu_base', ]
docs/app_settings_template.pyto your app, name it
app_settings.pyand update the values as needed.
docs/local_settings_template.pyto your app, name it
local_settings.pyand update the values as needed.
Import your app and local settings files at the end of your settings.py file:
# Get app-specific settings from .app_settings import * # Override settings with values for the local environment from .local_settings import *
python manage.py migrateto create the PSU-Base models in your development database
# my_app/urls.py from django.conf import settings from django.conf.urls import url from django.urls import path, include ... urlpatterns = [ ... # PSU and CAS views are defined in psu_base app url(settings.URL_CONTEXT+'/psu/', include(('psu_base.urls', 'psu_base'), namespace='psu')), url(settings.URL_CONTEXT+'/accounts/', include(('psu_base.urls', 'psu_base'), namespace='cas')), ]
Usage of the psu-base app is documented in Confluence.
The version number must be updated for every PyPi release.
The version number is in
Publishing to PyPi
- Create accounts on PyPi and Test PyPi
[distutils] index-servers= pypi testpypi [testpypi] repository: https://test.pypi.org/legacy/ username: mikegostomski password: pa$$w0rd [pypi] username: mikegostomski password: pa$$w0rd
- Ask an existing developer to add you as a collaborator - test and/or prod
python setup.py sdist bdist_wheel --universal
twine upload --repository testpypi dist/*
twine upload dist/*
- Tag the release in Git. Don't forget to push the tag! Example:
git tag 0.1.2 git push origin 0.1.2
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size psu-base-0.2.5.tar.gz (61.5 kB)||File type Source||Python version None||Upload date||Hashes View|