Code Monkey home page Code Monkey logo

pets's Introduction

Pets

Black Code Climate Build Status Coverage Status Updates

Pets is a website where people can publish lost pets and pets available for adoption.

Users can create an account with a username and password, or they can use their Twitter and Facebook to login. You can also extend it to use other providers as it's backed by python-social-auth.

Images uploaded by users are cropped with easy-thumbnails to improve the site performance.

Installing

Requirements

  • Python 3.6 or newer
  • PostgreSQL running with a database, username and password to be used with Pets.

Fork and clone the repository

First fork the project using GitHub, than clone it locally:

git clone https://github.com/<username>/pets.git
cd pets

Configure your instance

The project configuration uses python-decouple to dynamically read environment variables and .env files.

If you want, you can get started by copying contrib/sample-env as .env:

cp contrib/sample-env pets/.env

Then you have to set following variables:

Basic Django settings

  • SECRET_KEY: Django's secret key
  • ALLOWED_HOSTS (e.g. 127.0.0.1, .localhost) Django's allowed hosts
  • DJANGO_SETTINGS_MODULE: In order to make development and deploy to production simpler there's two settings module; pets.settings.dev for development and pets.settings.prod for production.

Database

Email configuration

  • SENDGRID_API_KEY: API key of you SendGrid account.
  • DEFAULT_FROM_EMAIL: The email address that will be used as the from email field.

OAuth

If you want to login via social media, you will have to create apps as a developer at Facebook and/or Twitter. Once you're done, set the app secret and app key for each of them:

  • SOCIAL_AUTH_FACEBOOK_KEY
  • SOCIAL_AUTH_FACEBOOK_SECRET
  • SOCIAL_AUTH_TWITTER_KEY
  • SOCIAL_AUTH_TWITTER_SECRET

Other dependencies

Install Pillow dependencies

As Pets uses Pillow, some extra packages are needed. In a Debian based Linux this should do the job:

sudo apt-get install python-dev python3.x-dev libjpeg8-dev

Download ChromeDriver

You just need to download and unzip the latest ChromeDriver and place it somewhere in your search path.

Install Python packages

You can install the required packages with pipenv.

pipenv install --dev

Test

Execute all tests, it will take some minutes.

cd pets
python manage.py test

Please, do not commit changes if any test fails. Ask for help here instead.

pets's People

Contributors

cuducos avatar diogum avatar dirtycoder avatar jllorencetti avatar paulo-romano avatar themayarose avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pets's Issues

Minimize customization in Travis, Coveralls and Code Climate

Hi all,

I've been analyzing some files and IMHO there are a lot of settings in .travis.yml and .codeclimate.yml that requires more maintenance than it should. And I would like to minimize this. Some ideas (not sure if all of them are feasible):

.travis.yml

  • Less (or at least more readable env vars): one per line, or (even better) use python-decouple (already a dependency I guess; or even os.environ) to set those values as defaults in the app it self;
  • Do we really need to test for 3.4 and 3.5? We should go for a specific version I guess (and be sure that it passes);
  • As I might touch on database configuration for the last item, any pro or con of working with dj-database-url? I like it;
  • coverage command requires us to manually add each app, there might be a better way to set this include/exclude argument that requires less maintenance.

.codeclimate.yml

  • exclude_paths requires us to manually manage it, there might be a better way to set this that requires less maintenance;
  • languages: do we need Ruby, JS and PHP?

I'm willing to tackle this list (if we all agree that they are valid claims) and surely take #21 into account. What do you think?

Mobile app

Maybe a mobile app could even improve the usage rate of the application.

I believe we could use something like Xamarin or React Native?
But I don't know if it's really useful, as the store fee is kinda prohibitive for a nonprofit project.

Ideally this will required some coordination with #18.

Automatically send email to users after some time

Create a management command to send email to users after a given amount of months requesting information about the status of their pet.

Something like this, but much more polite:
Was it found/adopted? Please update the status within the app.

New logo for Pets

Hello, I designed several logos for Pets. If you like any of these, I will send you a pr and files.

Also, If there's anything you want, I can design it.

pets

Set up a demo instance

A few projects have a button to deploy to Heroku, OpenShift, etc.
I think it's a nice way for people to take a look at a running instance.
But I need to check the docs to see how much changes would be necessary in the project.

Also I think it'd be easy to have a running demo in @pythonanywhere, I could probably create a scheduled task to recreate everything in a daily basis with an updated version of the next branch.

Example repos:
@quokkaproject's Quokka
@heroku's Template

Docs:
Heroku

How to contribute tips

@dirtycoder,

I think that is a good ideia, add some extra information about how to contribute to the project. What do you think about this change in the end of README file?


How to contribute to the project

In order to make development and deploy to production simpler there's two settings module.
'dev' for development and 'prod' for production, both based on the 'base' settings.

Look in the settings modules for environment variables which need to be configured.

Install dependencies and requirements:

#Pillow dependencies
sudo apt-get install python-dev python3.x-dev libjpeg8-dev

#PhantomJS, see the julionc tutorial at https://gist.github.com/julionc/7476620

pip install -r requirements.txt

Improve the UI

The current version is really simplistic.
It could be a lot better.

Some kind of "thank you" page

Maybe after the account creation and after the pet register.

This page could be used to tell the user the next step, like sharing on Facebook, etc.

Simple API endpoint to query latest registered pets

For now this could be very simple and read-only I believe.
But as I would like it to not be a problem for resource usage in case of usage abuse, I think we need something to control the rate of requests.

Fix URLs at meupet/urls.py

The regex for the new URLs are wrong. It's capturing everything (obviously).
Change it for a less hungry expression.

Demo

i would love to see this in action. Any demo?

How can I translate kinds of pets?

Hi!
I am trying to translate this app to Russian.
Almost all is good.
But I do not understand how is it possible to translate kins of pets.

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.