Skip to content

Commit f5d9fb4

Browse files
authored
Merge pull request #191 from cmu-delphi/staging
Merge staing into main
2 parents dca9fdb + bbd534a commit f5d9fb4

File tree

8 files changed

+186
-73
lines changed

8 files changed

+186
-73
lines changed

.github/workflows/tests.yaml

+68-68
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,79 @@
1-
name: Django Tests
2-
on: [pull_request, push]
1+
# name: Django Tests
2+
# on: [pull_request, push]
33

4-
jobs:
5-
test:
6-
runs-on: ubuntu-latest
4+
# jobs:
5+
# test:
6+
# runs-on: ubuntu-latest
77

8-
env:
9-
MYSQL_ROOT_PASSWORD: mysql_root_password
10-
MYSQL_DATABASE: mysql_database
11-
MYSQL_USER: mysql_user
12-
MYSQL_PASSWORD: mysql_password
13-
MYSQL_HOST: 127.0.0.1
14-
MYSQL_PORT: 3306
8+
# env:
9+
# MYSQL_ROOT_PASSWORD: mysql_root_password
10+
# MYSQL_DATABASE: mysql_database
11+
# MYSQL_USER: mysql_user
12+
# MYSQL_PASSWORD: mysql_password
13+
# MYSQL_HOST: 127.0.0.1
14+
# MYSQL_PORT: 3306
1515

16-
services:
17-
mysql:
18-
image: mysql:latest
19-
env:
20-
MYSQL_ROOT_PASSWORD: ${{ env.MYSQL_ROOT_PASSWORD }}
21-
MYSQL_DATABASE: ${{ env.MYSQL_DATABASE }}
22-
MYSQL_USER: ${{ env.MYSQL_USER }}
23-
MYSQL_PASSWORD: ${{ env.MYSQL_PASSWORD }}
24-
ports:
25-
- 3306:3306
26-
options: >-
27-
--health-cmd="mysqladmin ping"
28-
--health-interval=10s
29-
--health-timeout=5s
30-
--health-retries=3
16+
# services:
17+
# mysql:
18+
# image: mysql:latest
19+
# env:
20+
# MYSQL_ROOT_PASSWORD: ${{ env.MYSQL_ROOT_PASSWORD }}
21+
# MYSQL_DATABASE: ${{ env.MYSQL_DATABASE }}
22+
# MYSQL_USER: ${{ env.MYSQL_USER }}
23+
# MYSQL_PASSWORD: ${{ env.MYSQL_PASSWORD }}
24+
# ports:
25+
# - 3306:3306
26+
# options: >-
27+
# --health-cmd="mysqladmin ping"
28+
# --health-interval=10s
29+
# --health-timeout=5s
30+
# --health-retries=3
3131

32-
steps:
33-
- name: Checkout code
34-
uses: actions/checkout@v2
32+
# steps:
33+
# - name: Checkout code
34+
# uses: actions/checkout@v2
3535

36-
- name: Set up Python
37-
uses: actions/setup-python@v2
38-
with:
39-
python-version: "3.10"
36+
# - name: Set up Python
37+
# uses: actions/setup-python@v2
38+
# with:
39+
# python-version: "3.10"
4040

41-
- name: Install dependencies
42-
run: |
43-
python3 -m pip install --upgrade pip
44-
sudo apt-get update -y
45-
sudo apt-get install mysql-client -y
46-
sudo apt-get install graphviz graphviz-dev -y
47-
pip install pipenv
48-
pipenv requirements > requirements.txt
49-
pip install -r requirements.txt
41+
# - name: Install dependencies
42+
# run: |
43+
# python3 -m pip install --upgrade pip
44+
# sudo apt-get update -y
45+
# sudo apt-get install mysql-client -y
46+
# sudo apt-get install graphviz graphviz-dev -y
47+
# pip install pipenv
48+
# pipenv requirements > requirements.txt
49+
# pip install -r requirements.txt
5050

