All language subtitles for 009 Configuring the Admin Panel_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian Download
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

So how can we tweak the admin panel?

Well, in some aspects,

so when it comes to the individual fields to be precise,

we can typically do that in the models.

There, we have various extra options

which we can set like editable equals false,

which of course I don't wanna set here.

But we got some field specific options

which affect the forum where the field is rendered here

in our model when we work on the fields themselves.

But I'm pretty happy with what we have there.

There are some settings we can add here.

You can always dive in the official docs

to play around with all possible options.

But I wanna set some admin wide settings

to be precise settings which affect this page

where we see all the posts.

And for that go to admin.py and we add a new class here.

We add a post admin clause.

Now this clause name is up to you

but it should extend admin.model admin.

And then in there, we can add a couple of settings.

For example, we can add list filter to add a filter

on this posts page,

and to specify by which fields we should be able to filter.

And I want to be able to filter by author.

That is possible, even though it's a related field,

we can still filter by that.

And I want to be able to filter by date and by tags,

let's say.

These are the three fields

which make the most sense to me here.

Hence we set this to a tuple

where we simply add those field names.

So author, tag, and date, like this.

I also, as I said, want to display a couple of columns here

so that we don't just have these posts objects here

but instead we maybe show the title, the date, the author,

something like this.

Hence, I'll add list display which is the setting for that,

where we then add title, author,

and maybe date as a second value like this.

And as explained earlier in the course,

these field names which you specify here

of course, have to be exactly the same field names

you have in your model clause.

Now, with that, we need to make sure

that we also load this post admin clause so to say,

so when we register posts,

we now pass post admin as a second argument.

And with that, we can save this and get an error

because Django thankfully checks what I set up here.

And I just emphasized that

you have to use the exact same names.

Well, there is no field name tag, it's tags with an S.

So of course, it should be tags here as well.

So now we'll save this,

and thankfully Django has this check.

Now with this saved, if we reload here

we've got these columns and we can filter.

And we can automatically sort

by these columns here, by the way.

And with that, this already looks much nicer, I would say.

Now I also I wanna make sure though that when we add a post,

the slug is filled out automatically.

We can still override it manually then

but it should be pre-populated automatically.

And for this, we can add pre-populated fields.

And this takes a dictionary as a value

where we use the field that should be pre-populated

as a key, so in this case, the slug field,

using that field name here.

And then, as a value, we have a tuple

of all the fields that provides the values

for pre-populating that slug field,

in this case, just the title.

Again, save this.

And now if we reload here, when we add a new post,

if I type here, that slug gets filled out automatically.

And with that, I'll then add my third

and last dummy post here.

Nature at its best, like this.

Add the exert, like this.

Then grab the image name which is woods.jpg

and some content.

And here I'll again, take one paragraph,

add this here and get rid of these indentations.

And then just again,

if you want to repeat this multiple times like that.

And pick an author which again is me,

add a tag or multiple tags and save this.

So now we have all those posts added.

We have all that data added

and we are able to administer this as needed.

Now, I of course wanna make sure that if I go

to local host 8,000 to my blog here,

I no longer load that dummy data

from that all posts list here, but that instead now,

in our views, we query the database

with help of Django's bottles

and we display that model data

so that data coming from the database in our templates.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.