Browse Source

Add remote adress

master
Burathar 4 years ago
parent
commit
ce1d4f2394
  1. 2
      app/routes.py

2
app/routes.py

@ -32,7 +32,7 @@ def index():
db.session.add(url) db.session.add(url)
db.session.commit() db.session.commit()
death = None if url.death is None else url.death.strftime('%Y-%m-%d %H:%M:%S') death = None if url.death is None else url.death.strftime('%Y-%m-%d %H:%M:%S')
app.logger.info(f"{request.environ['REMOTE_ADDR']} created hash '{url.hash}' for '{url.url}'. Death: {death}, View Counter: {url.view_counter}") app.logger.info(f"{request.environ['HTTP_X_FORWARDED_FOR'} created hash '{url.hash}' for '{url.url}'. Death: {death}, View Counter: {url.view_counter}")
link = url_for("resolve_hash", hash=hash, _external = True) link = url_for("resolve_hash", hash=hash, _external = True)
flash(Markup(f'Your url is shortend to <a href="{link}">{link}</a>')) flash(Markup(f'Your url is shortend to <a href="{link}">{link}</a>'))
return redirect(url_for('index')) return redirect(url_for('index'))

Loading…
Cancel
Save