haukurk / flask-restapi-recipe Goto Github PK
View Code? Open in Web Editor NEWA recipe for a RESTful API with key authentication. Powered with Flask+SQLALchemy and a minimal amount of external dependencies.
License: MIT License
A recipe for a RESTful API with key authentication. Powered with Flask+SQLALchemy and a minimal amount of external dependencies.
License: MIT License
Any reason why ?
python run.py -i
code dies with error Cannot import Serializer.
Is it issue with Marmallow version ?
(env) a@a-virtual-machine ~/api/flask-restapi-recipe $ pip install Serializer
Collecting Serializer
Downloading Serializer-0.2.1.tar.gz
Requirement already satisfied: setuptools in /home/a/api/env/lib/python2.7/site-packages (from Serializer)
Collecting simplejson (from Serializer)
Downloading simplejson-3.12.0-py2-none-any.whl (51kB)
100% |████████████████████████████████| 61kB 270kB/s
Building wheels for collected packages: Serializer
Running setup.py bdist_wheel for Serializer ... done
Stored in directory: /home/a/.cache/pip/wheels/a5/d1/e4/71d7902ec002fc5bad63f5f70a44a1c1b1b321b880fc27f407
Successfully built Serializer
Installing collected packages: simplejson, Serializer
Successfully installed Serializer-0.2.1 simplejson-3.12.0
(env) a@a-virtual-machine ~/api/flask-restapi-recipe $ python run.py -i
/home/a/api/flask-restapi-recipe/restapi/__init__.py:7: ExtDeprecationWarning: Importing flask.ext.sqlalchemy is deprecated, use flask_sqlalchemy instead.
from flask.ext.sqlalchemy import SQLAlchemy
/home/a/api/env/local/lib/python2.7/site-packages/flask_sqlalchemy/__init__.py:794: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future. Set it to True or False to suppress this warning.
'SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and '
Traceback (most recent call last):
File "run.py", line 32, in <module>
from restapi import app, db
File "/home/a/api/flask-restapi-recipe/restapi/__init__.py", line 40, in <module>
from modules.cakes import mod as cakes_module
File "/home/a/api/flask-restapi-recipe/restapi/modules/cakes/__init__.py", line 3, in <module>
from controllers import mod
File "/home/a/api/flask-restapi-recipe/restapi/modules/cakes/controllers.py", line 8, in <module>
from restapi.modules.cakes.models import Cake, db, CakeSerializer
File "/home/a/api/flask-restapi-recipe/restapi/modules/cakes/models.py", line 4, in <module>
from marshmallow import Serializer, fields
ImportError: cannot import name Serializer
Hi, I'm new to Flask and currently looking for a good starting point for building a json API. Your project seems to be exactly what I'm looking for.
However, I noticed that you're using an ancient version of marshmallow (1.0.0-a (2014-10-19)). Would you still recommend this as a starting point or would you recommend something else? Would love to see this updated to the latest version of marshmallow and would love to help if applicable. :)
Edit: According to the changelog "Serializer" has been renamed to "Schema". Did a quick and dirty search and replace, but now I'm getting "AttributeError: 'CakeSchema' object has no attribute 'data'".
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.