Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ RUN pip install --no-cache-dir -r requirements.txt
COPY . .

# run the Django migrations
RUN python manage.py makemigrations
RUN python manage.py migrate
# RUN python manage.py makemigrations
# RUN python manage.py migrate

# run the Django server
ENTRYPOINT ["python", "manage.py", "runserver", "0.0.0.0:8000"]
# ENTRYPOINT ["python", "manage.py", "runserver", "0.0.0.0:8000"]
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
web: gunicorn mentorq_main.wsgi --log-file -
release: python manage.py migrate
web: gunicorn mentorq_main.wsgi
17 changes: 12 additions & 5 deletions mentorq_main/settings/common.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import os
import pathlib
import environ

# Use to get environment variables
env = environ.Env()

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = str(pathlib.Path(__file__).absolute().parent.parent.parent)
# BASE_DIR = str(pathlib.Path(__file__).absolute().parent.parent.parent)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Application definition
Expand Down Expand Up @@ -53,10 +58,12 @@

# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
#'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
#}

'default': env.db('DATABASE_URL'),
}

# custom authentication backend for Mentorq
Expand Down
3 changes: 2 additions & 1 deletion mentorq_main/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
ALLOWED_HOSTS = ["*"]

STATIC_URL = "/static/"
STATIC_ROOT = os.path.join(BASE_DIR, 'static')

SIMPLE_JWT = {
"ACCESS_TOKEN_LIFETIME": timedelta(days=1)
}
}
4 changes: 2 additions & 2 deletions mentorq_main/settings/production.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .common import *
import django_heroku
#import django_heroku

DEBUG = False

django_heroku.settings(locals())
#django_heroku.settings(locals())
6 changes: 3 additions & 3 deletions mentorq_main/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

# if the environment var LCS_DEV is set, it will use the dev lcs endpoint
# doesn't matter what the actual value is, it just has to be set
if os.getenv("LCS_DEV"):
set_testing(True)
print("Set testing mode successfully")
#if os.getenv("LCS_DEV"):
# set_testing(True)
# print("Set testing mode successfully")
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ certifi==2020.6.20
chardet==3.0.4
Django==3.0.14
django-cors-headers==3.4.0
django-environ
djangorestframework==3.11.2
djangorestframework-simplejwt==4.4.0
idna==2.10
Expand All @@ -16,4 +17,3 @@ six==1.15.0
sqlparse==0.3.1
urllib3==1.25.9
gunicorn==20.0.4
django-heroku==0.3.1