V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
inyfee
V2EX  ›  问与答

百度 BAE 部署 django 链接访问 404 - Not Found

  •  
  •   inyfee · May 2, 2014 · 2793 views
    This topic created in 4380 days ago, the information mentioned may be changed or developed.
    把开发完成的django 项目 部署在bae上面,首页可访问 ,但是访问其它链接都是404 - Not Found ,不知道怎么解决?

    这是我的app.conf
    handler :

    - url : /(.*)
    script: index.py

    - expire : .jpg modify 10 years
    - expire : .swf modify 10 years
    - expire : .png modify 10 years
    - expire : .gif modify 10 years
    - expire : .JPG modify 10 years
    - expire : .ico modify 10 years


    这是我的index.py

    #-*- coding:utf-8 -*-


    import os
    import sys

    os.environ['DJANGO_SETTINGS_MODULE'] = 'django.settings'

    #path = os.path.dirname(os.path.abspath(__file__))
    path = os.path.dirname(os.path.abspath(__file__))

    if path not in sys.path:
    sys.path.insert(1, path)

    from django.core.handlers.wsgi import WSGIHandler
    from bae.core.wsgi import WSGIApplication

    application = WSGIApplication(WSGIHandler())
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1448 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 16:55 · PVG 00:55 · LAX 09:55 · JFK 12:55
    ♥ Do have faith in what you're doing.