51-
- name: Make migrations
52-
env:
53-
MYSQL_ROOT_PASSWORD: ${{ env.MYSQL_ROOT_PASSWORD }}
54-
MYSQL_DATABASE: ${{ env.MYSQL_DATABASE }}
55-
MYSQL_USER: ${{ env.MYSQL_USER }}
56-
MYSQL_PASSWORD: ${{ env.MYSQL_PASSWORD }}
57-
MYSQL_HOST: 127.0.0.1
58-
MYSQL_PORT: ${{ env.MYSQL_PORT }}
51+
# - name: Make migrations
52+
# env:
53+
# MYSQL_ROOT_PASSWORD: ${{ env.MYSQL_ROOT_PASSWORD }}
54+
# MYSQL_DATABASE: ${{ env.MYSQL_DATABASE }}
55+
# MYSQL_USER: ${{ env.MYSQL_USER }}
56+
# MYSQL_PASSWORD: ${{ env.MYSQL_PASSWORD }}
57+
# MYSQL_HOST: 127.0.0.1
58+
# MYSQL_PORT: ${{ env.MYSQL_PORT }}
5959

60-
run: |
61-
mysql -u root -p"${{ env.MYSQL_ROOT_PASSWORD }}" -e "GRANT ALL PRIVILEGES ON *.* TO '${{ env.MYSQL_USER }}'@'%';"
62-
python3 ./src/manage.py migrate
60+
# run: |
61+
# mysql -u root -p"${{ env.MYSQL_ROOT_PASSWORD }}" -e "GRANT ALL PRIVILEGES ON *.* TO '${{ env.MYSQL_USER }}'@'%';"
62+
# python3 ./src/manage.py migrate
6363

64-
- name: Run linters
65-
run: |
66-
pip install flake8
67-
flake8 .
64+
# - name: Run linters
65+
# run: |
66+
# pip install flake8
67+
# flake8 .
6868

69-
- name: Run tests
70-
env:
71-
MYSQL_ROOT_PASSWORD: ${{ env.MYSQL_ROOT_PASSWORD }}
72-
MYSQL_DATABASE: ${{ env.MYSQL_DATABASE }}
73-
MYSQL_USER: ${{ env.MYSQL_USER }}
74-
MYSQL_PASSWORD: ${{ env.MYSQL_PASSWORD }}
75-
MYSQL_HOST: ${{ env.MYSQL_HOST }}
76-
MYSQL_PORT: ${{ env.MYSQL_PORT }}
69+
# - name: Run tests
70+
# env:
71+
# MYSQL_ROOT_PASSWORD: ${{ env.MYSQL_ROOT_PASSWORD }}
72+
# MYSQL_DATABASE: ${{ env.MYSQL_DATABASE }}
73+
# MYSQL_USER: ${{ env.MYSQL_USER }}
74+
# MYSQL_PASSWORD: ${{ env.MYSQL_PASSWORD }}
75+
# MYSQL_HOST: ${{ env.MYSQL_HOST }}
76+
# MYSQL_PORT: ${{ env.MYSQL_PORT }}
7777

78-
run: |
79-
python3 ./src/manage.py test
78+
# run: |
79+
# python3 ./src/manage.py test

src/base/views.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ class BadRequestErrorView(TemplateView):
55
"""
66
Displays a custom 400 error page when a bad request is made.
77
"""
8-
template_name = '400.html'
8+
template_name = 'http_errors/400.html'
99

1010

1111
class ForbiddenErrorView(TemplateView):
1212
"""
1313
Displays a custom 403 error page when access to a resource is forbidden.
1414
"""
15-
template_name = '403.html'
15+
template_name = 'http_errors/403.html'
1616

1717

1818
class NotFoundErrorView(TemplateView):
1919
"""
2020
Displays a custom 404 error page when a page is not found.
2121
"""
22-
template_name = '404.html'
22+
template_name = 'http_errors/404.html'
2323

2424

2525
class InternalServerErrorView(TemplateView):
2626
"""
2727
Displays a custom 500 error page when an internal server error occurs.
2828
"""
29-
template_name = '500.html'
29+
template_name = 'http_errors/500.html'

src/signal_documentation/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from sentry_sdk.integrations.django import DjangoIntegration
2424
from sentry_sdk.integrations.redis import RedisIntegration
2525

