From 669c6046b7ee0c53dd76d1cf84c62d8efb576ea6 Mon Sep 17 00:00:00 2001 From: vrokida Date: Mon, 4 Jan 2016 23:40:17 -0500 Subject: [PATCH 1/3] add --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 4625c6194..083082c27 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ gunicorn==19.3.0 psycopg2==2.6 SQLAlchemy==1.0.4 whitenoise==1.0.6 +nose>=1.3.0 From c4fa0bf218947f82d2b1e66b4ebf872ae74f3877 Mon Sep 17 00:00:00 2001 From: vrokida Date: Mon, 4 Jan 2016 23:48:07 -0500 Subject: [PATCH 2/3] add --- gettingstarted/__init__.py | 0 gettingstarted/settings.py | 122 ------------------------------- gettingstarted/static/humans.txt | 0 gettingstarted/urls.py | 17 ----- gettingstarted/wsgi.py | 17 ----- hello/__init__.py | 0 hello/admin.py | 3 - hello/models.py | 5 -- hello/static/lang-logo.png | Bin 2217 -> 0 bytes hello/templates/base.html | 83 --------------------- hello/templates/db.html | 21 ------ hello/templates/index.html | 48 ------------ hello/tests.py | 3 - hello/views.py | 20 ----- manage.py | 10 --- 15 files changed, 349 deletions(-) delete mode 100644 gettingstarted/__init__.py delete mode 100644 gettingstarted/settings.py delete mode 100644 gettingstarted/static/humans.txt delete mode 100644 gettingstarted/urls.py delete mode 100644 gettingstarted/wsgi.py delete mode 100644 hello/__init__.py delete mode 100644 hello/admin.py delete mode 100644 hello/models.py delete mode 100644 hello/static/lang-logo.png delete mode 100644 hello/templates/base.html delete mode 100644 hello/templates/db.html delete mode 100644 hello/templates/index.html delete mode 100644 hello/tests.py delete mode 100644 hello/views.py delete mode 100755 manage.py diff --git a/gettingstarted/__init__.py b/gettingstarted/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/gettingstarted/settings.py b/gettingstarted/settings.py deleted file mode 100644 index 24b9558ec..000000000 --- a/gettingstarted/settings.py +++ /dev/null @@ -1,122 +0,0 @@ -""" -Django settings for gettingstarted project, on Heroku. Fore more info, see: -https://github.com/heroku/heroku-django-template - -For more information on this file, see -https://docs.djangoproject.com/en/1.8/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.8/ref/settings/ -""" - -import os -import dj_database_url - - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(__file__)) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'i+acxn5(akgsn!sr4^qgf(^m&*@+g1@u^t@=8s@axc41ml*f=s' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -TEMPLATE_DEBUG = True - - -# Application definition - -INSTALLED_APPS = ( - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', - 'hello' -) - -MIDDLEWARE_CLASSES = ( - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', - 'django.middleware.security.SecurityMiddleware', -) - -ROOT_URLCONF = 'gettingstarted.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'gettingstarted.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/1.8/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - -# Internationalization -# https://docs.djangoproject.com/en/1.8/topics/i18n/ - -LANGUAGE_CODE = 'en-us' -TIME_ZONE = 'UTC' -USE_I18N = True -USE_L10N = True -USE_TZ = True - - -# Parse database configuration from $DATABASE_URL -DATABASES['default'] = dj_database_url.config() - -# Enable Connection Pooling (if desired) -DATABASES['default']['ENGINE'] = 'django_postgrespool' - -# Honor the 'X-Forwarded-Proto' header for request.is_secure() -SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') - -# Allow all host headers -ALLOWED_HOSTS = ['*'] - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/1.8/howto/static-files/ - -BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -STATIC_ROOT = 'staticfiles' -STATIC_URL = '/static/' - -STATICFILES_DIRS = ( - os.path.join(BASE_DIR, 'static'), -) - -# Simplified static file serving. -# https://warehouse.python.org/project/whitenoise/ -STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage' - diff --git a/gettingstarted/static/humans.txt b/gettingstarted/static/humans.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/gettingstarted/urls.py b/gettingstarted/urls.py deleted file mode 100644 index 56e521f0e..000000000 --- a/gettingstarted/urls.py +++ /dev/null @@ -1,17 +0,0 @@ -from django.conf.urls import patterns, include, url - -from django.contrib import admin -admin.autodiscover() - -import hello.views - -urlpatterns = patterns('', - # Examples: - # url(r'^$', 'gettingstarted.views.home', name='home'), - # url(r'^blog/', include('blog.urls')), - - url(r'^$', hello.views.index, name='index'), - url(r'^db', hello.views.db, name='db'), - url(r'^admin/', include(admin.site.urls)), - -) diff --git a/gettingstarted/wsgi.py b/gettingstarted/wsgi.py deleted file mode 100644 index 620b37498..000000000 --- a/gettingstarted/wsgi.py +++ /dev/null @@ -1,17 +0,0 @@ -""" -WSGI config for gettingstarted project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ -""" - -import os -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gettingstarted.settings") - -from django.core.wsgi import get_wsgi_application -from whitenoise.django import DjangoWhiteNoise - -application = get_wsgi_application() -application = DjangoWhiteNoise(application) \ No newline at end of file diff --git a/hello/__init__.py b/hello/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/hello/admin.py b/hello/admin.py deleted file mode 100644 index 8c38f3f3d..000000000 --- a/hello/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.contrib import admin - -# Register your models here. diff --git a/hello/models.py b/hello/models.py deleted file mode 100644 index 89d76fd1b..000000000 --- a/hello/models.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.db import models - -# Create your models here. -class Greeting(models.Model): - when = models.DateTimeField('date created', auto_now_add=True) diff --git a/hello/static/lang-logo.png b/hello/static/lang-logo.png deleted file mode 100644 index f04aff1e38eeaeadba93390eb5cd356388b8a9f7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2217 zcmaJ@c~}!?8V{ES5J5Ras&x#4Sjb5@5(!5xzz~)VpeP8&WPm)7Og4-ru!tat1eHTn zltSYHA_!`w93BV~D@C_zU8Rby1Vxl08WH5yPAJ%Y_HjEi-+bTu&ii}c-+TNq%8+1x zGZQ-#6bfY)7{KHqyHK~#^N_dn*`Y9GTMDxx;7}+Qmh)vG%1;Pw1%W^@KMv%9d|~oG zIzTTJ%D_n!76C_agQx;XjN|KUa0;;$L8DM!J_;#ckO0EKRxnN^p<&)$ZovQ|Aq}&^ zjZ5H48DP99AVmg-rUZuxQW69dA;!lW@KR6_2VxNB0}64XB#Ek^VP^bNk+V*X#{e@X zZ~_hU2dM~d2*7}3AmD~`#|j8UGT=eM5#8K9C>|~V36b#xPdtf$B~Yktu2cdEn7uGa zG?_4#%44!;V<8d^6A!~uDjqMF%W-m793+dw6Dbr5oq!3gUTS60}VwK>87DKLmkb!&{l7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OS|{}sjZMf~`>?F9|49b2BXZ|a<`y5ZfN;1!k$svfLtLywy& zIoS&W&K};E%B4;|W?6#tn-*F2D`RR-b;Ol7|F+Sx!oaQ;^COo9cC(uMOrLd!TcBBhA$<`#BgBvnSY=qCk>`Ij*84tM aZ$a%}dZnx*#!~kSf(m2>Gtbhu?D`$|L6nF9 diff --git a/hello/templates/base.html b/hello/templates/base.html deleted file mode 100644 index b3da1dbd7..000000000 --- a/hello/templates/base.html +++ /dev/null @@ -1,83 +0,0 @@ - - - -GettingStarted - - - - - - - - -{% block content %}{% endblock %} - - - diff --git a/hello/templates/db.html b/hello/templates/db.html deleted file mode 100644 index e0e03d4c6..000000000 --- a/hello/templates/db.html +++ /dev/null @@ -1,21 +0,0 @@ -{% extends "base.html" %} -{% load staticfiles %} - -{% block content %} -
- - -

