I am just starting with a flask and I am trapped. I am trying to write a small blog to get used to the structure, so I made two packages: "auth" and "posts". I read the section "Large Applications" in the "Documents checkbox" .
My catalog is as follows.
>/root
>>run.py
>>/posts
>>>____init____.py
>>>views.py
>>>/templates
>>>/static
>>/auth
>>>____init____.py
>>>views.py
>>>/templates
>>>/static
run.py looks like this:
from flask import Flask
from auth import auth_app
from posts import posts_app
auth_app.run()
posts_app.run()
/posts/__init__.pyand /auth/__init__.pylook like this:
from flask import Flask
auth_app = Flask(__name__)
import auth.views
and view.py look like this:
from auth import auth_app
@auth_app.route('/auth/')
def index():
return "hello auth!"
But whenever I start the server, only localhost / auth / is available, and everything else gives 404, som, I assume that the posts application does not start.
Can anyone help?
source
share