What is the best way to start learning django?

I really want to create a web application; something simple, perhaps a Pokémon map database, for example?

I heard excellent things about Django. Where is the best place to start?

+48
python django
Oct 29 '10 at 4:26
source share
9 answers

This is a post I made on my blog answering almost exactly the same question . It contains many of the answers already given here, as well as some additional tips, and some of them are my personal opinion, while others may differ from me. Hope someone finds this helpful:

Build something

The best advice I can give is to start by creating something. The typical "Hello world" for Django is a blog site, and I also recommend starting with this one. The Django framework is trying to make simple tasks extremely simple and convenient, and a typical example is a website with simple blogging functionality. Free Djangonaut can code a simple blog site in less than an hour using all the available libraries, and so this is a good place to start and get an idea of ​​how Django does things.

Django Book

Of course, before you can just jump in and start coding, you need to start your system with Django and learn the basics. A great resource for this is the Django Book . The authors did not work on this after a while or did not update it (due to its young character, Django changes quite often), but it is freely available on the Internet and is highly recommended. Read the first few chapters on how to set up your system, how all parts of Django fit into the MVC model, and wonder how Django makes it so simple that other frameworks made it unnecessary tedious.

Django Tutorials and Documentation

On the Django documentation . You will see in the sidebar on the right and in the URL of the page you are on that you can change the version you are looking at. Django documentaion is truly excellent and far superior to everything else, and the authors are very careful to indicate which features are new to this version and which are outdated in later versions. Just make sure you know about it, so you don’t spend many hours trying to make something work, not available in your version.

Know what DRY means and practice it

DRY: “Don't Repeat Yourself” is one of Django's core principles. If you find yourself copying everything in Django, there is almost certainly the best way to do this. Most programmers will know from experience why such replication is bad, but, in short, if something in your code should change later or if you made a mistake somewhere, you only need to change it in one place. This is useful because if several changes are required and you forget about this instance, you will introduce errors and errors into your code.

Stay away from class based views

The new addition to Django 1.3 is an array of generic class representations. If you do not know what this means, do not worry. The vast majority of tutorials and books about Django will not mention this, mainly because it is so new. This is a function that is designed to reduce repetition when creating views, thereby following the DRY principle. Although it does this to some degree, it also introduces a lot of black magic and the need to often go around the Django source code to find out what is going on. For beginners, this is less than ideal. In addition, the error messages that are now provided for class-based views often point in a completely wrong direction. Stay away from them and rather use the functional views at the beginning, as most tutorials tell you. When you get a little used to Django and you find that repetition of functional representations is frustrating, look at Generic Views based on classes.

Do not start hosting on Google App Engine

While GAE is free and great for scalable Django applications, it also introduces a lot of restrictions on your login process, and there is very little documentation on this. As a beginner, don't start with this route, as most of the usual Django documentation doesn't suddenly apply, and you won’t know what to do. Rather, start with a service like epio , gondor.io, or more . Epio is still in beta, but also has free hosting (up to a certain amount of monthly use). Developed by two core developers of Django, I highly recommend using them - this is comparable to Heroku for Ruby on Rails. Ep.io closes, but Heroku also recently added the Python option.

Use StackOverflow, Ask Questions

My last tip is to use StackOverflow anytime you get stuck. First, they already have an answer to any question that you can dream of. If you cannot find it on the site, a good way to find the answer to your question is to add "stackoverflow" as part of the Google search terms. Otherwise, ask a question and let the Django community help you. It turned out to be my biggest resource in exploring the darker sides of Django over the last few years, apart from physically reading the Django code (which you should do as well!). Good luck and enjoy!

+70
Feb 03 2018-12-12T00:
source share

Build your first Django web application by reading the Django tutorial .

+14
Oct 29 '10 at 5:19
source share
+9
Oct 29 '10 at 4:28
source share

Build something. Anything. Keep it relatively simple and short, but start building it and make sure you finish it. The project that you mean may be perfect.

Reading documentation and books is extremely useful, of course, but like any programming, the only way to learn Django is to practice with it. Building something tangible is pretty much the only way to get this practice.

+8
Oct 29 '10 at 4:32
source share

If you don't know Python, start your tutorial with this. People tend to get very upset when they try to learn structure without at least knowing something about their programming language.

+7
Oct 29 '10 at 8:11
source share

After gaining basic knowledge of Django / Python, start reading Django by Examples , great articles.

+2
Oct 29 2018-10-29
source share

Django's official website is a great place for training and reference. There is an amazing tutorial that is very good for beginners. A simple stupid tutorial Django is a stupid and simple tutorial that I wrote.

Try to work as many projects as possible. Create your own versions of popular websites like facebook, twitter, imgur, etc. Like everything, Practice makes perfect!

+1
Aug 28 '15 at 1:38
source share

The following screencast / tutorial is a good way to jump in and create a Wiki from scratch:

After that, you can work with the tutorials and documentation available on the django website.

0
Oct 29 '10 at 5:26
source share

You can try " Learn Django in 4 Hours - Quick Track Tutorial "

For kickstart in Django, please see:

http://slash4.de/blog/learn-django-in-4-hours

It is designed to get you started with Django as quickly as possible (without installation procedures, etc.). It shows all the most important parts of Django - of course, it is impossible to cover all aspects of Django in 4 hours, but this is not the intention of this course.

-one
Sep 10 '15 at 9:01
source share



All Articles