Skip to content
Snippets Groups Projects
Commit 6b2cac46 authored by Ferenc Schulcz's avatar Ferenc Schulcz
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
__pycache__
import os
import services
plugin_dir = os.path.dirname(__file__) # parent folder name of the absolute path of this file
def register(add_endpoint, add_postable_endpoint, add_menu):
add_endpoint('cat', cat)
add_menu('cat', 'Cat', 'cat')
def cat(**kwargs):
session = kwargs['session']
rqtools = kwargs['rqtools']
if 'username' not in session.keys():
return rqtools.redirect(rqtools.url_for('login', next='cat'))
if not services.authorize_user(session['username'], 'cat'):
return rqtools.get_403(None)
return rqtools.render_template(plugin_dir + '/templates/cat.html')
{% extends 'base.html' %}
{% block title %}Cat @ SFeri{% endblock %}
{% block content %}
<div style="text-align: center;">
<h1>This is a dummy service.</h1>
<h2>But here, look at a cat.</h2>
<img style="max-width: 95%;" src="https://thiscatdoesnotexist.com/">
<p>Source: <a href="https://thiscatdoesnotexist.com/">thiscatdoesnotexist.com</a></p>
</div>
{% endblock %}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment