Skip to content

Commit 1eb8382

Browse files
committed
move SITE_URL to settings
1 parent 2e3d3bf commit 1eb8382

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

requestbin/app.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
from requestbin.models import db, Bin, Request
1717
from requestbin.utils import cors, make_psycopg_green
1818

19-
SITE_URL = "http://localhost:8000"
20-
2119

2220
app = Sanic()
2321
# Sentry

requestbin/schemas.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
from marshmallow import Schema, fields, post_dump, pre_load
55

6-
SITE_URL = "http://localhost:8000"
7-
# from requestbin.app import SITE_URL
6+
from requestbin import settings
87
from requestbin.models import Bin, Request
98

109

@@ -24,7 +23,7 @@ def generate_bin_url(self, data, many):
2423
data = [data]
2524
for b in data:
2625
suuid = shortuuid.encode(uuid.UUID(b["id"]))
27-
b["url"] = f"{SITE_URL}/{suuid}"
26+
b["url"] = f"{settings.SITE_URL}/{suuid}"
2827
return data[0] if not many else data
2928

3029

requestbin/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SITE_URL = "https://requestbin.app"

0 commit comments

Comments
 (0)