flask-celery
flask-celery copied to clipboard
manage.py runserver broken routes
Hi Ask,
I have duplicated this behavior on 2 os's (aix with python 2.6.2) and (mint-debian with python2.7.1)
I have tried the release version of flask-celery as well as the master from gh.
My debmint test was in a virtualenv with no access to system site-packages
I simplified the myapp.py in your example dir to remove all celery reference and just make it a basic Flask hello world.
I get nothing for routes. When I open a shell in app context and look at the Flask object, here is its url map.
Map([[<Rule '/static/
Note: On my real app, when I run manage.py celeryd, all is well. I can then run the web app using "python myapp.py" and routing works, so there is something with the runserver option of manage.py that is acting up (or a misconfiguration of mine ;))
edit* typos
Some things I am trying to identify the problem.
- temporarily reduced the number of implemented commands by making install_commands method a noop. This was to see if it was a conflict with another command. Same output.
Here is a simple flask app I was using in a virtualenv. Not having good luck with gh markdown.
I have an app with celery features I can pastebin to you.
import myapp
def create_app():
return Flask("myapp")
app = create_app()
@app.route("/")
def hello_world():
return "Hello world"
if **name** == "**main**":
app.run(host='0.0.0.0', debug=True)
just edit manage.py and remove
from myapp import create_app
app = create_app()
and replace it with
from myapp import app
the problem is with from myapp import create_app already calls create_myapp() which is in root of myapp.py so if you call it again in manage.py you get a new app object that won't have the routes attached