Does Django1.3 supports python 2.7.2? - django

I have plans to upgrade my server.My major requirement is python django1.3 and postgres8.4
I am using Django 1.3 and python 2.6.5 currently.Since i want to upgrade the server I want to know whether django 1.3 supports python 2.7.2 ?
I have read the specification that 11.04 comes with python 2.7.1 and 11.10 comes with 2.7.2.
I know that django 1.3 supports 2.4 to 2.7 ? Since i don't want to take any risk on server I want to know whether django 1.3 supports python 2.7.1 or 2.7.2 or both.
Please specify how can i verify i have installed virtual env .I have multiple versions of django and python and they gave the error No module named django.core.management.
Thanks in advance

Django supports all versions of Python 2.7. Since 2.7.1 and 2.7.2 are minor versions of 2.7, Django will work with them.

We are using Django 1.3 and Python 2.7.2 at work for quite some time now, and have not faced any compatibility issues.
If you want to have multiple versions of python to be installed, it is better to use tools like pythonbrew (https://github.com/utahta/pythonbrew).
Regarding the error "No module named django.core.management", you might have installed django with one of your other versions of python. Again, Better to create virtual envs somewhere in your project directories(so they are easy to find), or Even better to use pythonbrew to manage virtual envs.

Related

Is there are difference between working with Django vs Django on Anaconda

I am learning Django and I saw that you can install it regularly, according to the Django documentation. But I also saw that you can work with it in Anaconda. Is there a difference in developing? Or is it all just the same.
Thanks
Anaconda is a distribution on Python that comes with specific versions of a bunch of libraries so that everything is compatible and ready for data science.
So for Django, it will only give you a specific version of it. If you intend to use Anaconda as a framework to do data science, it might be worth it. If you just need Django, just install Django standalone.

Can I use Python 3.7 with Django 1.11?

We have an existing Django application which uses Django 1.11 and Python 3.6. For some security reasons I have been asked to use Python 3.7. I need to make the minimum changes possible. Do I need to upgrade Django as well? If so , is there any code changes required?
Thanks,
Python 3.7 compatibility was retrospectively added into the classifiers for Django v2.0 in this commit, even though v2.1 was already out. 1.11 was not included.
Discussion on Django tracker is here: https://code.djangoproject.com/ticket/28814
However, 1.11.x is LTS release series, so maybe if you're lucky that will still be added in a micro version upgrade at some later date.
Edit: Python 3.7 support was added in the micro version upgrade for Django 1.11.17 (2018-12-03, about 3 months after this question was originally asked)
According to this page on the Django docs, support for Python 3.7 was added in Django 1.11.17.
https://docs.djangoproject.com/en/1.11/faq/install/#what-python-version-can-i-use-with-django
"Django 1.11 requires Python 2.7, 3.4, 3.5, or 3.6. Django 1.11 is the first release to support Python 3.6. We highly recommend and only officially support the latest release of each series."
In the future, such questions are inevitably asked and answered in the Django docs.

Configure Web2Py to use Anaconda Python

I am new to Web2Py and Python stack. I need to use a module in my Web2Py application which uses "gensim" and "nltk" libraries. I tried installing these into my Python 2.7 on a Windows 7 environment but came across several errors due to some issues with "numpy" and "scipy" installations on Windows 7. Then I ended up resolving those errors by uninstalling Python 2.7 and instead installing Anaconda Python which successfully installed the required "gensim" and "nltk" libraries.
So, at this stage I am able to see all these "gensim" and "nltk" libraries resolving properly without any error in "Spyder" and "PyCharm". However, when I run my application in Web2Py, it still complains about "gensim" and gives this error: <type 'exceptions.ImportError'> No module named gensim
My guess is if I can configure Web2Py to use the Anaconda Python then this issue would be resolved.
I need to know if it's possible to configure Web2Py to use Anaconda Python and if it is then how do I do that?
Otherwise, if someone knows of some other way resolve that "gensim" error in Web2Py kindly share your thoughts.
All your help would be highly appreciated.
The Windows binary includes it's own Python interpreter and will therefore not see any packages you have in your local Python installation.
If you already have Python installed, you should instead run web2py from source.

Django and Connector/Python Integration

How can I setup a Django 1.5.1 app running with Python 3.3 to access a MySQL database? I tried using MySQLdb but apparently it doesn't support Python 3.3.
My next intention was to use Connector/Python, but what am I supposed to put for the "Engine" key of the Databases dictionary of the settings.py file?
If someone could provide detailed steps of how to get Django to work with Connector/Python, that would be great!
MySQLdb is the Python interface to MySQL [supported by django]. Version 1.2.1p2 or later is required for full MySQL support in Django.
At the time of writing, the latest release of MySQLdb (1.2.4) doesn’t support Python 3. In order to use MySQL under Python 3, you’ll have to install an unofficial fork, such as MySQL-for-Python-3.
This port is still in alpha. In particular, it doesn’t support binary data, making it impossible to use django.db.models.BinaryField.
Basically your only options to avoid Alpha quality drivers are:
Don't use python 3.
Don't use MySQL.
Hopefully this makes the choice easier: http://grimoire.ca/mysql/choose-something-else
REF: https://docs.djangoproject.com/en/dev/ref/databases/#python-3

Django/Jython ImproperlyConfigured error

As specified in the tutorial (http://www.jython.org/jythonbook/en/1.0/JythonDjango.html), I am using doj.backends.zxjdbc.postgresql as Django's DB engine. However, when I do
jython manage.py syncdb
I get an ImproperlyConfigured error, stating that doj.backends.zxjdbc.postgresql is not an available backend and that no module named postgresql exists. Strangely, if I enter the Jython shell, I can do
import doj.backends.zxjdbc.postgresql
without any error messages.
Ideas on what is going on here?
Solution: django-jython is out of date. 1.4 is not currently supported, so there is no solution to this issue other than to revert to a supported version of django.
Unfortunately it seems like django-jython is not seeing much/any active development anymore...
However, I have found that development versions available at the Google code repository below do work in Django 1.5 (and I assume they may work with 1.4 too, if you pick the right version):
https://code.google.com/p/django-jython/source/list
In particular, I have found that this dev version works with Django 1.5:
https://code.google.com/p/django-jython/source/detail?r=c4a0dd949a6d86a4baf8d1bed3b1926fa5318e87