Skip to content

Commit

Permalink
copy backend
Browse files Browse the repository at this point in the history
  • Loading branch information
August Fu committed Dec 3, 2023
1 parent 5854474 commit f664708
Show file tree
Hide file tree
Showing 133 changed files with 10,435 additions and 9,393 deletions.
11 changes: 11 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]

[dev-packages]

[requires]
python_version = "3.10"
1 change: 1 addition & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
postgres
4 changes: 3 additions & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM pennlabs/django-base:f0f05216db7c23c1dbb5b95c3bc9e8a2603bf2fd
FROM pennlabs/django-base:9c4f31bf1af44219d0f9019271a0033a222291c2-3.10.1

LABEL maintainer="Penn Labs"

Expand All @@ -14,5 +14,7 @@ COPY . /app/
ENV DJANGO_SETTINGS_MODULE PennCourses.settings.production
ENV SECRET_KEY 'temporary key just to build the docker image'

COPY ./scripts/asgi-run /usr/local/bin/

# Collect static files
RUN python3 /app/manage.py collectstatic --noinput
2 changes: 1 addition & 1 deletion backend/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LABEL maintainer="Penn Labs"
WORKDIR /backend

# Copy project dependencies
COPY Pipfile* .
COPY Pipfile* ./

# Install backend dependencies
RUN pipenv install --dev
Expand Down
8 changes: 8 additions & 0 deletions backend/PennCourses/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import os

from django.core.asgi import get_asgi_application


os.environ.setdefault("DJANGO_SETTINGS_MODULE", "PennCourses.settings.production")

application = get_asgi_application()
478 changes: 162 additions & 316 deletions backend/PennCourses/docs_settings.py

Large diffs are not rendered by default.

31 changes: 14 additions & 17 deletions backend/PennCourses/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ.get(
"SECRET_KEY", "&3!f%)t!o$+dwu3(jao7ipi2f4(k-2ua7@28+^yge-cn7c!_14"
)
SECRET_KEY = os.environ.get("SECRET_KEY", "&3!f%)t!o$+dwu3(jao7ipi2f4(k-2ua7@28+^yge-cn7c!_14")

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
Expand Down Expand Up @@ -95,6 +93,7 @@

DATABASES = {
"default": dj_database_url.config(
# this is overriden by the DATABASE_URL env var
default="postgres://penn-courses:postgres@localhost:5432/postgres"
)
}
Expand Down Expand Up @@ -155,9 +154,7 @@
# DLA Settings

PLATFORM_ACCOUNTS = {
"REDIRECT_URI": os.environ.get(
"LABS_REDIRECT_URI", "http://localhost:8000/accounts/callback/"
),
"REDIRECT_URI": os.environ.get("LABS_REDIRECT_URI", "http://localhost:8000/accounts/callback/"),
"CLIENT_ID": "clientid",
"CLIENT_SECRET": "supersecretclientsecret",
"PLATFORM_URL": "https://platform-dev.pennlabs.org",
Expand Down Expand Up @@ -186,7 +183,7 @@
# Twilio Credentials
TWILIO_SID = os.environ.get("TWILIO_SID", "")
TWILIO_AUTH_TOKEN = os.environ.get("TWILIO_TOKEN", "")
TWILIO_NUMBER = os.environ.get("TWILIO_NUMBER", "+12153984277")
TWILIO_NUMBER = os.environ.get("TWILIO_NUMBER", "+12157826689")

# Redis
REDIS_URL = os.environ.get("REDIS_URL", "redis://localhost:6379/1")
Expand Down Expand Up @@ -216,15 +213,9 @@

# Registration Metrics Settings

STATUS_UPDATES_RECORDED_SINCE = (
"2019C" # How far back does our valid Status Update data span?
)
PCA_REGISTRATIONS_RECORDED_SINCE = (
"2020A" # How far back does our valid Registration data span?
)
WAITLIST_DEPARTMENT_CODES = (
[]
) # Which departments (referenced by code) have a waitlist system
STATUS_UPDATES_RECORDED_SINCE = "2019C" # How far back does our valid Status Update data span?
PCA_REGISTRATIONS_RECORDED_SINCE = "2020A" # How far back does our valid Registration data span?
WAITLIST_DEPARTMENT_CODES = [] # Which departments (referenced by code) have a waitlist system
# or require permits for registration during the add/drop period?
PRE_NGSS_PERMIT_REQ_RESTRICTION_CODES = [ # TODO: add post-NGSS list
"PCG",
Expand All @@ -235,4 +226,10 @@
"PIN",
"PDP",
] # Which pre-NGSS restriction codes indicate registration was handled by permit issuance?
ROUGH_MINIMUM_DEMAND_DISTRIBUTION_ESTIMATES = 200 # Aim for at least 200 demand distribution estimates over the course of a semester
ROUGH_MINIMUM_DEMAND_DISTRIBUTION_ESTIMATES = (
200 # Aim for at least 200 demand distribution estimates over the course of a semester
)

# The name of the schedule that is created/verified by Penn Mobile,
# containing the user's active course registrations from Path.
PATH_REGISTRATION_SCHEDULE_NAME = "Path Registration"
1 change: 1 addition & 0 deletions backend/PennCourses/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
path("review/", include("review.urls")),
path("plan/", include("plan.urls")),
path("alert/", include("alert.urls")),
path("degree/", include("degree.urls")),
path("base/", include("courses.urls")),
path("options/", include("options.urls", namespace="options")),
path(
Expand Down
11 changes: 9 additions & 2 deletions backend/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ verify_ssl = true
name = "pypi"

[dev-packages]
codecov = "*"
coverage = "*"
unittest-xml-reporting = "*"
flake8 = "*"
Expand All @@ -24,6 +23,8 @@ django = ">=3.2"
psycopg2 = "*"
requests = "*"
twilio = "*"
channels = "<3"
channels-redis = "*"
phonenumbers = "*"
celery = "<5"
redis = ">=3.4.1"
Expand All @@ -43,6 +44,10 @@ django-runtime-options = "*"
pyyaml = "*"
uritemplate = "*"
uwsgi = {version = "*", sys_platform = "== 'linux'"}
uvloop = {version = "*", sys_platform = "== 'linux'"}
gunicorn = "*"
uvicorn = {extras = ["standard"], version = "*"}
httptools = "*"
ddt = "*"
lark-parser = "*"
tqdm = "*"
Expand All @@ -58,7 +63,9 @@ scikit-learn = "*"
pandas = "*"
python-dateutil = "*"
docutils = "*"
selenium-wire = "*"
ics = "*"
psycopg2-binary = "*"
drf-nested-routers = "*"

[requires]
python_full_version = "3.10"
Loading

0 comments on commit f664708

Please sign in to comment.