Print Flask-Restless Routes
# show api routes
for route in app.url_map.iter_rules():
print(route.rule)
# show api routes
for route in app.url_map.iter_rules():
print(route.rule)
In case you haven’t already noticed, the command in the title won’t work.
You need to use: pip install MySQL-python (Python 2 only; mysqlclient is its maintained fork for Python 3)
This article explains the correct approach: http://mysql-python.blogspot.com/2012/11/is-mysqldb-hard-to-install.html
That is the key to the kingdom when it comes to using extensions like Flask-Admin and Flask-Restless on existing tables which do not have a class already.
Install VNC server on Ubuntu Server 12.04 (Amahi Wiki)
That guide gave me the least amount of hassle when I installed VNC on a server. I started by trying to get it working with 13.10, but had issues with a grey screen when tightvnc connected.
I got rid of this error just by creating the database manually. Shouldn’t Cake do this?
Rather than dealing with my .htaccess problems to fix the error, I thought this would be a better approach: http://wwdj.wijndaele.com/getting-started-with-cakephp-without-mod_rewrite/
Unfortunately, it messed up quite a few links on my site.
I ended up solving the problem by changing “AllowOverride” None to “AllowOverride All” in my /etc/apache2/sites-available/default file.
Why the heck is CakePHP using .htaccess files by default anyway? Yii handles this more cleanly.
While I was searching for a some good boilerplate to start my first CakePHP project with, I found this: https://github.com/hugodias/cakeStrap
There’s also this one, but it has much fewer commits: https://github.com/zynesis/cakephp-boilerplate
Got this error when I was missing a library that came with the build.
If you’re getting this error, you may need to move the lib folder from your build directory into the folder of your JAR file.
You can access the endpoint parameter by using self.endpoint.
class displayResults(BaseView):
@expose('/',methods=('GET','POST'))
def index(self):
print(self.endpoint)
admin.add_view(displayResults(name='test', endpoint='test2'))
That will print “test2”.
This happens when you try to render a template like this:
return render_template('admin/upload.html')
You need to use self.render instead:
return self.render('admin/upload.html')