Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Subdirectory deployment #26

Open
wants to merge 2 commits into
base: master
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
4 changes: 3 additions & 1 deletion routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
from webtodotxt import app, auth
from helpers import *
import todotxtio
import os


@app.route('/')
@auth.login_required
def home():
locale = get_locale()
FORCE_ROOT_URL = os.getenv('WEBTODOTXT_FORCE_ROOT_URL', None)

return render_template('app.html', first_week_day=locale.first_week_day + 1)
return render_template('app.html', first_week_day=locale.first_week_day + 1, force_root_url=FORCE_ROOT_URL)


@app.route('/todo.txt', methods=['GET', 'POST'])
Expand Down
2 changes: 1 addition & 1 deletion templates/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ <h3>{{ _('Contexts') }} <button class="small" @click="todo.contexts = []" title=
Vue.config.silent = {{ 'false' if config['DEBUG'] else 'true' }};
Vue.config.productionTip = false;

ROOT_URL = '{{ request.url_root }}';
ROOT_URL = '{{ force_root_url if force_root_url else request.url_root }}';

moment.locale('{{ g.CURRENT_LOCALE }}');

Expand Down
4 changes: 3 additions & 1 deletion webtodotxt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
from flask_babel import Babel
from flask import Flask
import logging
import os


# -----------------------------------------------------------
# Boot

STATIC_URL_PATH = os.getenv('WEBTODOTXT_STATIC_URL_PATH', '')

app = Flask(__name__, static_url_path='')
app = Flask(__name__, static_url_path=STATIC_URL_PATH)
app.config.from_pyfile('config.py')

if not app.config['TITLE']:
Expand Down