LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 01-19-2012, 04:40 AM   #1
Mr. Alex
Member
 
Registered: May 2010
Distribution: Arch
Posts: 860

Rep: Reputation: Disabled
Django and Python 3


Hello guys!

https://docs.djangoproject.com/en/1....ith-python-2-3

They say:
Quote:
For larger Python-based software like Django, the transition is expected to take at least a year or two...
Well, Python 3 was out in 2008. What is taking them so long to make Django Python3-compatible?
 
Old 01-20-2012, 09:08 AM   #2
audriusk
Member
 
Registered: Mar 2011
Location: Klaipėda, Lithuania
Distribution: Slackware
Posts: 131

Rep: Reputation: 60
Not sure about Django, but for Python web frameworks in general the biggest problems come from string changes in Python 3. As you may know, Python 3 strings now contain Unicode characters (similar to Python 2 unicode objects), and for characters in any encoding (e.g. UTF-8) there are bytes objects. Unfortunately, they can't be used in the same way as Python 2 strings (at least in some cases), and that makes it hard for web frameworks to switch. To quote Armin Ronacher, the author of Flask framework, "the web is based on bytes with encodings", but Python 3 made it difficult to work with this kind of data. Python developers realize this now, and hopefully they'll come up with solutions for Python 3.3, but I wouldn't hope for the current situation to change any time soon.
 
1 members found this post helpful.
Old 01-27-2012, 11:23 PM   #3
php-developer
LQ Newbie
 
Registered: Jan 2012
Location: Atlanta
Distribution: PHP Framework, Web Designing Tools
Posts: 5

Rep: Reputation: 0
is it better than php...? i think no..
 
Old 01-28-2012, 03:22 AM   #4
audriusk
Member
 
Registered: Mar 2011
Location: Klaipėda, Lithuania
Distribution: Slackware
Posts: 131

Rep: Reputation: 60
This is totally unrelated to the question asked. Besides, "better" is meaningless by itself, unless we both have agreed upon its meaning.
 
Old 01-28-2012, 03:25 AM   #5
php-developer
LQ Newbie
 
Registered: Jan 2012
Location: Atlanta
Distribution: PHP Framework, Web Designing Tools
Posts: 5

Rep: Reputation: 0
i also cant understand what you want to say.. i am asking generally.. i want know which is better one in between php and python...??
 
Old 01-28-2012, 03:34 AM   #6
audriusk
Member
 
Registered: Mar 2011
Location: Klaipėda, Lithuania
Distribution: Slackware
Posts: 131

Rep: Reputation: 60
Look at the topic of this thread. It's about Django and Python 3 and has nothing to do with PHP. That's why it's unrelated to the question you asked. You should have started a new thread for it.

Now back to your question. Better for what? How do you define "better" in this case? How we should measure it? Not to mention that I don't know PHP and can't compare it with Python...
 
Old 01-31-2012, 02:35 AM   #7
Mr. Alex
Member
 
Registered: May 2010
Distribution: Arch
Posts: 860

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by php-developer View Post
is it better than php...? i think no..
Python is much better!

Some info: http://www.bitstorm.org/edwin/en/php/
 
Old 01-31-2012, 08:49 AM   #8
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 2,758

Rep: Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767
Quote:
Originally Posted by Mr. Alex View Post
Python is much better!
Yeah, seriously. Just compare how much cleaner the syntax for using "dictionaries" (Python hash tables) is than the syntax for using "arrays" (PHP hash tables).
 
1 members found this post helpful.
Old 01-31-2012, 04:49 PM   #9
sundialsvcs
Senior Member
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 3,685

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
"Which is better? A wrench, or a hammer?"

I think you get my point. All of these things are "tools in our toolboxes." (During the course of a work-week, many of us might switch between PHP, Perl, Python, Ruby, and so-on. Hence, any discussion of "which one is better?" would merely elicit, at the very best, strange looks.)

Every language moves forward from major-release to major-release, and when the major-number changes, the encompassed set of changes is usually quite large and fundamental. For instance, Python-3 brings in a completely new treatment of Unicode. A very necessary thing for Python to have done, of course, but fundamentally incompatible in some ways with its past. (And it is perfectly understood that both versions will co-exist for perhaps many years to come, if not "forever.")

