question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What's in create_app?

See original GitHub issue

This framework seems to depend on a method called create_app() whose implementation is not provided. I’ve created a similar method based on these snippets. My problem is that when I run my tests the method url_for() is not visible.

Can you provide your implementation of create_app()?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
z0ucommented, Mar 28, 2018

If you don’t have an app factory, you can just return the instance of your app from your module. For example if you configure your app in a file called hello.py as shown in the Flask Getting Started docs:

from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World!"

Then you can just return the app attribute of the module:

from pytest import fixture
import hello

@fixture
def app():
    return hello.app
1reaction
ruipachecocommented, Sep 21, 2017

Can you share your app factory? I still don’t have this working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating a Vue Application - Vue.js
The object we are passing into createApp is in fact a component. Every app requires a "root component" that can contain other components...
Read more >
The Benefits of the New Vue 3 App Initialization Code
In this article, we will start by looking at how the app initialization code works in Vue 2 apps. Then we'll see what...
Read more >
Vue 3 Tutorial (for Vue 2 Users) - Vue.js Developers
Wondering what the key features and changes of Vue 3 are? ... Rather than using new Vue() , we now need to import...
Read more >
CreateApp - The Award-Winning Mobile App Builder Platform
The CreateApp platform's intuitive interface makes it easy to manage and update your content, so you can focus on what's most important to...
Read more >
A definitive guide to Vue 3 components - LogRocket Blog
Vue apps consist of components, which are reusable pieces of UI code that build functional and complex web applications.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found