Requirement is to use Hazelcast cache running on some other machine for the Django application we been developing. Could you please advise what would be the config and if any module needs to be installed?
Note: I'm using memache already. But need to use hazelcast instead for project requirement.
If you are looking for a pure memcache replacement, see the doc
There is a Hazelcast Python client but since I'm not a Python developer I can't really tell if it is hard or easy to integrate it into Django, however most certainly possible :)
https://pypi.python.org/pypi/hazelcast-python-client
Related
I have a Django project that I want to incorporate Elasticsearch. I am using elasticsearch-py for this purpose. In my project, I need to segment Chinese too, and I found a good python library for this (jieba for Chinese).
jieba also has elasticsearch-jieba-plugin. I can use this plugin for sure.
But I am wondering since I am using python anyway, can I just use jieba-py ?
Or, do I have to use something written in Java in order to work with elasticsearch? Thanks.
It's better to use the official plugins that are maintained and have support on the forum, except if you have really specific needs.
Check the page here you may find the analyzer of your dreams.
https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis.html
But I am wondering since I am using python anyway, can I just use jieba-py ?
Yes and no, depends on your needs if you plan to search the elasticsearch plugin is enough.
Or, do I have to use something written in Java in order to work with elasticsearch?
No you don't need, elasticsearch-py is enough.
I have a python program that I would like to present as a simple web application. The program currently uses sqlite for storage. I also need to distribute the whole thing to colleagues so having something standalone and easy to start would be ideal ( no install if possible). This web app is meant to be used locally , not by multiple users over a network.
Is there a suitable python framework that might fit my needs? I looked at Django so far but it seems a bit heavy handed for what I need.
Thanks for any suggestions.
I have never tried it myself, but you could try Bottle:
Bottle is a fast, simple and lightweight WSGI micro web-framework for
Python. It is distributed as a single file module and has no
dependencies other than the Python Standard Library.
try http://docs.python.org/library/simplehttpserver.html
As web frameworks are not part of the standard lib, you will have to install something in every case. I would propse to look at http://flask.pocoo.org/. It has a build in WSGI server.
Lots of choices for Python web frameworks! Another is web2py which is designed to work out of the box and allows, but doesn't require, through-the-web development. It is mature and has a strong community and is well-documented.
Tornado as a framework may be a lot more than what you're looking for. However it will meet the requirement of being a completely python based web server. http://tornadoweb.org
I generally just download the source, drop it in /tornado/ of my project and do includes there from the app.
I don't think that any web framework is specifically oriented for the use case you're talking about; They all assume they are running on a server and there's a browser on a remote machine that is accessing them.
A better approach is to think about the HTTP server you'll be using. It's probably preferable to use a server that's as easy to pack and ship as the rest of the python code you'll be using. Now most frameworks provide a 'development' server that's easy to invoke from the command line, but most of them are intended to be "easy for the developer" which often means they are restricted to a single thread. This is bad for deployment because single threaded servers will always feel a bit sluggish.
CherryPy stands out in contrast, by providing a full featured, embedded server that's easy to configure for many use cases, and is available by default with the rest of the framework. There are probably others, but I haven't used 'em.
I'm looking to write a small web app to utilise a dataset I already have stored in a MongoDB collection. I've been writing more Python than other languages lately and would like to broaden my repertoire and write a Python web app.
It seems however that most if not all of the current popular Python web development frameworks favour MySQL and others with no mention given to MongoDB.
I am aware that there are more than likely plugins written to allow Mongo be used with existing frameworks but so far have found little as to documentation that compares and contrasts them.
I was wondering what in people's experience is the Python web development framework with the best MongoDB support?
Many thanks in advance,
Patrick
I have not tried MongoKit although it has been around for a while and retains a good reputation. I personally prefer MongoEngine and feel very comfortable with it (maybe because I like its nice homepage and good documentation). There is also a very good opensource project named Mumblr which demonstrates a Django-MongoEngine-MongoDB combination, which I think a very good starter for any project. I'm developing a CMS for my own company using this app.
I've used MongoKit with Pylons before and it worked out good.
You might want to refer to this post though: MongoDB ORM for Python?
There is no stable support for mongodb using django framework. I tried using mongoengine, but unlike models, provided for admin in django framework, there is no support for mongoengine.
Correct if I am wrong.
Flask is the best framework to use with MongoDB. It has a mongodb library called flask-pymongo
Make sure you run the following commands before starting your project.
$ pip3 install Flask
$ pip3 install Flask-PyMongo
I just built a small app with the very cool and minimalistic web.py.
I am using a cheap shared hosting package (at WebFaction) and have installed web.py via virtualenv. I cannot use the system python since I need additional packages which I'm not allowed to install into the system python.
So now I start my app with
/home/me/mypython/python myapp.py <myport>
It feels like a cumbersome solution, and I'm not sure how much traffic this setup can take. Any general hints?
Thanks in advance
Is there a reason you're not using fastcgi? That's probably considerably better than trying to use some high-numbered port, particularly since your webhost may not be very happy about that at all. There are a few notes on doing that (on dreamhost, but it should be similar for you) in this post:
http://thefire.us/archives/261
I need to add wiki to my Tornado webapp. i'm new to python so i would like it not too intimidating to be learned and integrated and can use my existing authentication system, hence the lightweight. it would be better if can use mongodb backend.
I already take a look at moin-moin and it seems too complex(?). any other alternative?
Have a look at Hatta. Overwrite WikiRequest.get_author() method to plug your authentication system. But it uses mercurial repository to store the data.
Skeletonz is a very nice lightweight Python cms that might be worth a look...