Skip to content

Commit 7c43a81

Browse files
committed
fixed these in prod
1 parent 85f97a3 commit 7c43a81

File tree

5 files changed

+22
-17
lines changed

5 files changed

+22
-17
lines changed

deploy/dev/dev_api_musiccpr.ini

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
; put this in /etc/supervisori.d/dev_api_musiccpr.conf
2+
3+
[program:dev_api_musiccpr]
4+
command=/data/worktree/dev/backend/live/deploy/dev/gunicorn.sh
5+
directory=/data/worktree/dev/backend/live
6+
stdout_logfile=/data/worktree/dev/backend/live/logs/supervisor.log
7+
stderr_logfile=/data/worktree/dev/backend/live/logs/supervisor-errors.log
8+
autostart=true
9+
autorestart=true

deploy/dev/dev_api_teleband.conf

-9
This file was deleted.

deploy/dev/gunicorn.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ echo "Starting $NAME as `whoami`"
1717

1818
# Activate the virtual environment
1919
cd $DJANGODIR
20-
source /home/ec2-user/venv-dev/bin/activate
20+
source /home/ec2-user/venv312-dev-all/first/bin/activate
2121
export DJANGO_READ_DOT_ENV_FILE=True
2222
export DJANGO_SETTINGS_MODULE=config.settings.production
2323
export PYTHONPATH=$DJANGODIR:$PYTHONPATH

requirements/production.txt

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ gunicorn==22.0.0 # https://github.com/benoitc/gunicorn
77
psycopg2-binary==2.9.9 # https://github.com/psycopg/psycopg2
88
Collectfast==2.2.0 # https://github.com/antonagestam/collectfast
99

10+
boto3==1.34.145
11+
1012
# Django
1113
# ------------------------------------------------------------------------------
1214
django-storages==1.14.3 # https://github.com/jschneier/django-storages

teleband/assignments/migrations/0033_auto_20240312_2321.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from calendar import c
44
from datetime import date
5-
from django.db import migrations
5+
from django.db import IntegrityError, migrations
66

77
from teleband.courses.helper import assign_piece_plan
88
from teleband.assignments.models import PiecePlan as PiecePlanModel
@@ -49,12 +49,15 @@ def add_demos(apps, schema_editor):
4949
if user.instrument is None:
5050
user.instrument = Instrument.objects.get(name="Piano")
5151
user.save()
52-
Enrollment.objects.update_or_create(
53-
user=user,
54-
course=demo_course,
55-
instrument=user.instrument,
56-
role=student_role,
57-
)
52+
try:
53+
Enrollment.objects.update_or_create(
54+
user=user,
55+
course=demo_course,
56+
instrument=user.instrument,
57+
role=student_role,
58+
)
59+
except IntegrityError as e:
60+
print(f"IntegrityError: {e}")
5861

5962
for piece_name in NEA_CREATE_DEMO_PIECES:
6063
if piece_name=="I Want to be Ready" and condition != 'Aural':

0 commit comments

Comments
 (0)