SlideShare une entreprise Scribd logo
1  sur  77
Télécharger pour lire hors ligne
webes keretrendszer
   mindenkinek


                      Farkas Szilveszter
                           budapest.py
                        2009. június 25.
tartalom
        történet
         alapok
beépített szolgáltatások
kiegészítő szolgáltatások
  hasznos alkalmazások
történet
Adrian Holovaty
 Lawrence Journal-World, Kansas
1.0
hamarosan 1.1
alapok
MVC
MTV
MTV
Model
MTV
Template
MTV
View
ORM
model
adatok
natív objektumok
lekérdezések
beépített nyelvi elemekkel támogatva
mezőtípusok
 beépített validációval
AutoField
          BooleanField
            CharField
CommaSeparatedIntegerField
            DateField
         DateTimeField
          DecimalField
           EmailField
            FileField
         FilePathField
           FloatField
           ImageField
          IntegerField
        IPAddressField
       NullBooleanField
       PhoneNumberField
    PositiveIntegerField
 PositiveSmallIntegerField
            SlugField
      SmallIntegerField
            TextField
            TimeField
             URLField
          USStateField
             XMLField
kapcsolatok
több-egy, több-több, egy-egy
class Article(models.Model):
  title = fields.CharField()
  body = fields.TextField()
  submitted = fields.DateTimeField()
  author = fields.ForeignKey(User)
  published = fields.BooleanField()
sablon rendszer
     template
alapvetően html
{% tagek %}
{% block "nev" %}
Ide jöhet akármi.
{% endblock %}




{% if feltetel %}
Feltétel teljesült.
{% else %}
Nem teljesült a feltétel.
{% endif %}
{{ változók }}
{{ valtozo }}

{{ objektum.tagvaltozo }}

{{ objektum.tagfuggveny }}
|szűrők
{{ datum|date:"Y. m. d." }}

2008. 07. 11.

{{ html|escape }}

<strong>Django</strong> (nem Django)

{{ meret|filesizeformat }}

234.5 MB
leszármaztatás
base.html
<head>
 <title>{% block "title" %}Oldal
címe{% endblock %}</title>
</head>



extended.html
{% extends "base.html" %}
{% block "title" %}
Másik cím
{% endblock %}
nézetek
  view
kérés - válasz
HttpRequest - HttpResponse
1. szabály
HttpRequest objektumot kapunk
2. szabály
HttpResponse objektumot kell visszaadnunk
def nezet(request):
  response = HttpResponse()
  return response
urlconf
nézetek hozzárendelése url-ekhez
urlpatterns = patterns('',
    (r'^cikkek/(d{4})/$',
'oldalam.views.eves_archivum'),
    (r'^cikkek/(d{4})/(d{2})/$',
'oldalam.views.havi_archivum'),
    (r'^cikkek/(d{4})/(d{2})/(d+)/$',
'oldalam.views.oldal_reszletek'),
)
paraméterátadás
urlpatterns = patterns('',
    (r'^szavazasok/$',
'oldalam.szavazo.views.kezdo'),
    (r'^szavazasok/(?P<azon>d+)/$',
'oldalam.szavazo.views.reszletek'),
    (r'^szavazasok/(?P<azon>d+)/eredmenyek/
$', 'oldalam.szavazo.views.eredmenyek'),
    (r'^szavazasok/(?P<azon>d+)/szavazas/
$', 'oldalam.szavazo.views.szavazas'),
)
def reszletek(request, azon):
  sz = get_object_or_404(Szavazas, pk=azon)
  return render_to_response('szavazas_reszletek.html',
                            {'szavazas': sz})
forms
űrlapok egyszerűen
mezők
hasonlóan a modellekhez
widgetek
validálás
beépített, vagy egyedi
validálás
mezőnként, vagy globálisan
modell → űrlap
class ArticleForm(forms.ModelForm):
  class Meta:
    model = Article
beépített szolgáltatások
adatbázis hozzáférés
  MySQL, Oracle, PostgreSQL, SQLite
adatbázis hozzáférés
     tranzakciókezeléssel
munkamenetek
    (sessions)
gyorsítótárazás
     (caching)
honosítás
(internationalization)
unicode mindenhol
lapszámozás
   (pagination)
szerializáció
XML, JSON, Python, YAML
fájlfeltöltés
bármekkora fájlmérettel
middleware-ek
tesztelés
kiegészítő szolgáltatások
auth
felhasználók, csoportok és jogosultságok
admin
adminisztrációs felület pár sor kóddal
databrowse
„adminisztrációs felület látogatóknak”
flatpages
statikus oldalak
form preview
űrlapon szereplő adatok megerősítése beküldés előtt
form wizard
 többlépéses űrlapok
sites
több honlap egy telepítéshez
sitemaps
keresőbarát oldalszerkezet biztosítása
syndication
RSS és Atom hírforrások létrehozása
webdesign
Lorem Ipsum generátor
hasznos alkalmazások
django-registration
   felhasználók regisztrációjához
django-contact-form
   rugalmas kapcsolatfelvételi űrlap
django-tagging
bármelyik modellünket címkézhetjük vele
django-openid
OpenID támogatás implementációja
és még sokan mások...
       Google Code
Köszönöm a figyelmet!
    http://szilveszterfarkas.com/
Köszönet
       Török Gábor
http://gábor.20y.hu/django/

Contenu connexe

En vedette

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

En vedette (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Django @ budapest.py június