I developed an app in Django, mainly for educactional purposes, and I want to host it on GAE. The app uses MySql and Haystack/Whoosh. I'm following this django-nonrel guide, but I'm not sure if Haystack/Whoosh will work on the NoSQL from GAE. Any ideas?
It's possible to use Haystack on GAE, but you can't use whoosh as the search backend. Instead, you'll need to use a hosted Solr or ElasticSearch as a backend search server. Try searchbox.io, they tell you how to get it working with Haystack here.
I don't know about haystack on appengine but there is a nonrel-search which I is designed to work on appengine and NoSQL databases.
Also I don't think GAE supports reletional database like Mysql.
Whoosh is a file-based search backend so as long as you have write access to a directory then you should be able to use it.
You need to configure the directory of the search index in your Django application and run the appropriate command (./manage.py rebuild_index or ./manage.py update_index) to build the search index into that directory.
Related
I have developed one example project in django1.4 & python 2.7, I want to deploy it on google app engine,
but how to configure my project as per App Engine we didn't get.
We have a site running on google app engine, but it is including with all html,js.
How do we configure a database on google app engine to deploy our django project?
Possibly the best option is to use Django Non-Rel. It's the only way (that I know of) to use the Django ORM (the django database interface) on Google App Engine without using Google's costly cloud SQL service. To do this, you'll need to use a customized version of Django and import several more libraries. It's a small project to get it up and running, but it's worth the effort. More information can be found on this website:
http://django-nonrel.org/
Note, that even though django-nonrel allows you to use the Django database interface, it will not allow you to use certain SQL features, such as joins. If you need joins, then your best option would be to use Google App Engine + Google Cloud SQL. Documentation for that is here.
Regarding the comments:
Yes, it can run on windows, I run it on Windows.
Also, the site allbuttonspressed.com is old and out of date, use the
one above for information.
How do I setup Django on Google App Engine to use DataStore? I did a bunch of searches and some seemed to point to something called django-nonrel. But I couldn't find anything that looked like a definitive guide up-to-date (dated around 2012-2013).
The djangae project seems to be what you're looking for. From their documentation:
Djangae (jan-gee) is a Django app that allows you to run Django
applications on Google App Engine, including (if you want to) using
Django's models with the App Engine Datastore as the underlying
database.
It has a Database backend that supports AppEngine's Datastore, so you can use Django's ORM. In addition to Django's default fields, a number of other field types are added in the project.
You should consider the list of limitations carefully though.
I need to use the mysql backend in Django. Documentation in the settings file says just use 'django.db.backends.mysql', and this is also documented at https://docs.djangoproject.com/en/dev/ref/settings/#engine
When I set a database setting engine to 'django.db.backends.mysql' Django errors out.
I've found references on the web that one needs to install MySQLdb. However, I look in my site-packages where I find django/db/backends/sqlite3 and django/db/backends/mysql.
So, it looks like I have the Django back ends in place. Do I have the MySQL back end installed but have a configuration problem, or do I need to install the MySQLdb package to allow the backend to work?
django.db.backends.mysql is a wrapper around MySQLdb; you will need to have MySQLdb installed for it to work, or it will raise an ImproperlyConfigured exception on startup.
The Django database backends generally work like this -- they rely on a lower-level database interface library, but they provide a uniform interface to the ORM layer.
The only backend that will work "out-of-the-box" is SQLite, but that backend is no different, it's just that the SQLite interface is built into the python distribution, so it's almost guaranteed to be present.
You will have to install MySQLdb in order to use MySQL as db backend.
If you read the documentation, it states,
If you plan to use Django's database API functionality, you'll need to
make sure a database server is running.
So yes, you need to install a MySQL server in order for the backend to work.
I have a running django-nonrel application and I would like to add a real time module using web sockets.
I would like to use django-socketio but it seems that gevent (which is used to serve the site) does not work properly with mongodb (link) which is the backend of the Django application.
Does anyone already try to set up django-socketio with mongodb as a backend ?
Dry
I found that using Tornado/Tornadio2 with Django is much easier than the gevent-based alternatives. If you need help setting that up I'd be happy to share my runserver_socketio.py script.
I am trying to build a DB system using Django as the framework and MongoDB for my database management system. How can I add things to a specific collection? Where should I specify the name of the collection?
Then, after I have added to the collection, how can I use a Django shell to ask for that information from Mongo?
You don't "add a collection" on MongoDB -- you just use them. In Django - MongoDB: (could not connect to localhost:27017) Connection refused you already got Django MongoDB Engine running, so I don't understand your question? You can use the Django ORM to get data into and out of MongoDB now.
There are many good tutorials of using mongodb with Django. One popular way is to use django-mongodb which integrates to django models. Here is their tutorial.
Another screencast: Integrating mongoDB and Django.