Page View Report

- - -
    - -{% for greeting in greetings %} -
  • {{ greeting.when }}
  • -{% endfor %} - -
- -
- -{% endblock %} \ No newline at end of file diff --git a/hello/templates/index.html b/hello/templates/index.html deleted file mode 100644 index 23eb9d16c..000000000 --- a/hello/templates/index.html +++ /dev/null @@ -1,48 +0,0 @@ -{% extends "base.html" %} -{% load staticfiles %} - -{% block content %} - -
-
- -

Getting Started with Python on Heroku

-

This is a sample Python application deployed to Heroku. It's a reasonably simple app - but a good foundation for understanding how to get the most out of the Heroku platform.

- Getting Started with Python - Source on GitHub -
-
-
- -
-
-
-

How this sample app works

-
    -
  • This app was deployed to Heroku, either using Git or by using Heroku Button on the repository.
  • - -
  • When Heroku received the source code, it grabbed all the dependencies in the requirements.txt file.
  • -
  • The platform then spins up a dyno, a lightweight container that provides an isolated environment in which the slug can be mounted and executed.
  • -
  • You can scale your app, manage it, and deploy over 150 add-on services, from the Dashboard or CLI.
  • -
  • Check out the Getting Started guide to learn more!
  • -
-
- -
- -
-{% endblock %} \ No newline at end of file diff --git a/hello/tests.py b/hello/tests.py deleted file mode 100644 index 7ce503c2d..000000000 --- a/hello/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/hello/views.py b/hello/views.py deleted file mode 100644 index 8558d8451..000000000 --- a/hello/views.py +++ /dev/null @@ -1,20 +0,0 @@ -from django.shortcuts import render -from django.http import HttpResponse - -from .models import Greeting - -# Create your views here. -def index(request): - # return HttpResponse('Hello from Python!') - return render(request, 'index.html') - - -def db(request): - - greeting = Greeting() - greeting.save() - - greetings = Greeting.objects.all() - - return render(request, 'db.html', {'greetings': greetings}) - diff --git a/manage.py b/manage.py deleted file mode 100755 index eb3ab8af5..000000000 --- a/manage.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gettingstarted.settings") - - from django.core.management import execute_from_command_line - - execute_from_command_line(sys.argv) From 7dcb66456bb739cb15c11e194fbae9adb222f677 Mon Sep 17 00:00:00 2001 From: vrokida Date: Mon, 4 Jan 2016 23:50:52 -0500 Subject: [PATCH 3/3] add --- hello.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 hello.py diff --git a/hello.py b/hello.py new file mode 100644 index 000000000..b5523d7c9 --- /dev/null +++ b/hello.py @@ -0,0 +1,8 @@ +import os +from flask import Flask + +app = Flask(__name__) + +@app.route('/') +def hello(): + return 'Hello World!'