26 lines
550 B
Python
26 lines
550 B
Python
# -*- coding:utf-8 -*-
|
|
import pymongo
|
|
import bottle
|
|
import cgi
|
|
|
|
|
|
__author__ = 'tpeetz'
|
|
|
|
|
|
class Plugin:
|
|
|
|
def __init__(self, app, database, sessions):
|
|
self.app = app
|
|
self.db = database
|
|
self.sessions = sessions
|
|
self.routing()
|
|
|
|
def routing(self):
|
|
self.app.route('/medien', 'GET', self.media_index)
|
|
|
|
def media_index(self):
|
|
cookie = bottle.request.get_cookie("session")
|
|
username = self.sessions.get_username(cookie)
|
|
return bottle.template('media_index', dict(username=username))
|
|
|