Esempio n. 1
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from intranet.urls import app

view = app.view(__name__)

view.simple(('^$','^home/$'), 'home.html')

view.simple('^git/$', 'git.html')
view.simple('^music/$', 'music.html')
view.simple('^config/$', 'config.html')
view.simple('^torrents/$', 'torrents.html')
view.simple('^home/$', 'home.html')
Esempio n. 2
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from intranet.urls import app

view = app.view(__name__)

view.simple(('^$', '^home/$'), 'home.html')

view.simple('^git/$', 'git.html')
view.simple('^music/$', 'music.html')
view.simple('^config/$', 'config.html')
view.simple('^torrents/$', 'torrents.html')
view.simple('^home/$', 'home.html')
Esempio n. 3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from intranet.utils.shortcuts import render_with_context
from intranet.urls import app
from streaming.models import Channel, Video
from intranet.settings.local_settings import TWITCH_API, STREAM_UPDATE

from django.views.decorators.http import require_POST
from django.http import HttpResponse
from django.utils.timezone import now

import urllib.request
import json

view = app.view(__name__, root=r'^streams/')

view.simple('^list_streams.js$', 'list_streams.js')

@view.route('^$')
def streams(request):
  return render_with_context(request, 'streams.html')


@view.route('^add/$')
def add_stream(request):
  status, messages, content = process_add(request)
  result = {
      'status' : status,
      'messages' : messages,
      'content' : content,