antkahn / flask-api-starter-kit Goto Github PK
View Code? Open in Web Editor NEWStart a Flask API in less than 5 minutes
License: MIT License
Start a Flask API in less than 5 minutes
License: MIT License
I can't run make db/upgrade
command because of an Error:
File "src/manage.py", line 3, in <module> from flask_migrate import Migrate, MigrateCommand File "/mnt/vendor/lib/python3.4/site-packages/flask_migrate/__init__.py", line 3, in <module> from flask.ext.script import Manager ImportError: No module named 'flask.ext' make: *** [Makefile:31: db/upgrade] Error 1
OS - Linux Manjaro, python 3.4.
All required packages are installed correctly, what I have to do?
Why shouldn't we apply cookiecutter to this project for proper templating?
Error in running
make:install
I can't setup the project
Getting 404 for "static_url_path": "/application/apidocs"
I successfully ran make server.install
And then I tried to run make server.start
, but I got this error
❯ make server.start
docker-compose up server
Starting backend_dbdata_1 ... done
Starting backend_db_1 ... done
Starting backend_server_1 ... done
Attaching to backend_server_1
server_1 | Traceback (most recent call last):
server_1 | File "src/server.py", line 1, in <module>
server_1 | from flasgger import Swagger
server_1 | ModuleNotFoundError: No module named 'flasgger'
backend_server_1 exited with code 1
When I had ran make server.install
, this was the last part of the long output
<previous output>
Successfully installed Flask-1.0.3 Flask-Migrate-2.5.2 Flask-RESTful-0.3.7 Flask-SQLAlchemy-2.4.0 Flask-Script-2
.0.6 Jinja2-2.10.1 Mako-1.2.0 MarkupSafe-2.1.1 PyYAML-6.0 SQLAlchemy-1.3.4 Werkzeug-0.15.4 alembic-1.0.10 aniso8
601-9.0.1 appdirs-1.4.4 atomicwrites-1.4.0 attrs-21.4.0 black-19.3b0 certifi-2022.6.15 chardet-3.0.4 click-8.1.3
colorclass-2.2.2 coverage-6.4.1 docopt-0.6.2 dparse-0.5.1 entrypoints-0.3 flake8-3.7.7 flasgger-0.9.2 idna-2.8
importlib-metadata-4.11.4 importlib-resources-5.8.0 isort-4.3.20 itsdangerous-1.1.0 jsonschema-4.6.0 mccabe-0.6.
1 mistune-2.0.2 more-itertools-8.13.0 packaging-21.3 pip-upgrader-1.4.12 pluggy-0.13.1 psycopg2-2.8.2 py-1.11.0
pycodestyle-2.5.0 pyflakes-2.1.1 pyparsing-3.0.9 pyrsistent-0.18.1 pytest-4.6.2 pytest-cov-2.7.1 pytest-sugar-0.
9.2 python-dateutil-2.8.2 python-editor-1.0.4 pytz-2019.1 requests-2.22.0 safety-1.8.5 setproctitle-1.1.10 six-1
.12.0 termcolor-1.1.0 terminaltables-3.1.10 toml-0.10.2 typing-extensions-4.2.0 urllib3-1.25.11 wcwidth-0.2.5 zi
pp-3.8.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the syst
em package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
WARNING: You are using pip version 22.0.4; however, version 22.1.2 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
Hi Ant how can we deal with CORS. I have a React application using Axios but when I do so there is a message saying that CORS is not allowed.
I tried a "make database._migrate" but I got an error because flask_script is not supported any more, I switched to Flask CLI
And my manage.py is as follow.
from flask import Flask
from flask.cli import FlaskGroup
from flask_migrate import Migrate
import config
from models import db
server = Flask(__name__)
server.debug = config.DEBUG
server.config["SQLALCHEMY_DATABASE_URI"] = config.DB_URI
db.init_app(server)
migrate = Migrate()
migrate.init_app(server, db)
#migrate = Migrate(server, db)
cli = FlaskGroup(server)
if __name__ == "__main__":
cli()
How ever when I run : make database._migrate which is ( docker-compose run --rm server python src/manage.py db migrate )
I get
Error: Could not locate a Flask application. Use the 'flask --app' option, 'FLASK_APP' environment variable, or a 'wsgi.py' or 'app.py' file in the current directory. make: *** [database.migrate] Error 2
Could help with that please ?
raise child_exception_type(errno_num, err_msg, err_filename)
server_1 | FileNotFoundError: [Errno 2] No such file or directory: '/mnt/src/server.py': '/mnt/src/server.py'
any idea why I am getting this error
See Title,
would that be possible?
When running the above command I get the following error:
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements-dev.txt'
Does the file need to be added to the Docker image before this command can be run?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.