Is Django itself a backend? - python

I have been reading into Python/Django but I was unable to find good info. I have learned that Django is a backend, but some people are saying that django itself runs on PostGreSQL?
So I need to learn both python/PostGreSQL? Or is DJANGO itself a backend?

Django is a python web framework. It can be used to create a backend. Django does not run on PostgreSQL, it can work with it as a database. But Django can work with many other databases as well, e.g. mysql, sqlite etc. If you want to learn web programming in python, then Django is a reasonble choice. However, there are many other popular alternatives to the Django web framework.

Related

What versions of Django does the Django MongoDB Engine support?

Is the maintenance and support for Django MongoDB Engine still active? I searched online and found that the original author of Django MongoDB Engine already quit the project. I am wondering if it supports Django 1.8. If not, I would switch to another mongo ORM such as mongoengine.
Related question (with no answers): configuration of django_mongodb_engine with django 1.8 or any other way to use MongoDB
Django-mongodb-engine is no longer keeping up with the latest Django improvements As a web developer you can take up the challenge of connecting Django to MongoDB in several ways, but depending on what strategy you chose you may run out support from the authors sooner or later. There are several reasons for that. Listed below are some:
Use a MongoDB compatible model framework: Use a third party framework like MongoEngine or Ming in your django projects. However will miss out on:
1500+ core contributors to the project,
Hourly fixes and ticket resolution,
Ramp down on the expertise of existing Django models and ramp up on the new model framework.
Perhaps the biggest drawback is that your project can’t use any of Django’s contrib models! Forget about using Admin, Sessions, Users, Auth, etc., contrib modules for your project!
Alternatively you can try:
Django SQL to MongoDB connector — Djongo: The strategy is to translate Django SQL query syntax generated by the Django ORM into pymongo commands. Djongo is a SQL to MongoDB query compiler. It translates every SQL query string into a mongoDB query document.
SQL syntax will never change regardless of future additions to Django, by using a connector instead of a different ORM, your project will work on all versions of Django.

Difference among Mongoengine, flask-MongoEngine and Django-MongoEngine?

What are the differences between the Mongoengine, flask-MongoEngine and Django-MongoEngine projects?
I am using Mongoengine in my Django project. Will I get any benefits if I use Django-MongoEngine instead?
Django MongoEngine aim is to provide better integration with Django - however currently (June 2014) its not stable and the readme says
DO NOT CLONE UNTIL STABLE
So beware!
In addition to the other answers, flask mongoengine adds support for wtforms. If your not using flask admin, or doing server side rendering, chances are you don't need flask-mongoengine. You can just go with mongoengine
flask-mongoengine adds a few helpers to integrate MongoEngine into a Flask application.
Connection definition in Flask parameters
get_or_404 / first_or_404 shortcuts (abort 404 if document not found)
paginator added to QuerySet object
automatic form generation using WTForms
django support was pulled off Mongoengine into a separate code (django-mongoengine). Although it has no release, it seems to be worked on (see the recent commits).
Django framework provides a unified unified interface to connect to a Database backend which is usually an SQL based database such as SQLite or Postgresql. That means that the developer does not have to worry about writing code specific to the database technology used, but defines Models and perform transactions and run all kinds of queries using the Django database interface. Flask does the same.
Django does not support MongoDB from the get-go. To interact with MongoDB databases, Collections and Documents using Python one would use the PyMongo package, that has a different syntax, and paradigms than Django Models or Flask's.
MongoEngine wraps PyMongo in way that provides a Django-like Database for MongoDB.
MongoEngine-Django tries to allow Django web-apps developers to use a Mongo database as the web-app backend. To provide the Django Admin, Users, Authentication and other database related features that are available in Django usually with an SQL backend.
MongoEngine-Flash tries to allow Flask web-apps developers to use a Mongo database as the web-app backend.
Personally, I prefer using a structured SQL database for the web-app essentials, and PyMongo, or MongoEngine to interface with any further Mongo Databases where unstructured big data might reside...

B2B App authentication on GAE - Google Accounts or custom user base (Django or Web2Py)?

