Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
5939637
Created README.md
CCallahanIV Feb 2, 2017
158dae7
editing
CCallahanIV Feb 2, 2017
cba922b
Added members and link to repo.
CCallahanIV Feb 2, 2017
9f72f77
Update README.md
CCallahanIV Feb 8, 2017
bbe996f
Updated for difficulty rankings.
CCallahanIV Feb 8, 2017
2549ac1
Updated README to rank user and dev stories.
CCallahanIV Feb 9, 2017
2b9924d
Initial commit - creation of app architecture.
CCallahanIV Feb 13, 2017
c7ff6dc
adding requirements.pip
JSchatzman Feb 13, 2017
02a9e9c
adding media folder
JSchatzman Feb 13, 2017
1855a9e
Adding Media file.
CCallahanIV Feb 13, 2017
a430c15
Merge branch 'setup' of https://github.com/CCallahanIV/PyChart into s…
CCallahanIV Feb 13, 2017
578a0ed
beginning structure and framework of site.
chamberi Feb 13, 2017
8e4daaf
Removed pkg-resources from requirements.pip
CCallahanIV Feb 13, 2017
eb4c73f
Merge branch 'front-end-setup' of https://github.com/CCallahanIV/PyCh…
CCallahanIV Feb 13, 2017
629f180
setting up models and database
JSchatzman Feb 13, 2017
1efac27
Updated settings file with environmental variables, updated navbar in…
CCallahanIV Feb 13, 2017
63bdeee
fixing some bugs in models and adding apps to setting.py
JSchatzman Feb 13, 2017
d3d74aa
changing models and adding render folder
JSchatzman Feb 13, 2017
aa75dc4
adding models update
JSchatzman Feb 13, 2017
ac92f52
Merge pull request #26 from CCallahanIV/setup
CCallahanIV Feb 13, 2017
7dd0967
Created render/ directory in MEDIA. Moved demo files in there.
CCallahanIV Feb 13, 2017
4a53a23
fixing conflict in settings.py
JSchatzman Feb 13, 2017
e67ed7f
added beginnings of registration.
chamberi Feb 13, 2017
5289dcc
adding shell of views
JSchatzman Feb 13, 2017
954ba6b
registration pages mostly fixed.
chamberi Feb 13, 2017
2279cc6
adding URLS and models to admin
JSchatzman Feb 13, 2017
996c276
gotta close the bracket
JSchatzman Feb 13, 2017
80f4e3e
block content.
chamberi Feb 13, 2017
4925661
forgot to remove a tag at bottom of login, done.
chamberi Feb 13, 2017
f8a272c
Merge branch 'development' into registration
CCallahanIV Feb 13, 2017
3626aa7
Merge pull request #28 from CCallahanIV/registration
CCallahanIV Feb 13, 2017
f54d121
Merge pull request #29 from CCallahanIV/setup
CCallahanIV Feb 13, 2017
b702196
Added pychart_profile model and views.
CCallahanIV Feb 13, 2017
58f3882
Merge branch 'development' of https://github.com/CCallahanIV/PyChart …
CCallahanIV Feb 13, 2017
bbc4485
Added pychart_profile views and templates.
CCallahanIV Feb 13, 2017
2736dd5
Removed duplicate header in user_profile template.
CCallahanIV Feb 13, 2017
4e5a31b
Merge pull request #30 from CCallahanIV/pychart_profile
chamberi Feb 13, 2017
9f67d41
added sqlite3 to .gitignore
CCallahanIV Feb 13, 2017
f02f56d
Merge branch 'development' of https://github.com/CCallahanIV/PyChart …
CCallahanIV Feb 13, 2017
9bb4391
render tests, with modified models file.
chamberi Feb 14, 2017
f4ea67e
Wrote tests for profile model and front end.
CCallahanIV Feb 14, 2017
1c964ca
Merge pull request #31 from CCallahanIV/test_renders
CCallahanIV Feb 14, 2017
80ff70e
adding tests for data
JSchatzman Feb 14, 2017
f9f8b2f
Merge pull request #32 from CCallahanIV/pychart_profile
chamberi Feb 14, 2017
2b89693
Merge branch 'development' into setup
JSchatzman Feb 14, 2017
de98231
Merge pull request #33 from CCallahanIV/setup
JSchatzman Feb 14, 2017
24887af
first go at the views and templates for adding data
JSchatzman Feb 14, 2017
33facaa
can now add data set
JSchatzman Feb 14, 2017
abb3655
Commiting small changes before pull.
CCallahanIV Feb 14, 2017
65bb0af
please merge
CCallahanIV Feb 14, 2017
399a0cb
adding detail page
JSchatzman Feb 14, 2017
e13f056
almost have working edit data view
JSchatzman Feb 14, 2017
4363a79
we have working edit data
JSchatzman Feb 14, 2017
2e093b6
working templates now and tests that work but not together
JSchatzman Feb 14, 2017
766923e
Initial work on data rendering, some style updates.
CCallahanIV Feb 14, 2017
f8d0f94
deleted old test file
JSchatzman Feb 14, 2017
e4c8cd3
Merge pull request #34 from CCallahanIV/adddata
chamberi Feb 14, 2017
58557e2
added gallery, lirbary, and render detail templates, views, images, etc.
chamberi Feb 14, 2017
295746b
resolving merge conflict.
chamberi Feb 14, 2017
d8ed59d
Merge pull request #36 from CCallahanIV/datarender_views_colin
JSchatzman Feb 14, 2017
db39404
5 tests, fixed some views, added auth for home page nav, sec for gall…
chamberi Feb 14, 2017
b973d88
Added javascript for ajax to and from render page. Created template f…
CCallahanIV Feb 15, 2017
e0e7487
Update views.py
chamberi Feb 15, 2017
8fc16b2
Merge branch 'development' into render-add-view
chamberi Feb 15, 2017
bda626e
Merge pull request #38 from CCallahanIV/render-add-view
chamberi Feb 15, 2017
700d712
docstring added to pychart_datarender test file.
chamberi Feb 15, 2017
182b339
Merge branch 'development' into test_view_gal_lib
CCallahanIV Feb 15, 2017
3a830e0
Merge pull request #39 from CCallahanIV/test_view_gal_lib
CCallahanIV Feb 15, 2017
f97883a
Deleted and reperformed migrations.
CCallahanIV Feb 15, 2017
83ae573
trying to fix issue with migrations
JSchatzman Feb 15, 2017
27bec5b
delete again
JSchatzman Feb 15, 2017
953426e
Added render_chart function call to render_data view handler for Jordan.
CCallahanIV Feb 15, 2017
34c9465
Merge branch 'development' of https://github.com/CCallahanIV/PyChart …
JSchatzman Feb 15, 2017
beb9b47
working creation of render html
JSchatzman Feb 15, 2017
ccaf24a
Added form to page to pass along necessary data for Render model.
CCallahanIV Feb 15, 2017
4128ceb
adding first plot method
JSchatzman Feb 15, 2017
4cc4491
render2db in views needs to know what it will get. Took out the br's …
chamberi Feb 15, 2017
0509495
Replaced boston housing file with Jordan's version.
CCallahanIV Feb 15, 2017
45d053b
cleaner version of html generation
JSchatzman Feb 15, 2017
cea5cac
added logo to nav
chamberi Feb 15, 2017
25da90f
Succesfully rendered returned html to page, now re-writing add render…
CCallahanIV Feb 15, 2017
c11e7bb
adding more functionality for scatter and bar
JSchatzman Feb 15, 2017
b3f1ce7
Merge pull request #40 from CCallahanIV/render2db
CCallahanIV Feb 15, 2017
7a8bb8f
remove default file
JSchatzman Feb 15, 2017
e5fe379
Merge branch 'development' into add_render_add_html
chamberi Feb 15, 2017
de6583a
Merge pull request #41 from CCallahanIV/add_render_add_html
chamberi Feb 15, 2017
543de46
Merge branch 'development' into bokehrender
CCallahanIV Feb 15, 2017
71ba126
Merge pull request #42 from CCallahanIV/bokehrender
CCallahanIV Feb 15, 2017
09eb0da
Reformatted add_render page to have unique forms for each chart type,…
CCallahanIV Feb 15, 2017
4502cd5
fixing chart funtions to use front end data
JSchatzman Feb 15, 2017
27eed7c
fixing tests and migrations
JSchatzman Feb 15, 2017
ec0aaba
Merge pull request #44 from CCallahanIV/bokehrender
CCallahanIV Feb 15, 2017
ced2fe6
Merge pull request #43 from CCallahanIV/add_render_forms
JSchatzman Feb 15, 2017
7bf5c23
Commiting after migration
CCallahanIV Feb 15, 2017
3b72fdb
working histogram
JSchatzman Feb 15, 2017
fff1498
tested render functions
JSchatzman Feb 15, 2017
f175471
removed gnureadline==6.3.3 from requirements doc.
Feb 15, 2017
01d889d
changed nav logo and base html, removed gnureadline from requirements.
chamberi Feb 15, 2017
e3361bd
Added ajax method to post to handler function to save render info.
CCallahanIV Feb 15, 2017
6daaad3
Merge pull request #45 from CCallahanIV/render-form
JSchatzman Feb 15, 2017
05946ac
adding tests ad moving them around to appropraite files
JSchatzman Feb 15, 2017
c378a94
FINSHED BY COLIN: updated save_render function to accomodate changes …
CCallahanIV Feb 16, 2017
59c3969
Merge pull request #46 from CCallahanIV/bokehrender
CCallahanIV Feb 16, 2017
e8d5243
Merge pull request #47 from CCallahanIV/save_profile
JSchatzman Feb 16, 2017
89e5213
adding changes to render_detail template.
CCallahanIV Feb 16, 2017
4e4c4b9
Removed console.logs
CCallahanIV Feb 16, 2017
261c010
Merge pull request #48 from CCallahanIV/ansible
JSchatzman Feb 16, 2017
06b19e1
succesfully re-rendering html chart renders on detail view.
CCallahanIV Feb 16, 2017
306750d
home page random rendered chart.
chamberi Feb 16, 2017
bf25e9a
Merge pull request #49 from CCallahanIV/render_detail
JSchatzman Feb 16, 2017
cb17774
Merge branch 'development' of https://github.com/CCallahanIV/PyChart …
chamberi Feb 16, 2017
4f17eb6
small changes on line spacing
CCallahanIV Feb 16, 2017
20c9fdb
Wrote tests and small changes to line spacing in views.
CCallahanIV Feb 16, 2017
6020208
edit render function, lots of pages edited for consisentency and styl…
chamberi Feb 16, 2017
62943d3
Merge pull request #50 from CCallahanIV/render_detail
chamberi Feb 16, 2017
5f59eea
fixing colors on histogram and populating table on data detail view
JSchatzman Feb 16, 2017
ea950e1
Merge pull request #51 from CCallahanIV/update_hp
CCallahanIV Feb 16, 2017
ea1f086
Merge branch 'development' into bokehrender
CCallahanIV Feb 16, 2017
6c0a614
Merge pull request #52 from CCallahanIV/bokehrender
CCallahanIV Feb 16, 2017
572564f
removed add_columns function call.
CCallahanIV Feb 16, 2017
38949ea
changed data-user to be many to maby and fixed every broken test
JSchatzman Feb 16, 2017
ee4d07e
Added url and updated templates to allow user to add existing datasets.
CCallahanIV Feb 16, 2017
6dc6891
Merge pull request #53 from CCallahanIV/add_dataset_from_library
JSchatzman Feb 16, 2017
000a062
Merge branch 'development' into m2m
JSchatzman Feb 16, 2017
ceb842d
ansible files
chamberi Feb 16, 2017
1575165
user can now add dataset to profile
JSchatzman Feb 16, 2017
5bebe7e
Merge pull request #54 from CCallahanIV/m2m
CCallahanIV Feb 16, 2017
b10f290
fixed responsiveness of library and gallery, added edit links, format…
chamberi Feb 16, 2017
7f078b8
Merge branch 'development' into gal_lib_cleanup
CCallahanIV Feb 16, 2017
b01dd05
Merge pull request #55 from CCallahanIV/gal_lib_cleanup
CCallahanIV Feb 16, 2017
29f25ec
Merge branch 'ansible2' of https://github.com/CCallahanIV/PyChart int…
CCallahanIV Feb 16, 2017
8655462
Added vars.yml to gitignore.
CCallahanIV Feb 16, 2017
e0a6032
Removed migration from .gitignore
CCallahanIV Feb 16, 2017
c345d33
Redid migrations for deployment branch.
CCallahanIV Feb 16, 2017
980d95e
Merge branch 'deployment' of https://github.com/CCallahanIV/PyChart i…
CCallahanIV Feb 16, 2017
7b5a011
Removed hosts and vars from deployment branch tracking.
CCallahanIV Feb 16, 2017
b0c2d7d
reconfigured settings.py for deployment.
CCallahanIV Feb 16, 2017
2c6a68d
Removed duplicate bokeh lines from requirements.pip
CCallahanIV Feb 16, 2017
e47c750
Refroze pip.
CCallahanIV Feb 16, 2017
c6bf5b0
updated DB host pointer to env variable.
CCallahanIV Feb 16, 2017
f0522d8
Added password to database section.
CCallahanIV Feb 16, 2017
d1a32eb
Added static root.
CCallahanIV Feb 16, 2017
61605b3
Changed upstart template to export env variables.
CCallahanIV Feb 16, 2017
81dee76
Changed upstart emplate back to env.
CCallahanIV Feb 16, 2017
2c3db5c
debug to False.
CCallahanIV Feb 16, 2017
e629408
Debug True
CCallahanIV Feb 16, 2017
011adf5
Changed email port to 587 from 465
CCallahanIV Feb 16, 2017
d48426d
Updated playbook to change permissions on media sub folder.
CCallahanIV Feb 17, 2017
15f09f8
reworked plotting functions a bit
JSchatzman Feb 17, 2017
e9da413
Added troubleshooting statements to render_data.js, updated playbook.
CCallahanIV Feb 17, 2017
49619df
removed slash
CCallahanIV Feb 17, 2017
3f59996
redid home page, added footer, did a ton of css'ing.
chamberi Feb 17, 2017
59aeb3c
fix some tests and plotting bugs
JSchatzman Feb 17, 2017
3c6a0b2
Update home.html
JSchatzman Feb 17, 2017
7f21ac2
Merge pull request #56 from CCallahanIV/cleanup_hp
JSchatzman Feb 17, 2017
9c082a4
Merge branch 'development' into m2m
JSchatzman Feb 17, 2017
1587619
Merge pull request #57 from CCallahanIV/m2m
chamberi Feb 17, 2017
dd2cf59
Small changes, commitment before migration to deploy.
CCallahanIV Feb 17, 2017
263ceb9
Merge branch 'deployment' into development
CCallahanIV Feb 17, 2017
7faaf82
added a few more tests for checking add owner functionality
JSchatzman Feb 17, 2017
06d1983
Merge pull request #59 from CCallahanIV/m2m
CCallahanIV Feb 17, 2017
72d5185
Refactored retrieve data function to aid testing. Added four tests.
CCallahanIV Feb 17, 2017
0ec2f26
Added tests for save_render
CCallahanIV Feb 17, 2017
8184c0a
added tests, modified views and edit data
chamberi Feb 17, 2017
aa8c4c2
Update views.py
CCallahanIV Feb 17, 2017
d37fd20
Merge pull request #61 from CCallahanIV/db2render_tests
CCallahanIV Feb 17, 2017
ecfaf21
Merge pull request #60 from CCallahanIV/final-tests
JSchatzman Feb 17, 2017
f856d97
Merge pull request #62 from CCallahanIV/development
CCallahanIV Feb 17, 2017
a08f38f
Began DEBRIEF in README, completed review and documentaiton of static…
CCallahanIV Feb 23, 2017
6bca308
Added CSRF protection to AJAX post requests. See csrf_setup.js for a…
CCallahanIV Feb 23, 2017
5c0baa6
Removed preview_table.js, added conditional to update_table to allow …
CCallahanIV Feb 23, 2017
12cd0e1
Added link for profile page to base.html.
CCallahanIV Feb 23, 2017
854be87
Merge pull request #64 from CCallahanIV/int-prep-code-review
CCallahanIV Feb 23, 2017
0d50d7c
Removed login_required decorators from ajax post handlers
CCallahanIV Feb 23, 2017
d2982ef
Merge branch 'master' of https://github.com/CCallahanIV/PyChart
CCallahanIV Feb 24, 2017
7c15800
removed .retry playbook file.
CCallahanIV Feb 24, 2017
1665c97
Refactored add_owner_view to make if/else block cleaner.
CCallahanIV Feb 28, 2017
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
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,20 @@ ENV/

