Giter Site home page Giter Site logo

joyider / bvspca Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nfletton/bvspca

0.0 1.0 0.0 890 KB

Wagtail/Django based website of the Bow Valley SPCA

Home Page: https://www.bowvalleyspca.org/

License: MIT License

Python 59.55% HTML 14.23% JavaScript 11.11% CSS 15.02% Shell 0.09%

bvspca's Introduction

Bow Valley SPCA Website

The Bow Valley SPCA's mission is to provide the community with an adoption centre following a no kill, no cage philosophy to shelter, care for and re-home stray and abandoned dogs and cats and promote humane attitudes and responsible pet companionship through educational programs and community leadership.

Sponsorship of the website build has been provided by the Calgary Foundation and Blue Hut. Read more here

The code for the website is open source and other SPCAs, in particular, are encouraged to make use of the code as they see fit.

Key Website Features

  • Easy to use content editing interface
  • Supports news, events, team and general content management for the centre
  • Integrates with PetPoint data management system for a feed of adoptable animals at the centre
  • Animal data retrieved from PetPoint is stored locally to the website to allow:
    • end-users to interact with animal information directly on the website
    • improved social interactions with the website via Facebook, Twitter and email marketing
    • improved SEO
    • ability to allow additional content to be associated with animals that is not supported by PetPoint
  • Automated posting of new and recently adopted animals to Facebook and Twitter
  • Automated regular email listing new arrivals and recently adopted animals

Technical Overview

The website is built with Wagtail and Django.

Experience with either Django or Wagtail will be required to make use of this code.

Code structure based on cookiecutter-django

Django Apps

core

animals

The animals app provides the main functionality for displaying animals available for adoption. The app is based around using PetPoint (http://www.petpoint.com/) for managing animal data. It provides a Django management command to synchronize current adoptable animals in the PetPoint data management system with an 'Animal' Wagtail page model.

A PETPOINT_AUTH_KEY environment variable needs to be set to enable access to the PetPoint SOAP API.

Photo galleries on the animal details page use Featherlight jQuery lightbox plugin.

The animals app can easily be modified for rescue centres that do not use PetPoint by modifying the Wagtail Animal page model to suit their specific requirements.

newsletter

The newsletter app provides a management command to construct and send a weekly newsletter listing recently arrived and adopten animals. The newsletter is published via MailChimp.

The newsletter includes:

  • animals arrived in the last 14 days
  • animals adopted in the last 14 days

social

The social app provides a simple queue where pages can be appended for later posting to social media. A management command is run to dequeue items and post them to Facebook and Twitter.

Pages implementing the SocialMediaPostable abstract class can be added to the queue. Currently only the Animal page model implements this.

Deployment

The following environment variables need to be set in a production environment

Name App Example Note
DJANGO_SECRET_KEY
DJANGO_SETTINGS_MODULE config.settings.production
DJANGO_ADMIN_URL r'my-secret-django-admin-path' Defaults to 'djadmin' in development
DATABASE_URL
WAGTAIL_ADMIN_URL r'my-secret-wagtail-admin-path' Defaults to 'admin' in development
RECAPTCHA_SITE_KEY Google Recaptcha
RECAPTCHA_SECRET_KEY Google Recaptcha
GOOGLE_ANALYTICS_ID core
ADDTHIS_PUB_ID core
MAILCHIMP_USERNAME newsletter Required by 'newsletter' app
MAILCHIMP_SECRET_KEY newsletter Required by 'newsletter' app
MAILCHIMP_LIST_ID newsletter 83c4276af1 MailChimp list ID that newsletter will be distributed to
MAILCHIMP_TEMPLATE_ID newsletter 351313 MailChimp template ID that newsletter will be created with
MAILCHIMP_SUBJECT newsletter Subject line of email
MAILCHIMP_FROM_NAME newsletter From name of email
MAILCHIMP_REPLY_TO newsletter Reply to address of email
PETPOINT_AUTH_KEY animals PetPoint Authorization Key
WAGTAILADMIN_NOTIFICATION_FROM_EMAIL Admin From email
FACEBOOK_PAGE_ACCESS_TOKEN social Facebook page access token
FACEBOOK_PAGE_ID social Facebook page id
FB_PIXEL_ID core
TWITTER_CONSUMER_KEY social Twitter consumer key
TWITTER_CONSUMER_SECRET social Twitter consumer secret
TWITTER_ACCESS_TOKEN_KEY social Twitter access token key
TWITTER_ACCESS_TOKEN_SECRET social Twitter access token secret

Development Commands

Code Style Checks

  $ flake8 bvspca

Tests

  $ pytest bvspca
  $ pytest bvspca --reuse-db       # reuses the existing test db
  $ pytest bvspca --create-db      # forces the test db to be recreated
  $ pytest bvspca -f               # watches for changes if pytest-xdist installed

Live reloading, Sass compilation and JS bundling

  $ npm start

Production Sass compilation and JS bundling

  $ npm run build
Command Required by Suggested Frequency Note
clearsessions django daily
publish_scheduled_pages wagtail every hour
sync_petpoint_data animals app every 30 minutes
send_newsletter newsletter app weekly
post_social_media social app daily

bvspca's People

Contributors

nfletton avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.