Skip to content

Commit 42c8b50

Browse files
author
drew
committed
Create an update command
1 parent d3b1b0d commit 42c8b50

7 files changed

Lines changed: 21 additions & 2 deletions

File tree

guide/management/__init__.py

Whitespace-only changes.

guide/management/commands/__init__.py

Whitespace-only changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from django.core.management.base import BaseCommand, CommandError
2+
from guide.services.update_data import update_data_CMS
3+
from guide.services.update_hours import update_hours_CMS
4+
5+
class Command(BaseCommand):
6+
7+
def handle(self, *args, **options):
8+
update_data_CMS()
9+
update_hours_CMS()

guide/views/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import datetime
88
from itertools import chain
99

10-
from guide.update_data import update_data_CMS
11-
from guide.update_hours import update_hours_CMS
10+
from guide.services.update_data import update_data_CMS
11+
from guide.services.update_hours import update_hours_CMS
1212
from guide.models import Exhibition, Artwork, Hour
1313
from guide.forms import CodeForm
1414

update.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
PROJECT_PATH=/var/www/guideapp/
4+
5+
echo "Starting update"
6+
7+
cd $PROJECT_PATH
8+
exec python manage.py update_all
9+
10+
echo "Data updated!"

0 commit comments

Comments
 (0)