Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changing url route of flask-profiler #43

Closed
havok2063 opened this issue Jul 7, 2016 · 2 comments
Closed

changing url route of flask-profiler #43

havok2063 opened this issue Jul 7, 2016 · 2 comments

Comments

@havok2063
Copy link

How can we modify the url route for the flask-profiler? Currently it automatically routes to the main, e.g.

localhost:5000/flask-profiler/

This is fine for debug mode or for production mode where you are not behind a subdomain on a larger server. How can I set the url route for flask-profiler to be behind a subdomain so it works in production mode? E.g. my webapp site is at

www.domainname.com/myapp/

and I would like to access the flask-profiler at

www.domainname.come/myapp/flask-profiler/

Both of these

www.domainname.come/myapp/flask-profiler/
www.domainname.com/flask-profiler/

fail and do not recognize the name. This question is related to #38.

My config for flask-profiler is configured for production mode

    # Setup the profile configuration
    app.config["flask_profiler"] = {
        "enabled": True,
        "storage": {
            "engine": "sqlite"
        },
        "basicAuth": {
            "enabled": True,
            "username": "admin",
            "password": "admin"
        }
    }

Has anyone actually successfully used this in a production environment and not in debug mode?

@savakarv
Copy link

We have done that in our project. I am able to access flask_profiler in a link http://example.com/project-name/flask-profiler/

We were able to achieve this by setting WSGIScriptAlias in httpd.conf file (service is running inside Tomcat).
WSGIScriptAlias /project-name "/project/path/project-name-rest.wsgi"

@muatik
Copy link
Owner

muatik commented Oct 22, 2016

There is an option to set flask-profiler's url, however it isn't documented yet. https://github.com/muatik/flask-profiler/blob/master/flask_profiler/flask_profiler.py#L153

app.config["flask_profiler"] = {
        "endpointRoot": "secret-flask-profiler"
}

This directive's defaut value is flask-profiler.

I, or somebody, need to should document this in README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants