Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
4046 มุมมอง

Hello,

I tried to follow the Building a website tutorial to display the teachers and biographies.
But i don't have the "Hello, world" page; i always have a 404: Page not found when i execute the the link : " http://localhost:8069/academy/academy/ " after paste this code below (academy/controllers.py) and restart my server.
someone can help me please ?
Regards

# -*- coding: utf-8 -*-
from odoo import http

class Academy(http.Controller):
    @http.route('/academy/academy/', auth='public')
    def index(self, **kw):
        return "Hello, world"
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hai Alvin.

Everything seems fine in your code.

I Think you may tried the URL like this "/academy/academy" thats why you getting the error 404.

Try the URL like this, "page/academy/academy".


Eg: http://0.0.0.0:8013/page/academy/academy


Thanks

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

i don't understand well your answer, but i just added "from . import controllers" in the " __init__.py " file of my controllers directory.

Is there anything else to do?

Thanks

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ม.ค. 18
12722
2
ธ.ค. 21
24376
3
ก.ค. 21
21292
0
ม.ค. 21
2185
2
ก.ค. 20
4256