Skip to content

Commit

Permalink
Merge pull request #66 from avantifellows/migration
Browse files Browse the repository at this point in the history
Move to app.plio.in
  • Loading branch information
dalmia authored Mar 20, 2021
2 parents a2ac0a6 + 2086c59 commit d50ee29
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions components/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.http import HttpResponse, HttpResponseNotFound, JsonResponse
from django.http import response, HttpResponseBadRequest, request
from rest_framework.decorators import api_view
from plio.settings import DB_QUERIES_URL
from plio.settings import DB_QUERIES_URL, FRONTEND_URL

URL_PREFIX_GET_DEFAULT_COMPONENT_CONFIG = "/get_default_component_config"
URL_PREFIX_GET_COMPONENT_FEATURES = "/get_component_features"
Expand Down Expand Up @@ -93,4 +93,4 @@ def get_default_config(component_type: str):


def index(request):
return redirect("https://player.plio.in", permanent=True)
return redirect(FRONTEND_URL, permanent=True)
4 changes: 2 additions & 2 deletions entries/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pandas as pd
from datetime import datetime

from plio.settings import DB_QUERIES_URL
from plio.settings import DB_QUERIES_URL, FRONTEND_URL
from utils.data import convert_objects_to_df
from utils.security import hash_function
from utils.cleanup import is_valid_user_id
Expand All @@ -20,7 +20,7 @@


def index(request):
return redirect("https://player.plio.in", permanent=True)
return redirect(FRONTEND_URL, permanent=True)


@api_view(["GET"])
Expand Down
4 changes: 2 additions & 2 deletions experiments/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.http import HttpResponse, HttpResponseNotFound, JsonResponse
from django.http import response, HttpResponseBadRequest, request
from rest_framework.decorators import api_view
from plio.settings import DB_QUERIES_URL
from plio.settings import DB_QUERIES_URL, FRONTEND_URL
from users.views import get_user_config, update_user_config
from utils.s3 import get_default_user_config
from utils.data import convert_objects_to_df
Expand Down Expand Up @@ -126,4 +126,4 @@ def fetch_all_experiments():


def index(request):
return redirect("https://player.plio.in", permanent=True)
return redirect(FRONTEND_URL, permanent=True)
1 change: 1 addition & 0 deletions plio/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,4 @@
CMS_URL = "https://cms.peerlearning.com/api"
CMS_TOKEN = os.environ["CMS_TOKEN"]
GET_CMS_PROBLEM_URL = "/problems"
FRONTEND_URL = "https://app.plio.in"
6 changes: 3 additions & 3 deletions plio/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from rest_framework.request import Request
from datetime import datetime

from plio.settings import DB_QUERIES_URL
from plio.settings import DB_QUERIES_URL, FRONTEND_URL
import plio
from components.views import get_default_config
from users.views import get_user_config
Expand Down Expand Up @@ -282,9 +282,9 @@ def index(request: Request):

def redirect_home(request: Request):
"""Redirect to frontend home"""
return redirect("https://player.plio.in", permanent=True)
return redirect(FRONTEND_URL, permanent=True)


def redirect_plio(request: Request, plio_id: str):
"""Redirect to frontend plio page"""
return redirect(f"https://player.plio.in/#/play/{plio_id}", permanent=True)
return redirect(f"{FRONTEND_URL}/#/play/{plio_id}", permanent=True)
4 changes: 2 additions & 2 deletions tags/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
from django.http import HttpResponse, HttpResponseNotFound, JsonResponse
from rest_framework.decorators import api_view

from plio.settings import DB_QUERIES_URL
from plio.settings import DB_QUERIES_URL, FRONTEND_URL
from utils.data import convert_objects_to_df

URL_PREFIX_GET_ALL_TAGS = "/get_tags"


def index(request):
return redirect("https://player.plio.in", permanent=True)
return redirect(FRONTEND_URL, permanent=True)


@api_view(["GET"])
Expand Down
4 changes: 2 additions & 2 deletions users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.http import HttpResponse, HttpResponseNotFound, JsonResponse
from django.http import response, HttpResponseBadRequest, request
from rest_framework.decorators import api_view
from plio.settings import DB_QUERIES_URL
from plio.settings import DB_QUERIES_URL, FRONTEND_URL

from utils.s3 import create_user_profile
from utils.data import convert_objects_to_df
Expand All @@ -21,7 +21,7 @@

# Create your views here.
def index(request):
return redirect("https://player.plio.in", permanent=True)
return redirect(FRONTEND_URL, permanent=True)


def get_user_config(user_id):
Expand Down

0 comments on commit d50ee29

Please sign in to comment.