Best way to learn Django considering Python versions and etc.

227 views
Skip to first unread message

Bruce Whealton

unread,
Dec 10, 2013, 4:57:45 PM12/10/13
to django...@googlegroups.com
Hello all,
             So, I started looking at recommended reading on Django and a couple books referred me to first go through "The Definitive Guide To Django."  I have to admit some concern about reading a book on Django that is some 5 plus years old.  I've come to think of this as the information age and as such, anything over a certain number of years as being very problematic.  However, I did notice that the Bitnami Django stack does use Python 2.5 - the version I just downloaded... not even 2.7.x but 2.5. 
            Another confusing thing is that the Bitnami Guide for what I just downloaded is radically different from what actually gets downloaded and setup.  I cannot even find the application or a similar folder to the app I created when I installed Django stack from Bitnami.  Even looking at the access_log was not very helpful. There are calls to /img/bitnami.png and a GET request to StartProject, which was the project name I chose during installation. 
           After trying to figure out this installation, I jumped back to "The Definitive Guide to Django" and jumping into chapter 2, I found success.  So. I'll probably move forward with the instructions in that text and hope that I'm not learning something outdated.  Again, this text is recommended as a prerequisite  for other texts, as it were. 
Any advice on this?   Has anyone had great success with Bitnami's Django stack? 
            Here is another thing that has me a bit confused.  Coming from Drupal, Wordpress, etc, the thinking is that one should always get the latest version, at least the latest minor version, e.g. if running Drupal 7.24 comes out and you are running Drupal 7.23, you are strongly encouraged to upgrade.  However, some of my reading and course work on Django discusses creating isolated environments that don't break when a new version is released.  What makes it such that if Django 1.65, or 1.7 comes out there is not an easy upgrade to the next latest edition without breaking things? 
           My intention is not to be critical, as I really like Python and Django.  Similar to learning Node.js and the specification of Dependencies, I have not read or found discussed in an online course, why one might not use the latest version of a dependency... or how one would be needing earlier versions of a dependency or a component of a framework. 
Thanks in advance for any advice,
Bruce

Tom Evans

unread,
Dec 10, 2013, 5:54:23 PM12/10/13
to django...@googlegroups.com
On Tue, Dec 10, 2013 at 4:57 PM, Bruce Whealton <brucew...@gmail.com> wrote:
> Hello all,
> So, I started looking at recommended reading on Django and a
> couple books referred me to first go through "The Definitive Guide To
> Django." I have to admit some concern about reading a book on Django that
> is some 5 plus years old. I've come to think of this as the information age
> and as such, anything over a certain number of years as being very
> problematic. However, I did notice that the Bitnami Django stack does use
> Python 2.5 - the version I just downloaded... not even 2.7.x but 2.5.

Python has many versions. The most recent version of 2.5 is old, but
it is not decrepit (just yet). I would use 2.7 though.

> Another confusing thing is that the Bitnami Guide for what I
> just downloaded is radically different from what actually gets downloaded
> and setup. I cannot even find the application or a similar folder to the
> app I created when I installed Django stack from Bitnami. Even looking at
> the access_log was not very helpful. There are calls to /img/bitnami.png and
> a GET request to StartProject, which was the project name I chose during
> installation.
> After trying to figure out this installation, I jumped back to
> "The Definitive Guide to Django" and jumping into chapter 2, I found
> success. So. I'll probably move forward with the instructions in that text
> and hope that I'm not learning something outdated. Again, this text is
> recommended as a prerequisite for other texts, as it were.
> Any advice on this? Has anyone had great success with Bitnami's Django
> stack?

The bitnami stack is not django, it is a packaging of django. I would
not use it, and instead simply install the components you require.

The django manual contains a tutorial and extensive documentation, and
is built from the source code to which it refers. Whatever version of
django you install, referring to the django manual for that version
will give you correct tutorials and documentation.

> Here is another thing that has me a bit confused. Coming from
> Drupal, Wordpress, etc, the thinking is that one should always get the
> latest version, at least the latest minor version, e.g. if running Drupal
> 7.24 comes out and you are running Drupal 7.23, you are strongly encouraged
> to upgrade. However, some of my reading and course work on Django discusses
> creating isolated environments that don't break when a new version is
> released. What makes it such that if Django 1.65, or 1.7 comes out there is
> not an easy upgrade to the next latest edition without breaking things?

No, isolated environments are so that your app does not break because
someone else's app on the same server was upgraded.

You should always use a supported version of django, and use the most
recent release of that version. You do not always have to use the most
recent version - just as long as it is a supported version, the most
recent release will have all security fixes in it.

Eg, 1.6 is the most recent version, and 1.6.0 (just called 1.6) is the
most recent release in that version, but you can quite happily
continue to use 1.5 (release 1.5.5) or 1.4 (release 1.4.10).

Each jump to a major version will come with changes that you will be
required to make to your project, possibly even to 3rd party apps (or,
if you can't manage this yourself, you will have to wait for the
author of the app to update to include support for the new version).
For that reason, you probably don't want to blithely update your
sites, but do it as part of an upgrade process. Eg for the most recent
release:

https://docs.djangoproject.com/en/1.6/releases/1.6/#backwards-incompatible-changes-in-1-6

It is slightly different to what I have described, Django has a
deprecation policy, features not pending deprecation in X.Y will work
in X.Y+1 and X.Y+2, features pending deprecation in X.Y will work in
X.Y+1 but not X.Y+2. This means that what commonly happens is a
release has a feature that is pending deprecation, you upgrade to the
release without rewriting/fixing the deprecated section, and then
update to the next version and find that your code is broken.

> My intention is not to be critical, as I really like Python and
> Django. Similar to learning Node.js and the specification of Dependencies,
> I have not read or found discussed in an online course, why one might not
> use the latest version of a dependency... or how one would be needing
> earlier versions of a dependency or a component of a framework.
> Thanks in advance for any advice,
> Bruce

The reason we version software is so that the API can be fixed at
particular points. If you write your site for django 1.2, and then
install django 1.6, it (probably) will not work.

Cheers

Tom

Alex Mandel

unread,
Dec 10, 2013, 10:10:52 PM12/10/13
to django...@googlegroups.com
On 12/10/2013 09:54 AM, Tom Evans wrote:
>
> It is slightly different to what I have described, Django has a
> deprecation policy, features not pending deprecation in X.Y will work
> in X.Y+1 and X.Y+2, features pending deprecation in X.Y will work in
> X.Y+1 but not X.Y+2. This means that what commonly happens is a
> release has a feature that is pending deprecation, you upgrade to the
> release without rewriting/fixing the deprecated section, and then
> update to the next version and find that your code is broken.
>
>> My intention is not to be critical, as I really like Python and
>> Django. Similar to learning Node.js and the specification of Dependencies,
>> I have not read or found discussed in an online course, why one might not
>> use the latest version of a dependency... or how one would be needing
>> earlier versions of a dependency or a component of a framework.
>> Thanks in advance for any advice,
>> Bruce
>
> The reason we version software is so that the API can be fixed at
> particular points. If you write your site for django 1.2, and then
> install django 1.6, it (probably) will not work.
>
> Cheers
>
> Tom
>


Right this is closer to say the difference between Drupal 5,6,7
Django just uses the 2nd level numbering to indicate api compatibility.
So 1.4.x,1.5.x,1.6.x would be the django world equivalent. ie some
migration or code change is involved to move. Keep in mind that Drupal,
Wordpress etc are also release products, not frameworks - you can run
Drupal or Wordpress without writing any code. You can not do the same
for Django. Django is intended to help you write custom websites.

Enjoy,
Alex

rettev...@googlemail.com

unread,
Dec 10, 2013, 11:17:23 PM12/10/13
to django...@googlegroups.com
Dear Bruce,
being myself a Python programmer for more than 16 years I only recently started usind django when I was looking for a way to set up a web application. The reason for this choice is motivated by the positive experience I always had with Python and so I dived into Django. Now when it comes to Python programming there is always this 2.X vs 3.X thing and this is also something one immediately has to deal with when it comes to Django programming. Setting up Apache and using mod_wsgi, calling a local Django installation set up with virtualenv, I directly ran into the problem that mod_wsgi can only work with a Django version using the same Python version mod_wsgi was compiled against. Since I am running a gentoo linux and therefore used to keep things relatively up to date, I decided to use Django version 1.6 and Python version 3.3. Of course then I discovered that this renders almost 80-90% of the additional Django packages, which make Django so powerful, "useless" because they are still with the old Python 2.7 version. Just as an example: using Python 3.3 kicks out all Django based web shop framworks (to my best knowledge) and reduces the useable internationalization packages to only two ot three. And so on.
Therefore I personally recommend using Pyhton 3.3 only if one is safe with Python programming and if one has the time to do some things from scratch. 
If we are talking about different Django versions (I know you where talking about different Django versions only, but I thought it is worth having a look at the Python version as well): I realized that there where quite heavy changes in the framework over the different versions, and assuming that such a tendency will remain it would be better to use the newest stable version of Django instead of an old version where you probably have to rewrite large parts of the code when porting to a newer version.
Regarding literature the most useful one is the 1000+ pages Django doc. This is a really excellent documentation, and since Django is progressing quite fast, it will the most useful reading on this topic. Of course there are also excellent code snippets on certain Django topics on the web.
In the very beginning, when playing around with Django, I also used tried the Bitnami Django stack, but personally I didn't find it very useful.
Best wishes,
Ulrich

Ashutosh Das

unread,
Dec 11, 2013, 3:41:30 AM12/11/13
to django...@googlegroups.com

Hi
there  is a great book for Django http://www.tangowithdjango.com/

Sithembewena Lloyd Dube

unread,
Dec 11, 2013, 8:11:53 PM12/11/13
to django...@googlegroups.com
Thanks for this - interesting. Another option would be Two Scoops of Django by PyDanny and Audrey.


On Wed, Dec 11, 2013 at 5:41 AM, Ashutosh Das <areo...@gmail.com> wrote:

Hi
there  is a great book for Django http://www.tangowithdjango.com/

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3a4cfa57-29ab-44f5-9c2f-95cc66e6c4c6%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Regards,
Sithu Lloyd Dube

Russell Keith-Magee

unread,
Dec 12, 2013, 12:45:05 AM12/12/13
to Django Users

Two Scoops is a fantastic resource -- but it's not a tutorial. It's a collection of best practices and useful patterns. It won't make a whole lot of sense until you've got a handle on at least the basics of Django. If you buy Two Scoops expecting a tutorial, you're going to be disappointed. 

Yours,
Russ Magee %-)

Reply all
Reply to author
Forward
0 new messages