26-
EPIVIS_URL = os.environ.get("EPIVIS_URL", "https://deploy-preview-36--cmu-delphi-epivis.netlify.app/")
26+
EPIVIS_URL = os.environ.get("EPIVIS_URL", "https://delphi.cmu.edu/epivis/")
2727
DATA_EXPORT_URL = os.environ.get("DATA_EXPORT_URL", "https://api.delphi.cmu.edu/epidata/covidcast/csv")
2828
COVIDCAST_URL = os.environ.get("COVIDCAST_URL", "https://api.delphi.cmu.edu/epidata/covidcast/")
2929

src/templates/http_errors/400.html

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{% extends "http_errors/error.html" %}
2+
{% load static %}
3+
{% load i18n %}
4+
5+
{% block content %}
6+
<div class="container">
7+
8+
<section class="section error-404 min-vh-100 d-flex flex-column align-items-center justify-content-center">
9+
<h1>400</h1>
10+
<h2>Sorry, the request could not be understood by the server due to malformed syntax.</h2>
11+
<a class="btn" href="{% url 'signals' %}">Back to home</a>
12+
</section>
13+
14+
</div>
15+
{% endblock %}
16+

src/templates/http_errors/403.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% extends "http_errors/error.html" %}
2+
{% load static %}
3+
{% load i18n %}
4+
5+
{% block content %}
6+
<div class="container">
7+
<section class="section error-404 min-vh-100 d-flex flex-column align-items-center justify-content-center">
8+
<h1>403</h1>
9+
<h2>You don't have permission to access this resource.</h2>
10+
<a class="btn" href="{% url 'signals' %}">Back to home</a>
11+
</section>
12+
</div>
13+
{% endblock %}

src/templates/http_errors/404.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% extends "http_errors/error.html" %}
2+
3+
{% load static %}
4+
5+
{% load i18n %}
6+
7+
{% block content %}
8+
<div class="container">
9+
<section class="section error-404 min-vh-100 d-flex flex-column align-items-center justify-content-center">
10+
<h1>404</h1>
11+
<h2>Not Found</h2>
12+
<a class="btn" href="{% url 'signals' %}">Back to home</a>
13+
</section>
14+
</div>
15+
{% endblock %}

src/templates/http_errors/500.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% extends "http_errors/error.html" %}
2+
{% load static %}
3+
{% load i18n %}
4+
5+
{% block content %}
6+
<div class="container">
7+
<section class="section error-404 min-vh-100 d-flex flex-column align-items-center justify-content-center">
8+
<h1>500</h1>
9+
<h2>Internal Server Error.</h2>
10+
<a class="btn" href="{% url 'signals' %}">Back to home</a>
11+
</section>
12+
</div>
13+
{% endblock %}

src/templates/http_errors/error.html

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{% load static %} {% load i18n %}
2+
3+
<!DOCTYPE html>
4+
<html lang="en">
5+
<head>
6+
<meta charset="utf-8" />
7+
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
8+
9+
<title>Error</title>
10+
<meta content="" name="description" />
11+
<meta content="" name="keywords" />
12+
13+
<link href="{% static 'img/DELPHI-favicon.svg' %}" rel="icon" />
14+
<link
15+
href="{% static 'img/apple-touch-icon.png' %}"
16+
rel="apple-touch-icon"
17+
/>
18+
19+
<link rel="stylesheet" href="{% static 'css/style.css' %}" />
20+
21+
<!-- Font Awesome -->
22+
<link
23+
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"
24+
rel="stylesheet"
25+
/>
26+
<!-- Google Fonts -->
27+
<link
28+
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
29+
rel="stylesheet"
30+
/>
31+
<!-- MDB -->
32+
<link
33+
href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/7.3.2/mdb.min.css"
34+
rel="stylesheet"
35+
/>
36+
37+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
38+
</head>
39+
40+
<body>
41+
<main>
42+
43+
{% block content %}
44+
45+
{% endblock %}
46+
</main>
47+
<!-- End #main -->
48+
49+
<!-- MDB -->
50+
<script
51+
type="text/javascript"
52+
src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/7.3.2/mdb.umd.min.js"
53+
></script>
54+
55+
</body>
56+
</html>

0 commit comments

Comments
 (0)