Unable to register a blueprint
<p><strong>CASE UPDATED: 2016-02-10 @ 19:45 UTC</strong></p>

<p>I've been researching for several weeks StackOverflow after reading a couple of books related to Flask, I've been testing and trying different configuration options, playing with several codes and finally I'm forced to write asking for help because I'm totally stuck and I can't go ahead alone. I'm sorry about that.</p>

<p><strong>The problem: I'm not able to register a Blueprint correctly in my app.</strong> I'm doing something wrong or something is not being done in the right way. <strong>Routes that belong to the blueprint are not working.</strong></p>

<p><strong>The error received: Not Found. The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</strong></p>

<p>I'm trying to build an API with Flask and Flask-Restful. I'm new to Flask and new to Flask-Restful too, so, you can imagine how big is my actual learning curve right now. </p>

<p>At present time, my project has this aspect:</p>

<pre><code>/
├── PROJECT
│   ├── __init__.py
│   └── api_1_0
│       ├── __init__.py
│       ├── resources
│       │   ├── __init__.py
│       │   └── users.py
│       └── routes.py
├── config.py
└── run.py
</code></pre>

<p><strong>The Plan</strong>
The PROJECT (named internally SelfCare) folder will have in the future two or three more packages inside (for web modules belonging to the same project). By now the only one of them is api_1_0.</p>

<p>The <strong>idea #1</strong> is to build an API with some basic functionalities. Now, the focus is to present plain messages (return 'hi hi') just to confirm all blocks are working alltogether.</p>

<p>The <strong>idea #2</strong> is to build the API as a blueprint inside the SelfCare package. Now i can have only 1 API, but later on i migth have two in parallel running (v1 and v2). </p>

<p>Some days ago i managed to get to work <strong>idea 1</strong> but <strong>idea 2</strong> is what i cannot get to work. Sorry. </p>

<p>My current files have this contents:</p>

<p>File: <strong>run.py</strong></p>

<pre><code>from SelfCare import create_app

app = create_app(config_name='development')

if __name__ == '__main__':
    app.run()
</code></pre>

<p>File: <strong>config.py</strong></p>

<pre><code>import os


class Config:
    SECRET_KEY = 'whatever'
    APP_DIR = os.path.abspath(os.path.realpath(__file__))
    STATIC_DIR = os.path.join(APP_DIR, 'static')
    IMAGES_DIR = os.path.join(STATIC_DIR, 'images')
    STYLES_DIR = os.path.join(STATIC_DIR, 'styles')
    TEMPLATES_DIR = os.path.join(STATIC_DIR, 'templates')

    # Method with an application instance (for now, just a bypass)
    @staticmethod
    def init_app(app):
        pass

class DevelopmentConfig(Config):
    DEBUG = True

class TestingConfig(Config):
    DEBUG = True

class ProductionConfig(Config):
    DEBUG = False

# Finally, this is a dead simple configuration dictionary
config = {
    # Possible profiles to run under
    'development': DevelopmentConfig,
    'testing': TestingConfig,
    'production': ProductionConfig,
    # Default application profile
    'default': DevelopmentConfig
}
</code></pre>

<p>File: <strong>PROJECT</strong>/<strong>init</strong>.py</p>

<pre><code>from flask import Flask, render_template
from flask.ext.moment import Moment
from config import config

moment = Moment()

def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config[config_name])
    config[config_name].init_app(app)

    # attach routes and custom error pages here
    @app.route('/')
    def index():
        return 'Here we will start'

    # HERE IT IS SUPPOSED THE BLUEPRINT IS REGISTERED 
    # AND ROUTES FROM BLUEPRINT ARE INCORPORATED TO MAIN PROGRAM
    from .api_1_0 import api as api_blueprint
    app.register_blueprint(api_blueprint)

    return app
</code></pre>

<p>File: PROJECT/<strong>api_1_0/__init__.py</strong></p>

<pre><code>from flask import Blueprint

api = Blueprint('api', __name__)

from .resources import users
</code></pre>

<p>File: PROJECT/<strong>api_1_0/routes.py</strong></p>

<pre><code>from .api_1_0 import resources

@resources.route('/user', methods=['GET'])
def users():
    return 'routes.py en blueprint api_1_0'
</code></pre>

<p>File: PROJECT/<strong>api_1_0/resources/__init__.py</strong></p>

<pre><code>This file is empty (a constructor).
</code></pre>

<p>File: PROJECT/<strong>api_1_0/resources/user.py</strong></p>

<pre><code>from flask_restful import Resource, reqparse, abort

# With the following dictionrary I do simulate a database connection
USERS = {
    'user1': {'task': 'Build an API'},
    'user2': {'task': 'Coordinate development'},
    'user3': {'task': 'Build core'},
}

def abort_if_user_doesnt_exist(user):
    if user not in USERS:
         abort(404, message="User {} doesn't exist".format(user))

parser = reqparse.RequestParser()
parser.add_argument('task')


class User(Resource):

    def get(self, user):
        abort_if_user_doesnt_exist(user)
        return USERS[user]

    def delete(self, user):
        abort_if_user_doesnt_exist(user)
        del USERS[callsign]
        return '', 204

    def put(self, user):
        args = parser.parse_args()
        task = {'task': args['task']}
        USERS[user] = task
        return task, 201
</code></pre>

<p>So, routes.py seems not to work, so I cannot go further in the API. I'm stuck, sorry... Probably the error is just in from of me as a big stone and I cannot see it. Sorry. </p>

<p>Any help will be much more than appreciated.
Regards.</p>