app-generator / flask-gradient-able Goto Github PK
View Code? Open in Web Editor NEWGradient Able - Open-Source Flask Dashboard | AppSeed
Home Page: https://appseed.us/product/gradient-able/flask/
License: Other
Gradient Able - Open-Source Flask Dashboard | AppSeed
Home Page: https://appseed.us/product/gradient-able/flask/
License: Other
Hi there,
flask_sqlalchemy 2.4.4
SQLAlchemy 1.4.0 installed by flask_sqlalchemy
The following error pop from console:
2021-03-18T09:51:34.540758+00:00 app[web.1]: File "/app/app/base/routes.py", line 17, in <module>
2021-03-18T09:51:34.540759+00:00 app[web.1]: from app.base.models import User
2021-03-18T09:51:34.540759+00:00 app[web.1]: File "/app/app/base/models.py", line 7, in <module>
2021-03-18T09:51:34.540759+00:00 app[web.1]: from sqlalchemy import Binary, Column, Integer, String
2021-03-18T09:51:34.540789+00:00 app[web.1]: ImportError: cannot import name 'Binary' from 'sqlalchemy' (/app/.heroku/python/lib/python3.8/site-packages/sqlalchemy/__init__.py)
2021-03-18T09:51:34.540863+00:00 app[web.1]: [2021-03-18 09:51:34 +0000] [9] [INFO] Worker exiting (pid: 9)
2021-03-18T09:51:34.712103+00:00 app[web.1]: [2021-03-18 09:51:34 +0000] [4] [INFO] Shutting down: Master
2021-03-18T09:51:34.712184+00:00 app[web.1]: [2021-03-18 09:51:34 +0000] [4] [INFO] Reason: Worker failed to boot.
2021-03-18T09:51:34.788330+00:00 heroku[web.1]: Process exited with status 3
2021-03-18T09:51:34.852194+00:00 heroku[web.1]: State changed from starting to crashed
This is the same problem for all appseed template. Apparently Binary is not implement anymore in latest version of flask_sqlalchemy.
from sqlalchemy import Binary, Column, Integer, String
...
password = Column(Binary)
If you replace with String or LargeBinary in models.py another error appear as well, related here: pallets-eco/flask-sqlalchemy#932
In order to use the template you should force to an older version in requirements.txt:
flask_sqlalchemy==2.4.1
sqlalchemy==1.3.17
BR, Florent
I am using your dashboard and it's working great so far. However, now I ran into an issue;: To add image cropping support to one of my Flask/Jinja pages (based on your dashboard framework) I followed the Cropper.js usage example on GitHub, added the CSS link to the <head>
of my HTML page (between the {% block stylesheets %}
and the {% endblock stylesheets %}
statements) and added the following to the <body>
of my page (between the {% block javascripts %}
and the {% endblock javascripts %}
statements):
<script src="/static/assets/js/plugins/cropper.min.js" type="module"></script>
<script>
import Cropper from "cropperjs";
const image = document.getElementById('crop_image');
const cropper = new Cropper(image, {
aspectRatio: 1 / 1,
crop(event) {
console.log(event.detail.x);
console.log(event.detail.y);
console.log(event.detail.width);
console.log(event.detail.height);
console.log(event.detail.rotate);
console.log(event.detail.scaleX);
console.log(event.detail.scaleY);
},
});
</script>
The cropper.min.js
file can be found, as I see in the Firefox 77.0.1 browser console.
However, I do get the following error message in the console:
SyntaxError: import declarations may only appear at top level of a module
at the first line of the JS <script>
:
import Cropper from "cropperjs";
I found in this StackOverflow thread that this error might come in Firefox from missing type="module"
, but as you can see I do have this in my code. Any other ideas what could be wrong here?
I deployed our application based on your Gradient Able framework to our server, setting DEBUG=False
in the .env
file. However, after starting the app via gunicorn
the global DEBUG
config option in the Flask app is still set to True
. It does work, however, when hard-coding the value in run.py
, instead of the following line:
DEBUG = config("DEBUG", default=False)
Is this a bug or a feature?
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.