# Rope project settings
.ropeproject

# Coverage reports
*.coverage
*.coveragerc

#Media Folder
pychart/MEDIA/*
!pychart/MEDIA/.gitkeep

#files
TestBook.ipynb
output.html

ansible2_PyChart/vars/vars.yml
ansible2_PyChart/hosts

ansible2_PyChart/playbook2/playbook-pychart.retry
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# [PyChart](https://github.com/CCallahanIV/PyChart)
Code Fellows 401 Python Final Project

## Members:
* Ted Callahan
* Jordan Schatzman
* Colin Lamont

PyChart is web-based application allowing the user a simple sandbox environment in which to upload or access data through API and render and save representations of that data.

## User Stories:
(Relative difficulty rankings are included at the end of each story, or as a part of the story in parenthesis.)
User and Dev stories are ranked in order.

The MVP, INTERMEDIATE, and STRETCH tags below define milestones for our application. Each place represents a potential stopping point were we could present a proof-of-concept. Our MVP goal is to have an application where a user can upload a .csv file, examine the data, and render an chart image. The data and render can saved to a profile.

To add to that, we would like to offer the user some options to customize the render and data. As time allows, we would like to add more options for customization of data and renders.


* As a User...
1. I want to be able to upload a .csv (2), perform very simple data manipulation (6), and render it into a chart (4).
2. I want to store my data and renders on my profile. (3)
-- MVP --
3. I want some simple customization options on my renders (5).
-- INTERMEDIATE --
4. I want to be able to visualize either my data or preexisting data in the form of a scatterplot, histogram or bargraph. (4)
5. I want to be able to download my saved renders. (1)
-- STRETCH --

* As a Developer...
0. I want to share responsibilities with other devs so we all learn. (1)
1. I want the app to be built using django. (2)
2. I want to use a common python library (e.g. bokeh) to manipulate data and render it in a web application. (6)
3. I want to be have 5 tests written per developer per day. (3)
4. I want to host this application on AWS. (5)
5. I want to be able to automate deployments with ansible. (7)

## Git Workflow:

* Git Master - One person in the group will control Pull Requests from development to master and control the deployment pipeline.

* Issue Tracking - Feature Production and issues will be tracked using Waffle. [https://waffle.io/CCallahanIV/PyChart]

* Deployment Branch: master
- All pull requests to master may only be approved by the Git Master.

* Staging Branch: development
- All work will be merged into the development branch via pull request.
- Developers may not merge their own PR, all PR's must be reviewed by another dev.

* Feature Branches: by feature name
- All features should have descriptive names.

* Hotfix-Branches: <feature or development>-hotfix
- Hotfix branches may be made off of any feature branch or the development branch to quickly fix small issues.


#POST PROJECT DEBRIEF:

## Leftover TODOs:
* Implement CSRF protection on form submissions through AJAX calls. (DONE)
* Move bokeh-related functions into separate module, import into views.
* Expand profile related functionality.


## Lessons Learned:
* Plan and design division of tasks between front end and back end prior to writing routes and handlers.
- Django views are great for "static" views.
- Design a RESTful API to serve dynamic requests from front end, from the start.

* Testing a feature as you write is a good workflow, leads to better-reviewed and better-factored code.

* Environmental variables are great not only for security, but for establishing publication and development configuration controls.
- These must be well organized across team members.
- How to control a master list outside of version control?

* Manage migrations in a very deliberate way. Must be appropriately version controlled.

## Questions Moving Forward:
* How to architect application between front and back end frameworks (e.g. React and Django)

* How to correctly implement security measures from the start.
- Are there secure design conventions?
- What are best-practices for ensuring security?

* How to test front end logic (e.g. using Mocha)?

* Using tools and libraries such as Bootstrap are fine for project week and tight time constraints. Professionally, what are the questions to ask to determine whether or not something should be 3rd party or in-house?
- Compromise feature-set, trimming the fat vs. time, expense

113 changes: 113 additions & 0 deletions ansible2_PyChart/playbooks/playbook-pychart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
- hosts: ec2
remote_user: ubuntu
become: yes
become_method: sudo
vars_files:
- ~/Documents/CodeFellows/401/pychart/PyChart/ansible2_PyChart/vars/vars.yml
vars:
env:
PYCHART_DB: "{{PYCHART_DB}}"
DB_USERNAME: "{{DB_USERNAME}}"
DB_PASSWORD: "{{DB_PASSWORD}}"
DB_ENDPOINT: "{{DB_ENDPOINT}}"
SECRET_KEY: "{{SECRET_KEY}}"
EMAIL_HOST_PASSWORD: "{{EMAIL_HOST_PASSWORD}}"
ALLOWED_HOSTS: "{{ALLOWED_HOSTS}}"

tasks:
- name: Update the Ubuntu system and services
apt: update_cache=yes

- name: Upgrade the Ubuntu system
apt: upgrade=yes

- name: Install Basic Unix-level Services
apt: name={{ item }} state=latest
with_items:
- nginx
- python3
- python3-pip
- python3.4-venv
- python-dev
- git
- gunicorn
- libtiff5-dev
- libjpeg8-dev
- zlib1g-dev
- libfreetype6-dev
- liblcms2-dev
- libwebp-dev
- tcl8.6-dev
- tk8.6-dev
- python-tk
- libpq-dev

- name: Clone the Django Imager App to the Home Directory
become: yes
become_method: sudo
git: clone=yes repo={{project_repo}} dest=/home/ubuntu/PyChart version={{branch}}

- name: Create a virtual environment in the django app.
command: python3 -m venv /home/ubuntu/PyChart

- name: Install gunicorn to virtual environment
pip: virtualenv=/home/ubuntu/PyChart name=gunicorn

- name: Install the packages specified in requirements.pip in the Python 3 environment
pip:
requirements: /home/ubuntu/PyChart/requirements.pip
virtualenv: /home/ubuntu/PyChart
virtualenv_python: python3.4

- name: Register the old default file
stat: path=/etc/nginx/sites-available/default.orig
register: default_stat

- name: Rename old default file
command: mv /etc/nginx/sites-available/default /etc/nginx/sites-available/default.orig
when: not default_stat.stat.exists

- name: Create a new default file for nginx
template: src=../templates/nginx_config.jinja2 dest=/etc/nginx/sites-available/default

- name: Copy upstart script into /etc/init/
template: src=../templates/upstart_config.jinja2 dest=/etc/init/pychart.conf

- name: Restart nginx service
service: name=nginx state=restarted

- name: Migrate Django models to database
django_manage:
command: migrate
app_path: /home/ubuntu/PyChart/pychart
virtualenv: /home/ubuntu/PyChart
environment: "{{env}}"

- name: Collect static files
django_manage:
command: collectstatic
app_path: /home/ubuntu/PyChart/pychart
virtualenv: /home/ubuntu/PyChart
environment: "{{env}}"

- name: Change permissions on media folder
file:
path: "{{media_root}}"
state: touch
mode: 0777

- name: Change permissions on media/data
file:
path: "{{media_root}}/data"
state: touch
mode: 0777

- name: Change permissions on media/data
file:
path: "{{media_root}}/../../pychart"
state: touch
mode: 0777

- name: Restart the imager upstart job
service: name="pychart" state=restarted
20 changes: 20 additions & 0 deletions ansible2_PyChart/templates/nginx_config.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
server {
listen 80;
server_name {{ server_name }}
access_log /var/log/nginx/test.log;

location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /static/ {
autoindex on;
alias /home/ubuntu/PyChart/pychart/pychart/static/;
}
location /media/ {
autoindex on;
alias /home/ubuntu/PyChart/pychart/MEDIA/;
}
}
19 changes: 19 additions & 0 deletions ansible2_PyChart/templates/upstart_config.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
description "PyChart"

start on (filesystem)
stop on runlevel [016]

respawn
setuid nobody
setgid nogroup
chdir {{install_root}}/{{ app_name }}/pychart

env PYCHART_DB='{{PYCHART_DB}}'
env DB_USERNAME='{{DB_USERNAME}}'
env DB_PASSWORD='{{DB_PASSWORD}}'
env DB_ENDPOINT='{{DB_ENDPOINT}}'
env SECRET_KEY='{{SECRET_KEY}}'
env EMAIL_HOST_PASSWORD='{{EMAIL_HOST_PASSWORD}}'
env ALLOWED_HOSTS='{{ALLOWED_HOSTS}}'

exec /home/ubuntu/PyChart/bin/gunicorn -b :8080 pychart.wsgi:application
Empty file added pychart/MEDIA/.gitkeep
Empty file.
Loading