Skip to main content

PSU-Base

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

Quick Start

Dependencies

The following dependencies may be REQUIRED in your system:

  • libpq-dev
    sudo apt install libpq-dev
    

Installation

pip install psu-base

Configuring Your App

  1. Add PSU-Base and its two required apps to INSTALLED_APPS in settings.py:

    INSTALLED_APPS = [
       ...
       'django_cas_ng',
       'crequest',
       'psu_base',
    ]
    
  2. Copy docs/app_settings_template.py to your app, name it app_settings.py and update the values as needed.

  3. Copy docs/local_settings_template.py to your app, name it local_settings.py and update the values as needed.

  4. Import your app and local settings files at the end of your settings.py file: settings.py

    # Get app-specific settings
    from .app_settings import *

    # Override settings with values for the local environment
    from .local_settings import *
  1. Run python manage.py migrate to create the PSU-Base models in your development database

  2. Configure your app's top-level urls.py to include PSU URLs

    # 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

Usage of the psu-base app is documented in Confluence.

For Developers

The version number must be updated for every PyPi release. The version number is in psu_base/__init__.py

Document Changes

Record every change in docs/CHANGELOG.txt Document new features or significant changes to existing features in Confluence.

Publishing to PyPi

  1. Create accounts on PyPi and Test PyPi
  2. Create ~/.pypirc
    [distutils]
    index-servers=
        pypi
        testpypi
    
    [testpypi]
    repository: https://test.pypi.org/legacy/
    username: mikegostomski
    password: pa$$w0rd
    
    [pypi]
    username: mikegostomski
    password: pa$$w0rd
    
  3. Ask an existing developer to add you as a collaborator - test and/or prod
  4. python setup.py sdist bdist_wheel --universal
  5. twine upload --repository testpypi dist/*
  6. twine upload dist/*
  7. Tag the release in Git. Don't forget to push the tag! Example:
git tag 0.1.2
git push origin 0.1.2 

Metadata

Release files for psu-base 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for psu-base 0.2.6
File Interpreter ABI Platform Actions
psu_base-0.2.6-py3-none-any.whl Python 3 none any Details for psu_base-0.2.6-py3-none-any.whl

Release files / psu_base-0.2.6-py3-none-any.whl

Download URL psu_base-0.2.6-py3-none-any.whl
Size 93.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93e53bf0ad3b04615737ff7640ad45ac328414735837a8ae6d51370fcb9c16e4
BLAKE2b-256 checksum
How to use checksums
6776bfd524ebdf5ddb9659e70b678bdc39ca3725218a3e91847bc86fd8ac619b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Security for psu-base 0.2.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.6 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page