Skeleton structure of a Pillar extension.
This commit is contained in:
51
attract_server/__init__.py
Normal file
51
attract_server/__init__.py
Normal file
@@ -0,0 +1,51 @@
|
||||
from pillar_server.extension import PillarExtension
|
||||
|
||||
from .modules import blueprint
|
||||
|
||||
|
||||
class AttractExtension(PillarExtension):
|
||||
@property
|
||||
def name(self):
|
||||
return 'attract'
|
||||
|
||||
def flask_config(self):
|
||||
"""Returns extension-specific defaults for the Flask configuration.
|
||||
|
||||
Use this to set sensible default values for configuration settings
|
||||
introduced by the extension.
|
||||
|
||||
:rtype: dict
|
||||
"""
|
||||
|
||||
return {}
|
||||
|
||||
def eve_settings(self):
|
||||
"""Returns extensions to the Eve settings.
|
||||
|
||||
Currently only the DOMAIN key is used to insert new resources into
|
||||
Eve's configuration.
|
||||
|
||||
:rtype: dict
|
||||
"""
|
||||
return {
|
||||
'DOMAIN': {
|
||||
'tasks': {
|
||||
'schema': {
|
||||
'name': {
|
||||
'type': 'string',
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def blueprints(self):
|
||||
"""Returns the list of top-level blueprints for the extension.
|
||||
|
||||
These blueprints will be mounted at the url prefix given to
|
||||
app.load_extension().
|
||||
|
||||
:rtype: list of flask.Blueprint objects.
|
||||
"""
|
||||
return [blueprint]
|
8
attract_server/modules.py
Normal file
8
attract_server/modules.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from flask import Blueprint
|
||||
|
||||
blueprint = Blueprint('attract', __name__)
|
||||
|
||||
|
||||
@blueprint.route('/jemoeder')
|
||||
def jemoeder():
|
||||
return 'je moeder'
|
Reference in New Issue
Block a user