First steps with Django – what you’ll learn

The learning curve with Django, if you’re an absolute beginner, will leave you buzzing with various key words. Among them: virtual environment, MVC framework, models, views, routes, server, browser, local host, requests, return, rendering, URL. If you’re reading these words and none of them make any sense, you need to start by understanding some of the basics. Look up each word, and briefly read about it to gain a context.

In essence though, try and understand this.

Your end goal, when creating a website, is for a user to go to a URL (e.g. they type in http://www.learndjango.io) and on doing so ‘view’ your page, right? If you want it to be even more exciting, you’d hope your web page would allow some sort of interactivity.

On your end – as the web developer – you (1) set up the route to allow this to happen (this is defined in the urls.py files). (2) You also define the views – these basically return the view (often an html file) which the user will see in the browser. (3). Obviously, if the view is an html file, you need to create the html file! HTML files today are rarely on their own. They come accompanied by style sheets (CSS) which make them pretty and create custom formatting. (4) if you want your website to actually do something, you would need to have a database and define it using the models.py file. Finally, (5) you’d need to work with forms, and in order to do so you’d need to learn Django Templating Language (an odd sort of language that involves curly brackets and the percent sign) and this goes in your html forms to create the necessary logic to allow for interactivity and drawing from your database.

Leave a comment