Previously we created this HTML template, which
should be served to a particular URL.
So let's define the URL, where this page will be served.
For that we want to do two things.
First thing is we want to go to mysite,
so the project configuration files and go to urls.py.
And here, now we want to add a new
urlpattern, for the new app that we added.
So we have urlpatterns for the admin interface,
we have a urlpattern for the blog app.
Now we want to add a new item.
So make a comma after the last item
and then a new row and say path.
[No Audio]
Now this part here, is what comes after the domain name.
So if our domain name is example.com,
then we say translate with a slash.
That means now, that our app
will be served on example.com/translate/.
A comma include, and inside the parentheses
we say translator, without the slash.
So this is the name of our app, which
you can find, as the name of the folder
containing all the files. .urls which is a file,
that should be now inside your translator folder.
So by default there isn't such a file.
So right click and go to New File and say urls.py.
[No Audio]
Now here we define the other urls,
because one app could contain multiple pages.
So in the main, in this url here, we define only
one, which contains the upper level part of the url.
So let's say we have example.com/translate and then
we could have, other pages such as example.com/translate/
whatever, then another page example.com/translate get or do or
be whatever you have after translate.
But every one of these pages
will contain that translate part.
So this is what we define here, the first door to our app.
After that door, there will be other doors which
we have to define in, the other urls here.
So let's go to blog and copy urls of blog.
So this one in here and then go to
the new urls of Translator, and just paste it
here, so we don't have to type again.
So I don't think this is relevant this time the slug,
because we will not be creating blog posts, which
will have this slug, defined by the contents creator.
So I'm going to delete that.
And now, what do we want to have?
So for example, this one here, if you have
this empty string, that means this view is going
to render an html template directly in translate.
So example.com/translate.
But if you want something after the translator
as we said, you want to write something.
So I'm going to delete one of these
and just keep it an empty string.
So when the user goes to example.com/translate/
one of our views will be responsible to handle that request.
So let's call this translator
[Author Typing]
_view, we're going to write normal views which
means that, these views will be functions.
So by default, Python works with functions as views.
And this is easier to work with forms.
Therefore, we don't need that as_view function
here, because this is actually a view.
translator_view is a view but,
before, those classes were not views.
That's why we had to transform
them, convert them to views.
Alright, then, a name for this url.
Let's give it the name of translator_view.
So save that.
And with those two configurations, we are
ready to create our translator_view, view.
So let's create that in the next video, see you.