-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.py
46 lines (35 loc) · 927 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
LiveIDE is online IDE for Python projects
Homepage and documentation: https://github.com/baseapp/liveide/
Copyright (c) 2013, BaseApp, V. Sergeyev.
License: MIT (see LICENSE for details)
"""
import os
import string
from ide import bottle
from ide.bottle import *
from ide.bottleauth import User
from ide import settings
from ide.decorators import login_required
# URLs handlers:
from ide.controllers import *
bottle.TEMPLATE_PATH.insert(0, "./ide/views/")
# -- SERVE STATIC FILES --
@route('/static/<path:path>')
def server_static(path):
return static_file(path, root=settings.APP_PATH+'/static/')
# -- APP ROUTES --
@get('/')
@view('layout.tpl')
@login_required
def index():
return {
"user": User(),
"static_url": settings.STATIC_URL
}
if __name__=="__main__":
run(host = settings.HOST,
port = settings.PORT,
debug = settings.DEBUG,
reloader = True
)