Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CP4 #1

Open
wants to merge 90 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
cd0ae2d
[Feature] created image model
penny-wanjiru Jun 7, 2016
0dc39d7
[Feature] create landing page
penny-wanjiru Jun 7, 2016
fd395e5
[Feature] create landing page
penny-wanjiru Jun 7, 2016
141498b
[Feature] created login page
penny-wanjiru Jun 8, 2016
8f8fba1
[Feature] added facebook auth
penny-wanjiru Jun 8, 2016
14cbd96
[Feature] created api serializers and changed models
penny-wanjiru Jun 14, 2016
34b0933
[Feature] create image view
penny-wanjiru Jun 14, 2016
b656751
[Feature] added basic auth and image get and post views
penny-wanjiru Jun 15, 2016
222819f
[Feature] added delete view
penny-wanjiru Jun 16, 2016
b19cc4c
[Feature] added upload button and sidebar
penny-wanjiru Jun 16, 2016
1807398
[Feature] create upload image component
penny-wanjiru Jun 19, 2016
e19d8e1
[Feature] added cards to render unedited images
penny-wanjiru Jun 23, 2016
69353b2
[Feature] added cards for uploaded photos
penny-wanjiru Jun 23, 2016
06f4b59
[feature] set state for images
penny-wanjiru Jun 26, 2016
3916814
[Feature #121027233] render image on canvas
penny-wanjiru Jun 27, 2016
ca24a8e
[Feature #121027233] render image on the maincanvas
penny-wanjiru Jun 27, 2016
47396e6
[Feature#121027233] resize canvas
penny-wanjiru Jun 27, 2016
11f4eab
[Feature] added serializers and models for edited images
penny-wanjiru Jun 28, 2016
32a4a00
[Feature #123578141] added filters on images
penny-wanjiru Jun 29, 2016
c27d8b1
[Feature #123578141] added filter to images and displayed the filters
penny-wanjiru Jul 1, 2016
dcf51e8
[Feature#123578141] render filtered images on main canvas
penny-wanjiru Jul 1, 2016
b31c204
[Feature #121026851] connect user login with main app
penny-wanjiru Jul 3, 2016
714a6ac
[feature#122422691] add canvas delete clear and download buttons
penny-wanjiru Jul 4, 2016
2d3651b
[Feature#121027263] add facebook share
penny-wanjiru Jul 4, 2016
b6f63a8
[chore] add proc file
penny-wanjiru Jul 4, 2016
0c260ae
[chore] remove static from gitignore
penny-wanjiru Jul 4, 2016
139ffc1
[chore] add dj static
penny-wanjiru Jul 4, 2016
28700e0
[chore] add production settings
penny-wanjiru Jul 4, 2016
9e26ea5
[chore] install django envie
penny-wanjiru Jul 4, 2016
3300861
[chore] change static reference
penny-wanjiru Jul 4, 2016
7a85e64
[chore] change production settings
penny-wanjiru Jul 4, 2016
5cd893a
[chore] add heroku as social application
penny-wanjiru Jul 5, 2016
92a82e0
[chore] add fixtures
penny-wanjiru Jul 5, 2016
8b6aa2b
[chore] add fixtures in folder
penny-wanjiru Jul 5, 2016
1a8e56e
[chore] change fixtures
penny-wanjiru Jul 5, 2016
4275957
[chore] react changes for deployment
penny-wanjiru Jul 6, 2016
9025990
[chore] add media cling to wsgi
penny-wanjiru Jul 6, 2016
dc80935
[chore] add edited photos upload path
penny-wanjiru Jul 6, 2016
96ccdb4
[chore] create path for filtered photos
penny-wanjiru Jul 6, 2016
c596d84
[Feature] add filter names on UI
penny-wanjiru Jul 6, 2016
eaa5d1c
[chore] add readme
penny-wanjiru Jul 6, 2016
c3c89eb
[chore] refactor code
penny-wanjiru Jul 7, 2016
fe17b9a
[Feature#125583331] Write tests
penny-wanjiru Jul 7, 2016
9441544
[Chore] comment code
penny-wanjiru Jul 7, 2016
183fd1d
[Chore] added travis file
penny-wanjiru Jul 7, 2016
5c54394
[Chore] changed travis file
penny-wanjiru Jul 7, 2016
b789261
[fix] fix settings
penny-wanjiru Jul 7, 2016
af11e43
[fix] fix travis file
penny-wanjiru Jul 8, 2016
53625db
[fix] fix travis file
penny-wanjiru Jul 8, 2016
a12a398
[fix] fix travis file
penny-wanjiru Jul 8, 2016
b4af286
[fix] add secret key
penny-wanjiru Jul 8, 2016
1737808
[Fix] travis file
penny-wanjiru Jul 8, 2016
b1f9a64
[Fix] travis file
penny-wanjiru Jul 8, 2016
0347a17
[Fix] add setting path
penny-wanjiru Jul 8, 2016
4562e81
[Fix] add secret key to travis
penny-wanjiru Jul 8, 2016
64f74d1
[Fix] add env file
penny-wanjiru Jul 8, 2016
56a1843
[Fix] fix env file
penny-wanjiru Jul 8, 2016
f0e9b9d
[chore] add media to urls
penny-wanjiru Jul 8, 2016
c76d3a2
[fix] urls path to media
penny-wanjiru Jul 8, 2016
07c2499
[fix] urls path in filters.py
penny-wanjiru Jul 8, 2016
cc84ead
[chore] add coverarc file
penny-wanjiru Jul 8, 2016
0bfb81e
[chore] add coveralls and travis badges to readme
penny-wanjiru Jul 8, 2016
3daf298
[fix] fix run commands in travis
penny-wanjiru Jul 8, 2016
8e9e88c
[fix] owner access
penny-wanjiru Jul 8, 2016
ddec4c5
[fix] fix list of filters
penny-wanjiru Jul 8, 2016
0e954c3
[chore] Refactor code
penny-wanjiru Jul 8, 2016
3932064
[chore] refactor code
penny-wanjiru Jul 8, 2016
a7f0bff
[chore] refactor code
penny-wanjiru Jul 8, 2016
b77e467
[fix] facebook redirect
penny-wanjiru Jul 8, 2016
bdfdbe0
[Fix] refactor code
penny-wanjiru Jul 12, 2016
bcb27d4
[Chore] add toasts and change UI
penny-wanjiru Jul 14, 2016
427b996
[Fix] facebook share
penny-wanjiru Jul 16, 2016
5f8b5e6
[Chore] add facebook share file
penny-wanjiru Jul 16, 2016
20084b2
[fix] changes facebook settings
penny-wanjiru Jul 16, 2016
2c79bd2
[Chore] refactor code
penny-wanjiru Jul 16, 2016
ad071bc
[Chore] refactor code
penny-wanjiru Jul 17, 2016
e3b9ce8
Delete 160222Andeladies008.psd
penny-wanjiru Jul 23, 2016
34a57da
Delete minimal logo file
penny-wanjiru Jul 23, 2016
8362cdd
[Fix] remove static files
penny-wanjiru Jul 23, 2016
67d217f
[Fix] remove unused images
penny-wanjiru Jul 23, 2016
7f6bd48
[chore] move logo to images dir
penny-wanjiru Jul 23, 2016
f940492
[chore] refactor code
penny-wanjiru Jul 23, 2016
df38aec
[fix] fix delete error
penny-wanjiru Jul 23, 2016
f6e441f
[fix] fix delete error
penny-wanjiru Jul 23, 2016
0720602
[fix] fix delete error
penny-wanjiru Jul 23, 2016
b3426d1
[Chore] remove facebook share and download button when there is no image
penny-wanjiru Jul 24, 2016
3dead2d
[Chore] add clear on delete
penny-wanjiru Jul 25, 2016
2b4093f
[Feature] add set class active on filters
penny-wanjiru Jul 25, 2016
f0788da
[Chore] add pointer cursor on filters
penny-wanjiru Jul 25, 2016
7e70908
[Chore] refactor code
penny-wanjiru Jul 25, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015", "react"]
}
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[report]
omit =
*/python?.?/*
*/site-packages/*
*__init__*
*/migrations/*
5 changes: 5 additions & 0 deletions .env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
DB_USER: 'postgres'

DB_PASSWORD: 'Andela2015'

SECRET_KEY: '&gj3fvzp2p@lh2eo^1w618g4nd!3ztlhg8jl)^z+qr4iv+zdez'
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
venv/*
pytest

staticfiles/
.coverage
staticfiles/*
.coverage
node_modules
media/*



18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: python
python:
- "2.7"
branches:
only:
- develop
services:
- postgresql
before_install:
- "pip install -r requirements.txt"
install:
- "pip install coveralls"
env:
- SECRET_KEY='&gj3fvzp2p@lh2eo^1w618g4nd!3ztlhg8jl)^z+qr4iv+zdez'
script:
- coverage run manage.py test --noinput --settings=photogenic.settings.test
after_success:
- coveralls
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: python manage.py migrate; gunicorn photogenic.wsgi --pythonpath=photogenic --log-file -
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[![Build Status](https://travis-ci.org/andela-pwanjiru/Photogenic.svg?branch=develop)](https://travis-ci.org/andela-pwanjiru/Photogenic)
[![Coverage Status](https://coveralls.io/repos/github/andela-pwanjiru/Photogenic/badge.svg)](https://coveralls.io/github/andela-pwanjiru/Photogenic)

# Photogenic app

This app allows you to upload images, add filters to them and share on facebook.It consists of a django Rest API and a frontend built with react.

# Dependencies:
###Backend dependencies:
Django - The backbone upon which this REST API is built upon. It's a Python web framework that features models, views, url routes and user management among many other features.

Django REST framework - This is a powerful and flexible toolkit for building browsable REST APIs. It includes support for model serialization, permissions (default and custom) and viewsets among other features.

Pillow - Python Image Manipulation Library
###Frontend dependencies:

Materialize CSS - The front end framework from which all the elements and controls on the front end have been created.

React - React makes it painless to create interactive UIs.

# Features:
* A user can log in with facebook.
* A user is authenticated.
* A user can Upload images.
* A user can apply filters to the images.
* A user download the edited image.
* A user can logout.

## Usage:

* Clone the repo: [email protected]:andela-pwanjiru/Photogenic.git

* Install requirements.
`pip install -r requirements.txt`

* Install the project's database. PostgreSQL was used for this checkpoint.

* Install frontend dependencies as described in the package.json file.
* After installation, create a database on PostgreSQL for this app.
* Perform database migrations.
`python manage.py makemigrations `
`python manage.py migrate `

* Run the application
`python manage.py runserver`


## Testing
To run tests:
`python manage.py test`
Empty file added main/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions main/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
7 changes: 7 additions & 0 deletions main/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from __future__ import unicode_literals

from django.apps import AppConfig


class MainConfig(AppConfig):
name = 'main'
44 changes: 44 additions & 0 deletions main/filters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import os

from photogenic import settings
from PIL import Image, ImageFilter


def apply_effect(filter, image):
"""Method to handle applying of filters to images"""
original = Image.open(image)
path = settings.base.MEDIA_ROOT + '/editedphotos/'
if not os.path.exists(path):
os.makedirs(path)
file_path = path + filter + '-' + os.path.basename(image.name)
if filter == 'blur':
blurred = original.filter(ImageFilter.BLUR)
blurred.save(file_path)
elif filter == 'contour':
contour = original.filter(ImageFilter.CONTOUR)
contour.save(file_path)
elif filter == 'sharpen':
sharpen = original.filter(ImageFilter.SHARPEN)
sharpen.save(file_path)
elif filter == 'smooth':
smooth = original.filter(ImageFilter.SMOOTH)
smooth.save(file_path)
elif filter == 'smooth_more':
smooth_more = original.filter(ImageFilter.SMOOTH_MORE)
smooth_more.save(file_path)
elif filter == 'emboss':
emboss = original.filter(ImageFilter.EMBOSS)
emboss.save(file_path)
elif filter == 'detail':
detail = original.filter(ImageFilter.DETAIL)
detail.save(file_path)
elif filter == 'edge_enhance':
edge_enhance = original.filter(ImageFilter.EDGE_ENHANCE)
edge_enhance.save(file_path)
elif filter == 'edge_enhance_more':
edge_enhance_more = original.filter(ImageFilter.EDGE_ENHANCE_MORE)
edge_enhance_more.save(file_path)
elif filter == 'find_edges':
find_edges = original.filter(ImageFilter.FIND_EDGES)
find_edges.save(file_path)
return file_path[6:]
Loading