From f61a6c42c554a3c387d9c65ce56beedb3ca4195e Mon Sep 17 00:00:00 2001 From: HipsterCat Date: Wed, 28 Nov 2018 23:13:12 +0100 Subject: [PATCH] Added possible base_url --- web/context_processor.py | 6 +++++- web/templates/feeds.html | 2 +- web/templates/homepage.html | 2 +- web/templates/setup.html | 4 ++-- web/templates/template.html | 4 ++-- web/views.py | 12 ++++++------ 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/web/context_processor.py b/web/context_processor.py index 595d86a..deafcc0 100644 --- a/web/context_processor.py +++ b/web/context_processor.py @@ -7,5 +7,9 @@ def BASE_URL(request): else: scheme = 'http://' fullhost = request.get_host() - base = fullhost.split(":")[0] + port = fullhost.split(":")[1] + if port == 80 or port == 443: + base = fullhost.split(":")[0] + else: + base = fullhost return {'BASE_URL': scheme + base, } \ No newline at end of file diff --git a/web/templates/feeds.html b/web/templates/feeds.html index 4109b2c..67b3315 100644 --- a/web/templates/feeds.html +++ b/web/templates/feeds.html @@ -19,7 +19,7 @@
- {{ BASE_URL }}/{{ feed.uurl }}.rss + {{ BASE_URL }}{% url 'rss' uurl=feed.uurl %}

Delete

diff --git a/web/templates/homepage.html b/web/templates/homepage.html index a937ba6..9eeb3c4 100644 --- a/web/templates/homepage.html +++ b/web/templates/homepage.html @@ -5,7 +5,7 @@

Generate RSS out of any website

{% if error %}{% endif %} -
+ {% csrf_token %}
diff --git a/web/templates/setup.html b/web/templates/setup.html index d55179e..12e276c 100644 --- a/web/templates/setup.html +++ b/web/templates/setup.html @@ -29,7 +29,7 @@
  • - + {% csrf_token %} @@ -44,7 +44,7 @@
  • - +