
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
fastapi-framework-mvc
Advanced tools
The base configuration file is located on the config dir.
For enabling ssl encryption within the application, you will need to add in the "SERVER" key entry in the config file
SSL:
Certificate: "path to the cer file (public key)"
PrivateKey: "path to the pki file (private key)"
You can add default database using only the configuration file.
...
DATABASE:
default: mysql
mysql:
driver: mysql+pymysql
user: "replace this with your database user"
password: "replace this with your database user's password"
database: "replace this with your database name"
address: "replace this with your hostname"
models: "mysql (python module that require to be put under Models.Persistent module)"
readonly: false
...
...
DATABASE:
informix:
driver: informix
user: "replace this with your database user"
password: "replace this with your database user's password"
database: "replace this with your database name"
address: "replace this with your hostname"
models: "informix (python module that require to be put under Models.Persistent module)"
params:
SERVER: "replace with your server name"
CLIENT_LOCALE: "replace with your client locale"
DB_LOCALE: "replace with your server locale"
dialects:
informix:
module: IfxAlchemy.IfxPy
class: IfxDialect_IfxPy
informix.IfxPy:
module: IfxAlchemy.IfxPy
class: IfxDialect_IfxPy
informix.pyodbc:
module: IfxAlchemy.pyodbc
class: IfxDialect_pyodbc
readonly: false
...
"params" are parameters that need to be send within the connection to the database. In that example using informix database "SERVER", "CLIENT_LOCALE" and "DB_LOCALE" are required parameters for the connection to the database.
"dialects" are the python modules configuration to translate models into sql statements to query the database
By default escape char between url and first param is ? and escape char between parameters is & but they can be changed by adding within your database params section:
...
url_param_separator: '?' #Change it with yours
params_separator: '&' #Change it with yours
...
...
DATABASE:
db01:
...
db02:
...
...
There are 3 files where you could register your flask server routes, You could find these file under the src/Server folder:
All the server http error code must be registered inside the init method of the ErrorHandler.py file.
Example:
srv.add_exception_handler(500, Controllers.Web.HTTP50XController.error500)
All the web based http routes must be registered inside the init method of the Web.py file.
Example:
server.add_route('/', Controllers.Web.HomeController.index, methods=['GET'], 'home')
All the Rest API based routes must be registered inside the init method of the WS.py file.
Example:
server.add_api_route('/api/content/', Controllers.WS.ApiController.index, methods=['GET'], 'api.content')
In case of database used within controllers, you will need to use @safe from fastapi_framework_mvc.Database.decorators over your function. Example bellow:
from fastapi_framework_mvc.Database.decorators import safe
class Content(object):
@safe
@staticmethod
def index(api_param):
return api_param
class Controller(Content):
@classmethod
def index(cls, api_param:str):
return super(Controller, cls).index(api_param)
All web based http file controllers must be placed under the Controllers.Web
module.
The class based controllers that you register into the app must be imported into the __init__.py
file of the Controller.Web
module.
The file based that contain your view functions must must also be inmported into the __init__.py
file of the Controller.Web
module.
All Rest API based controllers must be placed under the src/Controllers/WS folder.
The class based controllers that you register into the app must be imported into the __init__.py
file of the Controller.Web
module.
The file based that contain your view functions must must also be inmported into the __init__.py
file of the Controller.Web
module.
you can create SQLAlchemy models by creating a new module under the Models.Persistent
module and place each models inside your module that you previously created.
The models that you register into the app must be an Database.Model
or Database.get_models_by_name('replace that with your database connection name')
object, you could import this object using the following line into your database model:
from Database import Database
All models must be imported inside the __init__.py
of your base module and you must import this module in the __init__.py
of the Models.Persistent
module
The src/static folder contains all static file for your web based application.
The src/template folder contains layouts and templates file for your web based application. Those files are content configurable, you can also import layout inside the your template file, it allow you to have only content editable part into your template file.
docker-compose up
docker-compose start
docker-compose restart
docker-compose stop
# coding: utf-8
import azure.functions as functions
import fastapi_framework_mvc.azure
import logging
import os
os.environ.setdefault('CONFIG_FILE', './config/config.yml')
app = functions.AsgiFunctionApp(fastapi_framework_mvc.azure.AzureFunctionsApp(), http_auth_level=functions.AuthLevel.ANONYMOUS)
...
"extensions": {
"http": { "routePrefix": ""}
},
...
We assume that your system already had python v3+ and pip v3+ installed.
git clone https://github.com/frederickney/fastapi-framework-mvc.git
cd fastapi-framework-mvc
pip3 install .
or
pip install fastapi-framework-mvc
python -m fastapi_framework_mvc.cli -h
python -m fastapi_framework_mvc.cli -cp <your project>
or
python -m fastapi_framework_mvc.cli --create-project <your project>
When the project is created, more command can be used when the env "CONFIG_FILE" is set and can be run through
python -m fastapi_framework_mvc.app
see -h for usages
export CONFIG_FILE=config/config.yml
python -m fastapi_framework_mvc.server
python -m fastapi_framework_mvc.wsgi
FAQs
FastAPI MVC framework
We found that fastapi-framework-mvc demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.