The House Set Fire To My Heart

The House Set Fire To My Heart

Today's song we're quoting is Bat For Lash's "Good Love". I have seen her live once. I am learning Django and I am learning it fast. Last night my code wouldn't work. I may try again today.

a hydroelectric dam in the mountains, nestled between many fir trees on either side. There is mist over the lake at the top of the dam and over the trees.
A hydroelectric dam - the lac de la lande in the vosges mountains, france. I once stood at the top of that stony hill and felt the most powerful that I have ever felt in my life.

path() arguments in Django

So Django, which is a Python framework, has a path() function, and it takes four different arguments.

From the tutorial, it seems that only 3 of them are relevant - so we will leave path() argument: kwargs (keyword arguments) for now.

3 relevant arguments

The three main arguments I want to focus on are route, view and name.

route

"Route is a string that contains a url pattern. When processing a request, Django starts at the first pattern in urlpatterns and makes its way down the list, comparing the requested URL against each pattern until it finds one that matches,"

view

"When Django finds a matching pattern, it calls the specified view function with an HttpRequest object as the first argument and any "captured" values from the route as keyword arguments.

name

"Naming your URL lets you refer to it unambiguously from elsewhere in Django, especially from within templates."

What is an HttpRequest object?


What does include() do?

What is a template in Django?

Comments

Popular posts from this blog

Hello World

Yosemite

Two Lines of Thought, Makes Me Wonder What I'm Missing