瀏覽代碼

Merge pull request #131 from wagtail/10_prep_for_distro

Prep for distro
Edd Baldry 8 年之前
父節點
當前提交
14b3ad27d2
共有 47 個文件被更改,包括 3411 次插入563 次删除
  1. 1 1
      .gitignore
  2. 3370 18
      bakerydemo/base/fixtures/bakerydemo.json
  3. 0 307
      bakerydemo/base/fixtures/breads.json
  4. 0 10
      bakerydemo/base/fixtures/collections.json
  5. 0 217
      bakerydemo/base/fixtures/images.json
  6. 10 0
      bakerydemo/base/management/commands/load_initial_data.py
  7. 二進制
      bakerydemo/media/original_images/Akranes.jpg
  8. 二進制
      bakerydemo/media/original_images/Anadama_bread_1.jpg
  9. 二進制
      bakerydemo/media/original_images/Appam_served_with_Coconut_Milk_in_Tamil_Nadu.JPG
  10. 二進制
      bakerydemo/media/original_images/Arepa_asada.JPG
  11. 二進制
      bakerydemo/media/original_images/Bagel.jpg
  12. 二進制
      bakerydemo/media/original_images/Baguette_de_pain_WikiCheese_Lausanne.jpg
  13. 二進制
      bakerydemo/media/original_images/Bammies.jpg
  14. 二進制
      bakerydemo/media/original_images/Bazin.jpg
  15. 二進制
      bakerydemo/media/original_images/Bean-jam-bunanpankatori-cityjapan.JPG
  16. 二進制
      bakerydemo/media/original_images/Bedouins_making_bread.jpg
  17. 二進制
      bakerydemo/media/original_images/Belgische_waffeln.jpg
  18. 二進制
      bakerydemo/media/original_images/Bhakri_1.jpg
  19. 二進制
      bakerydemo/media/original_images/Bolani_Afghan_bread_01.jpg
  20. 二進制
      bakerydemo/media/original_images/Breads_1.jpg
  21. 二進制
      bakerydemo/media/original_images/Capture_decran_2017-03-23_a_15.16.46.png
  22. 二進制
      bakerydemo/media/original_images/Hofn.jpg
  23. 二進制
      bakerydemo/media/original_images/Olandshvedebrod_6082070226.jpg
  24. 二進制
      bakerydemo/media/original_images/Sourdough_rye_with_walnuts.jpg
  25. 二進制
      bakerydemo/media/original_images/aevar-gudmundsson-selfoss.jpg
  26. 二進制
      bakerydemo/media/original_images/bakingsoda.jpg
  27. 二進制
      bakerydemo/media/original_images/bostoncream.jpg
  28. 二進制
      bakerydemo/media/original_images/bread5.jpg
  29. 二進制
      bakerydemo/media/original_images/bread6.jpg
  30. 二進制
      bakerydemo/media/original_images/breads1.jpg
  31. 二進制
      bakerydemo/media/original_images/breads2.jpg
  32. 二進制
      bakerydemo/media/original_images/breads3.jpg
  33. 二進制
      bakerydemo/media/original_images/breads4.jpg
  34. 二進制
      bakerydemo/media/original_images/hof-cornell-university-filter.jpg
  35. 二進制
      bakerydemo/media/original_images/howlin.jpg
  36. 二進制
      bakerydemo/media/original_images/lightnin_hopkins.jpg
  37. 二進制
      bakerydemo/media/original_images/muddy_waters.jpg
  38. 二進制
      bakerydemo/media/original_images/muddy_waters_hUPkmSW.jpg
  39. 二進制
      bakerydemo/media/original_images/reykjavik-sverrir-thorolfsson.jpg
  40. 二進制
      bakerydemo/media/original_images/robert_johnson2.jpg
  41. 二進制
      bakerydemo/media/original_images/sliced.jpg
  42. 二進制
      bakerydemo/media/original_images/soda_bread.jpg
  43. 二進制
      bakerydemo/media/original_images/sprint_crew.jpg
  44. 二進制
      bakerydemo/media/original_images/vik.jpg
  45. 二進制
      bakerydemo/media/original_images/yeast.jpg
  46. 29 9
      readme.md
  47. 1 1
      requirements/base.txt

+ 1 - 1
.gitignore

@@ -9,7 +9,7 @@
 /data
 .~*
 common/CACHE
-bakerydemo/media/*
+bakerydemo/media/images/*
 bakerydemo/settings/local.py
 bakerydemodb
 __pycache__

File diff suppressed because it is too large
+ 3370 - 18
bakerydemo/base/fixtures/bakerydemo.json


File diff suppressed because it is too large
+ 0 - 307
bakerydemo/base/fixtures/breads.json


+ 0 - 10
bakerydemo/base/fixtures/collections.json

@@ -1,10 +0,0 @@
-[{
-  "model": "wagtailcore.collection",
-  "pk": 2,
-  "fields": {
-    "path": "00010001",
-    "depth": 2,
-    "numchild": 0,
-    "name": "Breads"
-  }
-}]

+ 0 - 217
bakerydemo/base/fixtures/images.json

@@ -1,217 +0,0 @@
-[
-{
-  "model": "wagtailimages.image",
-  "pk": 2,
-  "fields": {
-    "collection": 2,
-    "title": "Anadama",
-    "file": "original_images/Anadama_bread_1.jpg",
-    "width": 4752,
-    "height": 3168,
-    "created_at": "2017-02-10T13:03:58.541Z",
-    "uploaded_by_user": 1,
-    "focal_point_x": null,
-    "focal_point_y": null,
-    "focal_point_width": null,
-    "focal_point_height": null,
-    "file_size": null
-  }
-},
-{
-  "model": "wagtailimages.image",
-  "pk": 3,
-  "fields": {
-    "collection": 2,
-    "title": "Anpan",
-    "file": "original_images/Bean-jam-bunanpankatori-cityjapan.JPG",
-    "width": 800,
-    "height": 640,
-    "created_at": "2017-02-10T13:05:45.828Z",
-    "uploaded_by_user": 1,
-    "focal_point_x": null,
-    "focal_point_y": null,
-    "focal_point_width": null,
-    "focal_point_height": null,
-    "file_size": null
-  }
-},
-{
-  "model": "wagtailimages.image",
-  "pk": 4,
-  "fields": {
-    "collection": 2,
-    "title": "Bazin",
-    "file": "original_images/Bazin.jpg",
-    "width": 1600,
-    "height": 1200,
-    "created_at": "2017-02-10T13:08:04.012Z",
-    "uploaded_by_user": 1,
-    "focal_point_x": null,
-    "focal_point_y": null,
-    "focal_point_width": null,
-    "focal_point_height": null,
-    "file_size": null
-  }
-},
-{
-  "model": "wagtailimages.image",
-  "pk": 5,
-  "fields": {
-    "collection": 2,
-    "title": "Belgian Waffle",
-    "file": "original_images/Belgische_waffeln.jpg",
-    "width": 2025,
-    "height": 1536,
-    "created_at": "2017-02-10T13:10:05.988Z",
-    "uploaded_by_user": 1,
-    "focal_point_x": null,
-    "focal_point_y": null,
-    "focal_point_width": null,
-    "focal_point_height": null,
-    "file_size": null
-  }
-},
-{
-  "model": "wagtailimages.image",
-  "pk": 6,
-  "fields": {
-    "collection": 2,
-    "title": "Bhakri",
-    "file": "original_images/Another_Vegetarian_Meal.jpg",
-    "width": 1600,
-    "height": 1200,
-    "created_at": "2017-02-10T13:15:25.730Z",
-    "uploaded_by_user": 1,
-    "focal_point_x": null,
-    "focal_point_y": null,
-    "focal_point_width": null,
-    "focal_point_height": null,
-    "file_size": null
-  }
-},
-{
-  "model": "wagtailimages.image",
-  "pk": 7,
-  "fields": {
-    "collection": 2,
-    "title": "Black Bread",
-    "file": "original_images/Mischbrot-1.jpg",
-    "width": 2000,
-    "height": 1500,
-    "created_at": "2017-02-10T13:17:14.968Z",
-    "uploaded_by_user": 1,
-    "focal_point_x": null,
-    "focal_point_y": null,
-    "focal_point_width": null,
-    "focal_point_height": null,
-    "file_size": null
-  }
-},
-{
-  "model": "wagtailimages.image",
-  "pk": 8,
-  "fields": {
-    "collection": 2,
-    "title": "Appam",
-    "file": "original_images/Appam_served_with_Coconut_Milk_in_Tamil_Nadu.JPG",
-    "width": 2362,
-    "height": 1064,
-    "created_at": "2017-02-10T13:19:24.588Z",
-    "uploaded_by_user": 1,
-    "focal_point_x": null,
-    "focal_point_y": null,
-    "focal_point_width": null,
-    "focal_point_height": null,
-    "file_size": null
-  }
-},
-{
-  "model": "wagtailimages.image",
-  "pk": 9,
-  "fields": {
-    "collection": 1,
-    "title": "Arepa",
-    "file": "original_images/Arepa_asada.JPG",
-    "width": 1600,
-    "height": 1200,
-    "created_at": "2017-02-10T13:22:40.113Z",
-    "uploaded_by_user": 1,
-    "focal_point_x": null,
-    "focal_point_y": null,
-    "focal_point_width": null,
-    "focal_point_height": null,
-    "file_size": null
-  }
-},
-{
-  "model": "wagtailimages.image",
-  "pk": 10,
-  "fields": {
-    "collection": 2,
-    "title": "Bolani",
-    "file": "original_images/Bolani_Afghan_bread_01.jpg",
-    "width": 1280,
-    "height": 960,
-    "created_at": "2017-02-10T13:24:28.559Z",
-    "uploaded_by_user": 1,
-    "focal_point_x": null,
-    "focal_point_y": null,
-    "focal_point_width": null,
-    "focal_point_height": null,
-    "file_size": null
-  }
-},
-{
-  "model": "wagtailimages.image",
-  "pk": 11,
-  "fields": {
-    "collection": 2,
-    "title": "Baguette",
-    "file": "original_images/Baguette_de_pain_WikiCheese_Lausanne.jpg",
-    "width": 4032,
-    "height": 1958,
-    "created_at": "2017-02-10T13:24:47.838Z",
-    "uploaded_by_user": 1,
-    "focal_point_x": null,
-    "focal_point_y": null,
-    "focal_point_width": null,
-    "focal_point_height": null,
-    "file_size": null
-  }
-},
-{
-  "model": "wagtailimages.image",
-  "pk": 12,
-  "fields": {
-    "collection": 2,
-    "title": "Bammie",
-    "file": "original_images/Bammies.jpg",
-    "width": 1700,
-    "height": 1527,
-    "created_at": "2017-02-10T13:27:19.252Z",
-    "uploaded_by_user": 1,
-    "focal_point_x": null,
-    "focal_point_y": null,
-    "focal_point_width": null,
-    "focal_point_height": null,
-    "file_size": null
-  }
-},
-{
-  "model": "wagtailimages.image",
-  "pk": 13,
-  "fields": {
-    "collection": 1,
-    "title": "Bagel",
-    "file": "original_images/Plain-Bagel.jpg",
-    "width": 1920,
-    "height": 1660,
-    "created_at": "2017-02-10T13:28:30.500Z",
-    "uploaded_by_user": 1,
-    "focal_point_x": null,
-    "focal_point_y": null,
-    "focal_point_width": null,
-    "focal_point_height": null,
-    "file_size": null
-  }
-}]

+ 10 - 0
bakerydemo/base/management/commands/load_initial_data.py

@@ -4,6 +4,8 @@ from django.conf import settings
 from django.core.management.base import BaseCommand
 from django.core.management import call_command
 
+from wagtail.wagtailcore.models import Site, Page
+
 
 class Command(BaseCommand):
     def handle(self, **options):
@@ -11,4 +13,12 @@ class Command(BaseCommand):
         fixture_file = os.path.join(fixtures_dir, 'bakerydemo.json')
 
         call_command('loaddata', fixture_file, verbosity=0)
+
+        # Wagtail creates default Site and Page instances during install, but we already have
+        # them in the data load. Remove the auto-generated ones.
+        if Site.objects.filter(hostname='localhost').exists():
+            Site.objects.get(hostname='localhost').delete()
+        if Page.objects.filter(title='Welcome to your new Wagtail site!').exists():
+            Page.objects.get(title='Welcome to your new Wagtail site!').delete()
+
         print("Awesome. Your data is loaded! The bakery's doors are almost ready to open...")

二進制
bakerydemo/media/original_images/Akranes.jpg


二進制
bakerydemo/media/original_images/Anadama_bread_1.jpg


二進制
bakerydemo/media/original_images/Appam_served_with_Coconut_Milk_in_Tamil_Nadu.JPG


二進制
bakerydemo/media/original_images/Arepa_asada.JPG


二進制
bakerydemo/media/original_images/Bagel.jpg


二進制
bakerydemo/media/original_images/Baguette_de_pain_WikiCheese_Lausanne.jpg


二進制
bakerydemo/media/original_images/Bammies.jpg


二進制
bakerydemo/media/original_images/Bazin.jpg


二進制
bakerydemo/media/original_images/Bean-jam-bunanpankatori-cityjapan.JPG


二進制
bakerydemo/media/original_images/Bedouins_making_bread.jpg


二進制
bakerydemo/media/original_images/Belgische_waffeln.jpg


二進制
bakerydemo/media/original_images/Bhakri_1.jpg


二進制
bakerydemo/media/original_images/Bolani_Afghan_bread_01.jpg


二進制
bakerydemo/media/original_images/Breads_1.jpg


二進制
bakerydemo/media/original_images/Capture_decran_2017-03-23_a_15.16.46.png


二進制
bakerydemo/media/original_images/Hofn.jpg


二進制
bakerydemo/media/original_images/Olandshvedebrod_6082070226.jpg


二進制
bakerydemo/media/original_images/Sourdough_rye_with_walnuts.jpg


二進制
bakerydemo/media/original_images/aevar-gudmundsson-selfoss.jpg


二進制
bakerydemo/media/original_images/bakingsoda.jpg


二進制
bakerydemo/media/original_images/bostoncream.jpg


二進制
bakerydemo/media/original_images/bread5.jpg


二進制
bakerydemo/media/original_images/bread6.jpg


二進制
bakerydemo/media/original_images/breads1.jpg


二進制
bakerydemo/media/original_images/breads2.jpg


二進制
bakerydemo/media/original_images/breads3.jpg


二進制
bakerydemo/media/original_images/breads4.jpg


二進制
bakerydemo/media/original_images/hof-cornell-university-filter.jpg


二進制
bakerydemo/media/original_images/howlin.jpg


二進制
bakerydemo/media/original_images/lightnin_hopkins.jpg


二進制
bakerydemo/media/original_images/muddy_waters.jpg


二進制
bakerydemo/media/original_images/muddy_waters_hUPkmSW.jpg


二進制
bakerydemo/media/original_images/reykjavik-sverrir-thorolfsson.jpg


二進制
bakerydemo/media/original_images/robert_johnson2.jpg


二進制
bakerydemo/media/original_images/sliced.jpg


二進制
bakerydemo/media/original_images/soda_bread.jpg


二進制
bakerydemo/media/original_images/sprint_crew.jpg


二進制
bakerydemo/media/original_images/vik.jpg


二進制
bakerydemo/media/original_images/yeast.jpg


+ 29 - 9
readme.md

@@ -24,8 +24,8 @@ Setup with Vagrant
 ------------------
 
 ### Dependencies
-* [VirtualBox](https://www.virtualbox.org/)
-* [Vagrant 1.5+](http://www.vagrantup.com)
+* [Virtualenv](https://virtualenv.pypa.io/en/stable/installation/)
+* [VirtualenvWrapper](http://virtualenvwrapper.readthedocs.io/en/latest/install.html) (Optional)
 
 ### Installation
 Run the following commands:
@@ -74,10 +74,11 @@ To tail the logs from the Docker containers in realtime, run:
 docker-compose logs -f
 ```
 
-Local Setup
------------
-Don't want to set up a whole Vagrant VM or use Docker to try out Wagtail? No problem. You'll probably want to start
-with a fresh virtualenv.
+Virtualenv Setup
+----------------
+
+Want to run the bakerydemo locally without setting up Vagrant or Docker? You'll probably want to start
+with a fresh [virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs/).
 
 ### Installation
 
@@ -87,11 +88,11 @@ installed, run:
     mkvirtualenv wagtailbakerydemo
     cd ~/dev [or your preferred dev directory]
     git clone git@github.com:wagtail/bakerydemo.git
-    cd wagtaildemo
+    cd bakerydemo
     pip install -r requirements.txt
 
 Next, we'll set up our local environment variables. We use [django-dotenv](https://github.com/jpadilla/django-dotenv)
-to help with this. It reads environment variables located in a file name .env in the top level directory of the project. The only variable we need to start is `DJANGO_SETTINGS_MODULE`:
+to help with this. It reads environment variables located in a file name `.env` in the top level directory of the project. The only variable we need to start is `DJANGO_SETTINGS_MODULE`:
 
     $ cp bakerydemo/settings/local.py.example bakerydemo/settings/local.py
     $ echo "DJANGO_SETTINGS_MODULE=bakerydemo.settings.local" > .env
@@ -169,6 +170,25 @@ In production on your own site, you'll need to change this to:
 
 and configure [SMTP settings](https://docs.djangoproject.com/en/1.10/topics/email/#smtp-backend) appropriate for your email provider.
 
-### Demo content
+### Ownership of demo content
 
 Most of the images and textual content in this project are sourced from Wikipedia, and is therefore open source and copyright-free.
+
+### Instructions for demo developers preparing this archive for distribution
+
+If you change content or images in this repo and need to prepare it for export, do the following on a branch:
+
+```
+./manage.py dbshell
+delete from django_session;
+delete from wagtailimages_rendition;
+```
+
+It is always safe to delete the generated `media/images` dir while keeping `media/original_images`,
+followed by `delete from wagtailimages_rendition;`
+
+To generate new fixtures, run:
+
+`./manage.py dumpdata --natural-foreign --indent 2 -e auth.permission -e contenttypes -e wagtailcore.GroupCollectionPermission -e wagtailimages.filter -e wagtailcore.pagerevision -e wagtailimages.rendition  -e sessions > bakerydemo/base/fixtures/bakerydemo.json`
+
+Make a pull request to https://github.com/wagtail/bakerydemo

+ 1 - 1
requirements/base.txt

@@ -1,4 +1,4 @@
-Django==1.10.5
+Django==1.10.6
 django-dotenv==1.4.1
 # http://docs.wagtail.io/en/v1.8.1/topics/search/backends.html#elasticsearch-backend
 # Not utilized by default; uncomment and review the above document if you require elasticsearch

Some files were not shown because too many files changed in this diff