Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue85 port redirect to 3000 #293

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@
from django.urls import include, path
from django.views import defaults as default_views
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponseRedirect
from graphene_django.views import GraphQLView

from opencontractserver.analyzer.views import AnalysisCallbackView

logger = logging.getLogger(__name__)

def home_redirect(request):
scheme = "https" if request.is_secure() else "http"
host = request.get_host().split(":")[0]
new_url = f"{scheme}://{host}:3000"
return HttpResponseRedirect(new_url)

urlpatterns = [
path("", home_redirect, name="home_redirect"), # Root URL redirect to port 3000
path(settings.ADMIN_URL, admin.site.urls),
path("graphql/", csrf_exempt(GraphQLView.as_view(graphiql=settings.DEBUG))),
*(
Expand Down
4 changes: 3 additions & 1 deletion docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ it online for others to use. You'll get a default, local user with admin access.
the user password after completing this tutorial. We assume you're using Linux or Max OS, but you could
do this on Windows too, assuming you have docker compose and docker installed. The commands to create
directories will be different on Windows, but the git, docker and docker-compose commands should all be the
same.
same.

Read the [System Requirements](./requirements.md) for addtional information.

## **Step 1**: Clone this Repo

Expand Down