瀏覽代碼

Merge branch 'master' of github.com:wagtail/bakerydemo

Edd Baldry 8 年之前
父節點
當前提交
0db1cefea6
共有 8 個文件被更改,包括 71 次插入2 次删除
  1. 2 1
      Procfile
  2. 16 0
      app.json
  3. 16 0
      bakerydemo/base/migrations/0005_merge_20170210_1551.py
  4. 6 0
      bakerydemo/heroku_wsgi.py
  5. 24 0
      bakerydemo/settings/heroku.py
  6. 0 1
      bin/post_compile
  7. 2 0
      readme.md
  8. 5 0
      requirements.txt

+ 2 - 1
Procfile

@@ -1 +1,2 @@
-web: uwsgi --http :$PORT --module bakerydemo.wsgi --master --offload-threads 1
+release: yes "yes" | python manage.py migrate
+web: uwsgi --http :$PORT --module bakerydemo.heroku_wsgi --master --offload-threads 1

+ 16 - 0
app.json

@@ -0,0 +1,16 @@
+{
+  "name": "WagtailBakeryDemo",
+  "description": "WagtailBakeryDemo",
+  "repository": "https://github.com/wagtail/bakerydemo",
+  "logo": "http://wagtail.io/static/wagtailsite/images/navlogo2.png",
+  "keywords": ["wagtail", "django"],
+  "env": {
+    "DJANGO_SETTINGS_MODULE": "bakerydemo.settings.heroku"
+  },
+  "scripts": {
+    "postdeploy": "django-admin.py migrate && django-admin.py load_initial_data && echo 'from wagtail.wagtailimages.models import Rendition; Rendition.objects.all().delete()' | django-admin.py shell"
+  },
+  "addons": [
+    "heroku-postgresql:hobby-dev"
+  ]
+}

+ 16 - 0
bakerydemo/base/migrations/0005_merge_20170210_1551.py

@@ -0,0 +1,16 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10.5 on 2017-02-10 15:51
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('base', '0004_auto_20170210_1420'),
+        ('base', '0004_auto_20170210_1445'),
+    ]
+
+    operations = [
+    ]

+ 6 - 0
bakerydemo/heroku_wsgi.py

@@ -0,0 +1,6 @@
+from whitenoise.django import DjangoWhiteNoise
+
+from .wsgi import application as _application
+
+
+application = DjangoWhiteNoise(_application)

+ 24 - 0
bakerydemo/settings/heroku.py

@@ -0,0 +1,24 @@
+import dj_database_url
+
+from .base import *
+
+
+DEBUG = True
+
+# Accept all hostnames, since we don't know in advance which hostname will be used for any given Heroku instance.
+# IMPORTANT: Set this to a real hostname when using this in production!
+# See https://docs.djangoproject.com/en/1.10/ref/settings/#allowed-hosts
+ALLOWED_HOSTS = ['*', 'wagtailbakerydemo.herokuapp.com']
+
+EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
+
+# BASE_URL required for notification emails
+BASE_URL = 'http://localhost:8000'
+
+DATABASES = {'default': dj_database_url.config(default='postgres://postgres@localhost:5432/wagtaildemo')}
+
+
+try:
+    from .local import *
+except ImportError:
+    pass

+ 0 - 1
bin/post_compile

@@ -1 +0,0 @@
-python manage.py compress --settings bakerydemo.settings.production

+ 2 - 0
readme.md

@@ -1,3 +1,5 @@
+[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/wagtail/bakerydemo)
+
 Wagtail demo project
 =======================
 

+ 5 - 0
requirements.txt

@@ -3,3 +3,8 @@ elasticsearch
 wagtail
 wagtailfontawesome
 Pillow
+
+# Dependencies for Heroku deployment
+dj-database-url==0.3.0
+whitenoise>=3.1,<4.0
+uwsgi>=2.0,<2.1