Skip to content

natbat/pillarpointstewards

Repository files navigation

pillarpointstewards

https://www.pillarpointstewards.com/

Login via Auth0: https://www.pillarpointstewards.com/login/

Development environment is GitHub Codespaces

Before launching Codespaces you'll need to configure these Codespaces secrets using the interface at https://github.com/settings/codespaces

  • AUTH0_CLIENT_SECRET - get from Auth0
  • AUTH0_FORWARD_URL: https://www.pillarpointstewards.com/auth0-callback/
  • AUTH0_FORWARD_SECRET: get from Simon's 1Password
  • ALLOWED_HOSTS_STAR: 1

Having set those secrets for the natbat/pillarpointstewards repo you can launch a Codespaces environment against that repo.

After a few minutes of automated setup this should start a development server. You can access that from the ports menu by clicking the little Globe icon that shows up when you hover over the port 8000 (Application) entry:

CleanShot 2023-08-17 at 11 44 49@2x

Start a new terminal window running and run this command:

./manage.sh shell_plus

Then in the Python console run these:

User.objects.update(is_active=True, is_staff=True, is_superuser=True)
# And to get the shift calculator working:
TidePrediction.populate_for_station(9414131)

Running the tests

Run this in a terminal window:

pytest pillarpointstewards

Handling requirements

Requirements are listed in the requirements.in file. These are then pinned in requirements.txt. To update requirements.txt from requirements.in run the following in the project's virtual environment:

pip install pip-tools
pip-compile --upgrade --generate-hashes requirements.in

The --upgrade flag causes it to check PyPI for any upgraded versions of packages that still match the line in requirements.in. --generate-hashes adds hashes.

This command will over-write requirements.txt with the new pinned versions.

To upgrade your local virtual environment to the exact versions of the packages recorded in requirements.txt run the other command that was installed by pip-tools:

pip-sync

Where the code is

Useful URLs

Fragments

Some site content - such as emergency contact phone numbers - is held in the database to avoid sharing it in a public GitHub repository.

The contact_details_$team-slug fragments show contact details and are displayed on the logged-in homepage for each team.

Content for these needs to be copied and pasted into new databases - we keep those in the private repository pillarpointstewards-private.

They can be edited at /admin/homepage/fragment/.

About

Website for pillarpointstewards.com

Resources

License

Stars

Watchers

Forks