Home Page Microblog



Download 2,44 Mb.
Pdf ko'rish
bet16/17
Sana30.12.2021
Hajmi2,44 Mb.
#90837
1   ...   9   10   11   12   13   14   15   16   17
Bog'liq
mega-tutorial

user

=

{

'username'

:

'Miguel'

}

Creating mock objects is a useful technique that allows you to concentrate on one part of the

application without having to worry about other parts of the system that don’t exist yet. I want

to design the home page of my application, and I don’t want the fact that I don’t have a user

system in place to distract me, so I just make up a user object so that I can keep going.

The view function in the application returns a simple string. What I want to do now is expand

that returned string into a complete HTML page, maybe something like this:

Listing 2.1: app/routes.py



: Return complete HTML page from view function

from

app

import

app

@app.route

(

'/'

)

@app.route

(

'/index'

)

def

index

():

user

=

{

'username'

:

'miguel'

}

return

'''





Home Page - Microblog






Download 2,44 Mb.

Do'stlaringiz bilan baham:
1   ...   9   10   11   12   13   14   15   16   17




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish