You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2020/06/03 22:13:59 UTC

[airavata-django-portal] branch master updated (4fa9290 -> e6ce2e7)

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git.


    from 4fa9290  AIRAVATA-3323 Add delete confirmation to group resource profile UI
     new 4d998ce  Handle case where ALLOWED_HOSTS is empty
     new e6ce2e7  Document how to replace wagtail export with another

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../base/management/commands/set_wagtail_site.py   |  3 +-
 docs/dev/wagtail_export.md                         | 39 ++++++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletion(-)


[airavata-django-portal] 01/02: Handle case where ALLOWED_HOSTS is empty

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit 4d998ce1cfedb477a3d8c12b6bdd97269ccfeaf3
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Jun 3 17:43:55 2020 -0400

    Handle case where ALLOWED_HOSTS is empty
---
 .../wagtailapps/base/management/commands/set_wagtail_site.py           | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/django_airavata/wagtailapps/base/management/commands/set_wagtail_site.py b/django_airavata/wagtailapps/base/management/commands/set_wagtail_site.py
index 84db3a0..914858b 100644
--- a/django_airavata/wagtailapps/base/management/commands/set_wagtail_site.py
+++ b/django_airavata/wagtailapps/base/management/commands/set_wagtail_site.py
@@ -13,7 +13,8 @@ from django_airavata.wagtailapps.base.models import (
 class Command(BaseCommand):
 
     def handle(self, **options):
-        hostname = settings.ALLOWED_HOSTS[0]
+        hostname = settings.ALLOWED_HOSTS[0] if len(
+            settings.ALLOWED_HOSTS) > 0 else "localhost"
         if not Site.objects.filter(hostname=hostname,
                                    is_default_site=True).exists():
             with transaction.atomic():


[airavata-django-portal] 02/02: Document how to replace wagtail export with another

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit e6ce2e7bb02bedb63c4d7990c66027a4a2dbe56d
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Jun 3 18:13:46 2020 -0400

    Document how to replace wagtail export with another
---
 docs/dev/wagtail_export.md | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/docs/dev/wagtail_export.md b/docs/dev/wagtail_export.md
index 6238ef8..1ccacf2 100644
--- a/docs/dev/wagtail_export.md
+++ b/docs/dev/wagtail_export.md
@@ -154,3 +154,42 @@ python manage.py load_cms_data myexport.json
 
 where `myexport.json` should match the name that you gave the file when
 exporting it.
+
+## Replacing a Wagtail import with a different export
+
+Use this when you have already loaded a Wagtail export into a Django instance
+and you need to load a different one to overwrite the first one. The following
+steps will first remove the Wagtail tables and then load the export like normal.
+
+1. Make sure your virtual environment is activated if not already.
+
+```bash
+source venv/bin/activate
+```
+
+2. Run the following to delete all wagtail tables
+
+```bash
+python manage.py migrate wagtailimages 0001
+python manage.py migrate wagtailimages zero
+python manage.py migrate taggit zero
+python manage.py migrate wagtailadmin zero
+python manage.py migrate wagtailcore zero
+python manage.py migrate wagtailusers zero
+python manage.py migrate wagtailembeds zero
+```
+
+3. Migrate the database:
+
+```bash
+python manage.py migrate
+```
+
+4. Run
+
+```bash
+python manage.py load_cms_data myexport.json
+```
+
+where `myexport.json` should match the name that you gave the file when
+exporting it.