Which of these would you pick for a B2B app (targeting small/med-small businesses) built on GAE with python:
Google Accounts
Custom Users with Django
Custom Users with Web2Py
I'm very tempted to go the Google Accounts route as it's very well integrated into GAE and takes care of everything from user creation to session authentication, and even takes care of forgotten passwords. However, I'm sure there are significant drawbacks to this, including usability, but if you are starting from scratch, which approach would you pick and why?
I started with Google account, added all OpenID and quickly found that the only accounts people use for my site are google and facebook accounts. So now I only have login with google and login with facebook. But I'm going to add my own accounts and I'm doing it with webapp2 instead of django and instead of web2py. I tried web2py but webapp2 and its auth model seem much better and not like with web2py a lot of unnecessary code that is not for app engine.
Try this and its auth model (there is example code from http://code.google.com/p/webapp-improved/issues/detail?id=20) and I hope it will work for you.
Google Accounts forces users to have Google Apps or Gmail accounts. Some customers might not like this.
Rolling your own is an (unnecessary) burden: you have to have sign up process (with captcha and/or 3rd party email confirmation), keep all user records, handle the security, etc..
I'd suggest you go with OpenID: http://code.google.com/appengine/docs/python/users/overview.html#Authentication_Options
Why both Create Django user from Google users. you will be able to adapt your system user with other system next
I've understood that question was only on authentication after I've written this so most of things here are offtopic, but I just wanted to demotivate on using full-stack solutions like django or web2py in appengine.
I can tell you something about django because I've used it for over a year and I do like it for certain types of websites. It was first framework which I've tried to use on appengine and I've dropped it after two weeks.
These are things in django which doesn't work or make no sense in appengine:
django models and orm: designed for sql; appengine sdk has its own models.
django admin site: is designed for sql databases, doesn't work on appengine
auto-forms from models: designed for django models
django management commands: none of commands which come with django is useful when working with appengine SDK.
django development server: appengine sdk has its own development server, django's one does not work.
django "plugable apps" architecture: at least in my practice it was useless on appengine.
static files collector: great tool to collect static files from various reusable applications into one folder, only if you have many reusable applications.
There exists django-nonrel project which says it can run django with admin site on appengine. It can, with half of things working and a lot of bugs. You spend more time trying to fix what does not work than building things.
What might be useful from django framework:
django forms: can be exchanged for a better library WTForms
django url routing: can use Werkzeug instead
django request/response objects and HTTP exceptions: can use Werkzeug instead
django pretty-printing exceptions: Werkzeug does it better, it adds a web debugger.
django i18n and localization: can be changed with babel
django templates: jinja2 is similar and a lot faster, which is important because appengine is an expensive platform. ctypes module is required to debug errors in jinja templates, however ctypes is forbidden on appengine, but on development server it does work, for debugging you don't need more.
Actually Jinja2, Werkzeug, WTForms and babel are so cool, that there exists projects for each of them which integrates them with django.
I know two frameworks which use these libraries:
kay-framework: made for appengine, a bit outdated, but a great example how you can use Jinja2, babel and Werkzeug on appengine.
flask from Armin Ronacher, the man behind Werkzeug and Jinja2.
I've not used web2py, however since it is also a full-stack framework like django is, I think it will be as bad as django is. Full-stack solutions simply do not fit in this different environment. Simple libraries fit in any environment.

What are the various Python CMS's and their statuses?

I'm usually a PHP developer that has lots of experience with Drupal CMS & framework. And I realize Drupal is very mature, but I don't know much about the Python scene.
I've heard the following CMSs be mentioned:
Plone
Django (framework)
What other CMSs are there, and what do you think are some of the pros and cons? How mature are they? Is it even worth starting to use Python for general web development?
My vote is for Django CMS. Django itself is a development framework (but one that gives you a lot for free, including an excellent pluggable admin interface). DjangoCMS is an application that you can install into a Django application. I am using DjangoCMS and, as a Django user, I think it's perfect. I'm not what non-Django users would think. It's no Wordpress.
Here is a page which lists the Python based CMS. Zope based Plone is the very popular one and very mature too. Apart from that you, have customized solutions built using Django, like Django-CMS and also there are wiki like MoinMoin Engines. That page gives a lot of options for you.
Django is not a CMS; it's a web development framework.
That said, Django's roots come from newspaper-oriented CMS-like systems. Unsurprisingly, that makes Django a very good platform on which to create a CMS.
You can check the state of Django-based CMSs on Django-packages, which tracks the project metrics of many packages.

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