librelist archives

« back to archive

Flask unable to serve pages

Flask unable to serve pages

From:
kracekumar ramaraju
Date:
2011-11-14 @ 03:20
Hello
        I have deployed flask in webfaction.

#index.py
from gummi import app as application

I have configured my custom path as http://www.kracekumar.com/gummi.

#my __init__.py
from flask import Flask
app = Flask('gummi')
app.secret_key =  "Here goes secret key "
app.debug = True
import gummi.views

class WebFactionMiddleware(object):
    def __init__(self, app):
        self.app = app

    def __call__(self, environ, start_response):
        environ['SCRIPT_NAME'] = '/test_gummi'
        return self.app(environ, start_response)

app.wsgi_app = WebFactionMiddleware(app.wsgi_app)

Note: index.py and __init__.py are not in same level.

Now when I access http://www.kracekumar.com/gummi/, Page not found error.
-- 
*
"Talk is cheap, show me the code" - Linus Torvalds
Winning Regards
KraceKumar.R
http://kracekumar.wordpress.com
+91-97906-58304
*
*+91-85530-29521*
*
*

Re: [flask] Flask unable to serve pages

From:
Adam Patterson
Date:
2011-11-14 @ 05:37
In WebFactionMiddleware.__call__ you are using '/test_gummi', but you
mentioned using `/gummi`.

On Mon, Nov 14, 2011 at 10:20 AM, kracekumar ramaraju
<kracethekingmaker@gmail.com> wrote:
> Hello
>         I have deployed flask in webfaction.
> #index.py
> from gummi import app as application
> I have configured my custom path as http://www.kracekumar.com/gummi.
> #my __init__.py
> from flask import Flask
> app = Flask('gummi')
> app.secret_key =  "Here goes secret key "
> app.debug = True
> import gummi.views
> class WebFactionMiddleware(object):
>     def __init__(self, app):
>         self.app = app
>     def __call__(self, environ, start_response):
>         environ['SCRIPT_NAME'] = '/test_gummi'
>         return self.app(environ, start_response)
> app.wsgi_app = WebFactionMiddleware(app.wsgi_app)
> Note: index.py and __init__.py are not in same level.
> Now when I access http://www.kracekumar.com/gummi/, Page not found error.
> --
> "Talk is cheap, show me the code" - Linus Torvalds
> Winning Regards
> KraceKumar.R
> http://kracekumar.wordpress.com
> +91-97906-58304
> +91-85530-29521
>
>