예제 #1
0
파일: index.py 프로젝트: webtsys/paramecio
from bottle import get,post
from settings import config
from settings import config_admin
from citoplasma.lists import SimpleList
from citoplasma.generate_admin_class import GenerateAdminClass
from citoplasma.httputils import GetPostFiles
from cromosoma.formsutils import show_form, pass_values_to_form
from cromosoma.coreforms import PasswordForm
from importlib import import_module, reload
from bottle import redirect
from collections import OrderedDict

#from citoplasma.login import LoginClass
# Check login

t=ptemplate('admin')

load_lang('admin', 'common')
@get('/'+config.admin_folder)
@get('/'+config.admin_folder+'/<module>')
@post('/'+config.admin_folder+'/<module>')
def home(module=''):
    
    t.clean_header_cache()
    
    #check if login
    
    user_admin=UserAdmin()
    
    s=get_session()
    
예제 #2
0
파일: index.py 프로젝트: webtsys/paramecio
#!/usr/bin/python3

from citoplasma.mtemplates import ptemplate
from citoplasma.urls import make_url
from bottle import route, request
from settings import config

t=ptemplate('welcome')
@route('/welcome')
def home():

    return t.load_template('welcome.html', title="Welcome to Paramecio!!!", content="The simple web framework writed in Python3!!!")

@route('/welcome/<id:int>')
def page(id):
    
    return t.load_template('index.html', title="A simple example of a page", id=id, value=request.query.value)

@route('/welcome/test/<id:int>')
def test(id):
    
    return make_url('welcome/test/5', {'ohmygod': 'This is gooood', 'shutup':'Shut up!!'})

if config.default_module=="welcome":

    home = route("/")(home)