David Ray 8 years ago
parent
commit
cae0f56612

+ 19 - 0
bakerydemo/base/migrations/0004_auto_20170210_1420.py

@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10.5 on 2017-02-10 14:20
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('base', '0003_footertext'),
+    ]
+
+    operations = [
+        migrations.AlterModelOptions(
+            name='footertext',
+            options={'verbose_name_plural': 'Footer Text'},
+        ),
+    ]

+ 2 - 0
bakerydemo/breads/models.py

@@ -91,6 +91,8 @@ class BreadPage(Page):
 
     parent_page_types = ['BreadsIndexPage']
 
+    api_fields = ['title', 'bread_type', 'origin', 'image']
+
 
 class BreadsIndexPage(Page):
     """

+ 3 - 1
bakerydemo/settings/base.py

@@ -50,7 +50,9 @@ INSTALLED_APPS = [
     'wagtail.wagtailadmin',
     'wagtail.contrib.modeladmin',
     'wagtail.wagtailcore',
-
+    'wagtail.contrib.wagtailapi',
+    
+    'rest_framework',
     'modelcluster',
     'taggit',
     'wagtailfontawesome',

+ 2 - 0
bakerydemo/urls.py

@@ -8,6 +8,7 @@ from wagtail.wagtailcore import urls as wagtail_urls
 
 from bakerydemo.search import views as search_views
 
+from wagtail.contrib.wagtailapi import urls as wagtailapi_urls
 
 urlpatterns = [
     url(r'^django-admin/', include(admin.site.urls)),
@@ -16,6 +17,7 @@ urlpatterns = [
     url(r'^documents/', include(wagtaildocs_urls)),
 
     url(r'^search/$', search_views.search, name='search'),
+    url(r'^api/', include(wagtailapi_urls)),
 
 ]
 

+ 2 - 0
readme.md

@@ -29,6 +29,8 @@ Run the following commands:
     vagrant up
     vagrant ssh
       (then, within the SSH session:)
+    ./manage.py migrate
+    ./manage.py load_initial_data
     ./manage.py runserver 0.0.0.0:8000
 
 The demo site will now be accessible at [http://localhost:8000/](http://localhost:8000/) and the Wagtail admin