How Apache Solr works with Django 1.5? - python

I am new on Django framework. So please help me work with solr and Django.
I am trying with some tutorial available on different site but all worked with older versions of Django and Apache Solr those are not compatible with new versions.

Django and Apache Solr have no relation with each other.
You can use django like you would use normally, and use pysolr or sunburnt python module to fetch/write data to SOLR.
I would recommend pysolr for its simplicity.

Related

implementing user authentication to django app which uses mongodb in backend

I am creating django app,
I am using
django 1.10
mongodb in backend.
To connect with mongodb I am using mongoengine 0.11 and pymongo 3.4
when I try to import User from mongoengine.django.auth, it is giving error as-
from mongoengine.django.auth import User
ImportError: No module named django.auth
can anyone help me to implement authentication using mongoengine. Some posts suggest that I should use mongoengine 0.9 but I am afraid to downgrade version as we are using mongoengine 0.11 on production and there is lot of code already written using it.
Can you please suggest me solution which does not involve changing version of above mentioned packages. Whereas I can use any other stable packages as long as existing functionality doesn't break. Or is there any way to implement authentication using django's custom authentication classes, and use relational database only for authentication.
Django by default doesn't provide any support for NoSQL database. mongoengine is python package to connect with MongoDB so it doesn't provide any direct support for authentication.Check this website if you can find any mongo backend for django https://github.com/django-nonrel.

Django with NoSQL database

I am working with an Django application which uses Django 1.8 version.
Most of the data we deal with is JSON formatted ones. We are trying to implement any NoSQL database.
But I see that MONGODB is not compatible for version 1.8 and over and Is there any NoSQL database that can be efficiently mapped to Django 1.8 or over ??
Thanks in advance.
NoSQL databases are not officially supported by Django itself. There are, however, a number of side project and forks which allow NoSQL functionality in Django, like Django non-rel.
You can also take a look on the wiki page which discusses some alternatives.
This is quoted from the django official documentation
Here is an interesting repo for allowing using MongoDB as your django backend. It works by compiling SQL commands into MongoDB document queries.
Most of the basic stuff like django admin, django session etc all work.
https://github.com/nesdis/djongo
Years after (2022), djongo is still the only option which works fine with Django 3.0.x as well (with some constraint restrictions) in NoSQL environment.
But now that Django's 4.0.1 major release is in the air, djongo's latest 1.3.6 (released in June 2021 according to pypi) is beginning to break. In my experience with Django==4.0.4 and djongo==1.3.6 together, almost none of the select/update queries work, and SQLDecodeError exceptions lay around in console.
djongo maintainer(s) have created paid subscription plans as well, but I have not been their customer like that so can't comment anything about the commercialized version of djongo. Rest, the open-sourced AGPL licensed djongo is the only best option for unpaying developers to use Django with MongoDB, given that the developer restricts themselves to Django 3.0.x.
I've been using Django==3.0.5 with djongo==1.3.6, to be specific here, which works fine in most of the circumstances.

Can anyone offer a full example of django-haystack with solr 5.x?

Trying to find an example of how to build an application using solr 5.x with django-haystack, but most examples online are using solr 4.x or solr 3.x. Can anyone give some instructions on how to work with solr 5.x using django-haystack, or just offer some example project? Thanks!
It seems Django-Haystack does not support SOLR 5 well. SOLR 5's solrconfig.xml file for its core uses ManagedIndexSchemaFactory as default schemaFactory. If you change it to ClassicIndexSchemaFactory, you will run in troubles with your schema.xml which is generated by python manage.py build_solr_schema. Lots of fields' types are not supported. Probably going back to SOLR 4 would be a better choice

Django on appegine and tutorial

I am new to Django and Appengine. I found that Django 1.2 version is supported by Google Appengine. Does it mean that Django 1.2 comes with the installation of Google Appengine SDK?
Or should we install djangoappengine
Any pointers, experiences and tutorials on running Django on Appengine is appreciated.
Thanks in advance.
I think djangoappengine would be a good start. It seems like an active project. Please also note that Google offers SQL backend as of October 2011 so whether you need SQL or NoSQL, you should be able to use Django for it.
General note: If you are new to both Django and GAE, you probably should start with learning Django on your local computer running a development server that comes with it. Once you get familiar with how Django works in general you can dig into GAE etc.
You can try django-nonrel, we use it professionally and it works well on App Engine.
You may just want to start with this tutorial as it is the official and recommended way for Django project on app engine.
Note that previously there some hacks and patches, but at the moment those are deprecated and above tutorial should be just enough to get you started.

Python Web Framework with best Mongo support

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

Categories