Skip to content

Commit

Permalink
Merge 5bfd3b5 into 08d332d
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Pannell committed Feb 14, 2019
2 parents 08d332d + 5bfd3b5 commit c839cce
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
9 changes: 3 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# teamwork-project .gitignore

# Ignoring migrations during development
#**/migrations/*

# Ignore media folder
teamwork/media/**
# media/csv_files/**

# Database files
.DS_Store
Expand All @@ -15,6 +9,9 @@ teamwork/media/**
*.sublime-project
*.sublime-workspace

# Vscode
*.vscode/

# Suggestions from heroku-django-template
venv
*.pyc
Expand Down
1 change: 1 addition & 0 deletions teamwork/apps/courses/views/BaseView.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from django.http import (HttpResponse, HttpResponseBadRequest,
HttpResponseRedirect)
from django.core.urlresolvers import reverse
from django.contrib import messages

from teamwork.apps.courses.forms import JoinCourseForm
from teamwork.apps.courses.models import Course, Enrollment
Expand Down
2 changes: 1 addition & 1 deletion teamwork/apps/courses/views/CourseView.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def edit_assignment(request, slug):
ass.ass_number = ass_number
ass.save()
else:
print("FORM ERRORS: ", form.errors)
print("FORM ERRORS: ", assignmentForm.errors)

return redirect(view_one_course,course.slug)

Expand Down
11 changes: 9 additions & 2 deletions teamwork/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
# DEBUG is set in .env file. See etc/example.env
DEBUG = config('DEBUG', default=False, cast=bool)
USE_POSTGRES_LOCAL = config('USE_POSTGRES_LOCAL', default=False, cast=bool)

# Application definition

Expand Down Expand Up @@ -136,8 +137,14 @@
'PORT': '',
}
}

# Setup the database using dj based on the DATABASE_URL set in .env
# Connect to postgres db described by POSTGRES_DATABASE_URL in .env file
elif USE_POSTGRES_LOCAL:
DATABASES = {
'default': dj_database_url.config(
default=config('POSTGRES_DATABASE_URL')
)
}
# Connect to sqlite3 db described by DATABASE_URL in .env file
else:
DATABASES = {
'default': dj_database_url.config(
Expand Down

0 comments on commit c839cce

Please sign in to comment.