Enter Django. (Or, if you prefer, your_package_name_here.) Could be any one, really, and any language. It's a large legacy product with a large number of installations and built ... built very well ... for a particular language implementation. In this case, and at this moment, that is Python-2.

Deal with it.

Quote:
P.S.: It is actually quite common for more than one version of a language to be installed on the same server at the same time to support backward-compatibility in business-necessary cases like this one. It's not something that you want to do forever, but it can go on for a surprisingly long time. You can, IIRC, still license FORTRAN-G from IBM, to run under DOS/VSE in your virtual machine, and, by gawd, if you've got a fleet of satellites up there in the sky doing ######## which still depend upon those computations still being done today as they were done in the 1970's (don't ask... I can't tell...), that's exactly what you would do and still do.

The one and only time that I saw an actual computer in-service which had magnetic core memory was at the University of Tennessee, which kept a machine around for years because it could still run IBM 1401 AutoCoder emulation. I have no idea how many thousands of dollars a month they paid to IBM to keep the machine going, but IBM quite-obligingly did so.
The Django development team will never have been caught flat-footed on anything at all, but a new language release is going to have some fundamental changes that are going to affect both Django and any other "plug-ins" that you may have. Fortunately, your appropriate response as a Django (or your_package_name_here your_language_name_here) user is a simple one: stick with the major-version of your_language_name_here that your_package_name_here has been certified for, and wait patiently.

Last edited by sundialsvcs; 02-10-2012 at 08:46 AM.
 
Old 01-31-2012, 07:20 PM   #10
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 2,758

Rep: Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767
These quotes are funny when taken together:

Quote:
It is expected that a document detailing Django's Python 2.x deprecation process, and timeline for moving to Python 3.x, will be made available concurrently with, or shortly after, the Django 1.3 release.
March 3, 2011: https://www.djangoproject.com/weblog/

Quote:
A document outlining our full timeline for deprecating Python 2.x and moving to Python 3.x will be published before the release of Django 1.4.
Dec 22, 2011: https://docs.djangoproject.com/en/de...-compatibility

Last edited by dugan; 02-01-2012 at 08:37 AM.
 
Old 02-10-2012, 04:14 AM   #11
audriusk
Member
 
Registered: Mar 2011
Location: Klaipėda, Lithuania
Distribution: Slackware
Posts: 131

Rep: Reputation: 60
Some additional on-topic info: according to http://getpython3.com/#notable-ports Django port to Python 3 is on the way, while Pyramid has already been ported (although it's still in alpha stage). Looks like transition to Python 3 is happening quicker than I thought it would. Now I need to wait for Flask port to happen and then I'll be a happy man.
 
Old 02-11-2012, 12:18 PM   #12
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 2,758

Rep: Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767
If you must have a Python 3 web development framework now, CherryPy is Python 3 compatible. It is also much "lighter" and more "minimalistic" than Django. You can use it with the Jinja2 templating engine, which is also Python 3 compatible. Add SQLAlchemy (also Python 3 compatible) to the mix, and you have a full stack. Albeit not a stack as full-featured as Django or Web2py.

Pyramid is also Python 3 compatible.

Last edited by dugan; 02-11-2012 at 12:44 PM.
 
1 members found this post helpful.
Old 02-13-2012, 10:05 AM   #13
Mr. Alex
Member
 
Registered: May 2010
Distribution: Arch
Posts: 860

Original Poster
Rep: Reputation: Disabled
dugan, is it hard to find a good hosting for all that?
 
Old 02-13-2012, 02:34 PM   #14
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 2,758

Rep: Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767
Haven't checked.

A quick Google search shows that WebFaction has Python 3 support.

Last edited by dugan; 02-13-2012 at 02:35 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Buttons in django ! noony123 Programming 3 03-21-2011 11:51 AM
Django jokar.mohsen Linux - Software 1 07-12-2010 07:51 AM
LXer: Review: Python Web Development with Django LXer Syndicated Linux News 0 02-23-2009 08:10 PM
Mumble, murmur, django and mumble-django. Linux.tar.gz Linux - Software 2 02-10-2009 02:47 AM
LXer: Develop for the Web with Python and Django LXer Syndicated Linux News 0 06-07-2006 08:03 AM


All times are GMT -5. The time now is 04:45 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration