Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8129109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:10:01+00:00 2026-06-06T08:10:01+00:00

I’m just getting started with flask and I’ve hit a snag. I’m trying to

  • 0

I’m just getting started with flask and I’ve hit a snag. I’m trying to write a small blog to get used to the framework so I made two packages, an “auth” and “posts”. I read through the Large Applications section in the Flask docs.

My directory looks like this.

>/root
>>run.py 

>>/posts

>>>____init____.py  
>>>views.py  
>>>/templates
>>>/static  

>>/auth  
>>>____init____.py  
>>>views.py  
>>>/templates
>>>/static

the 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__.py and /auth/__init__.py look like this:

from flask import Flask

auth_app = Flask(__name__)

import auth.views

and the views.py look like this:

from auth import auth_app

@auth_app.route('/auth/')
def index():
    return "hello auth!"

But whenever I run the server, only the localhost/auth/ is available, and everything else gives a 404, som I’m assuming that the posts app isnt being run.

Can anyone help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T08:10:02+00:00Added an answer on June 6, 2026 at 8:10 am

    Your auth_app.run() method blocks your program from continuing to run. This is why the the posts_apps app doesn’t get run. The entire process of serving up pages happens within Flask’s run() method. Therefore, you can conclude that you can’t run two Flask apps in the same process.

    If you wish to split up your application into two like this, the recommended way is to use blueprints. Rather than creating two apps (auth and posts), you create two blueprints. You then create one application like so…

    from flask import Flask
    from auth import auth_blueprint
    from posts import post_blueprint
    
    app = Flask(__name__)
    app.register_blueprint(auth_blueprint)
    app.register_blueprint(post_blueprint)
    app.run()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used javascript for loading a picture on my website depending on which small
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.