Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
8424 Lượt xem

Hi, I have problem with module website, when i install it, i have a homepage with url like 127.0.0.1/ . But my project don't need a homepage. So how can i make it redirect to 127.0.0.1/web/login (login page). I tried with controller but it doesn't work:

@http.route('/', type='http', auth="public")

    def handler(self):

        return werkzeug.utils.redirect('/web/login')

Am i wrong ? Please help me !

Thanks and Regards,

Minh

Ảnh đại diện
Huỷ bỏ

delete website module you don't need that one. web module is enough.

Tác giả

I think its good ideal, but i just want to hide homepage and i still need some template in module website to inherit for my module. Another way, I find a solution to this problem by write a controller in my module like this:

class Website(Home):

@http.route('/', type='http', auth="public", website=True)

def index(self, **kw):

_logger.warning('oke')

return werkzeug.utils.redirect('/web')

It will help us redirect to url /web.

Thanks and Regards,

Minh

Bài viết liên quan Trả lời Lượt xem Hoạt động
5
thg 7 25
16468
2
thg 8 23
2947
1
thg 12 20
13673
0
thg 5 19
3743
7
thg 3 15
18198