Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add home page

IKarbowiak9ca1180a38fc
diff --git a/saleor/core/views.py b/saleor/core/views.py
new file mode 100644
index 0000000000..803056c348
--- /dev/null
+++ b/saleor/core/views.py
@@ -0,0 +1,11 @@
+import os
+
+from django.template.response import TemplateResponse
+
+
+def home(request):
+ storefront = os.environ.get("STOREFRONT_URL", "")
+ dashboard = os.environ.get("DASHBOARD_URL", "")
+ return TemplateResponse(
+ request, "home.html", {"storefront": storefront, "dashboard": dashboard}
+ )
diff --git a/saleor/urls.py b/saleor/urls.py
index ec3f6a4dea..c95fcb3dea 100644
--- a/saleor/urls.py
+++ b/saleor/urls.py
@@ -3,7 +3,6 @@ from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib.staticfiles.views import serve
from django.views.decorators.csrf import csrf_exempt
-from django.views.generic.base import RedirectView
from .data_feeds.urls import urlpatterns as feed_urls
from .graphql.api import schema
@@ -22,6 +21,7 @@ urlpatterns = [
if settings.DEBUG:
import warnings
+ from .core import views
try:
import debug_toolbar
@@ -35,5 +35,5 @@ if settings.DEBUG:
urlpatterns += static("/media/", document_root=settings.MEDIA_ROOT) + [
url(r"^static/(?P<path>.*)$", serve),
- url(r"^", RedirectView.as_view(url="/graphql/")),
+ url(r"^", views.home, name="home"),
]
diff --git a/templates/home.html b/templates/home.html
new file mode 100644
index 0000000000..789b98c3c0
--- /dev/null
+++ b/templates/home.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+ <meta charset="UTF-8">
+ <title>It works!</title>
+</head>
+
+<body>
+ <a href={{dashboard}} target="_blank">Dashboard</a>
+ <a href={{storefront}} target="_blank">Storefront</a>
+ <a href="{% url "api" %}" target="_blank">Playground</a>
+</body>
+
+</html>