SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
BUILD WEBSITE IN DJANGO

  WITH A SEARCH ENGINE IN THE END
DJANGO?

 a Web development framework
 Written in Python
 Originally used in a News Site
 Now used in many place
FEATURES

It comes with

   ORM
   Administration Site
   Development Tools
   Templates
   Form validation
   Authentication Framework
   Comments Framework
   Feeds
   And many more
ENOUGH TALKING

  LET GET TO WORK
LADIES AND GENTLEMEN

Start your project, by using the command
django-admin startproject projectname

You should see the content in the new folder
__init__.py manage.py settings.py urls.py
CONFIGURE IT A LITTLE

The settings is in settings.py we start with the database
find the similar template in settings.py
** show settings.py
http://gist.github.com/376201
A LITTLE MORE


here find the line in settings.py
find the same similar in settings and change it accordingly
** show template_dirs
http://gist.github.com/376203
PHEW.....

Now we can start working,

after we
python manage.py startapp issues

Now we really can start working
btw you should see the following

__init__.py models.py tests.py views.py
WHILE WE AT IT

Lets get a enable admin page in urls.py
change the part in settings.py
**show settings.py

http://gist.github.com/376207

and urls.py
**show urls.py
http://gist.github.com/376208
WHO WANT TO BE A MODEL?

model.py == database table (almost)
copy into models.py
**shows issues models
http://gist.github.com/376205
SETUP A APP


now save the models.py

add application in settings.py

this is just part of settings.py
**show example
http://gist.github.com/376207

create in issue/admin.py
**show admin.py

http://gist.github.com/376210
SYNC IT!!!!

Now we can create a database,

python manage.py syncdb

python mange.py runserver




**show admin page
FIRST SUBMIT A FORM

One cool aspect of django is you can automate form generation,
free with validation!!!!

create this one in issue/forms.py
** show form.py

http://gist.github.com/376290
NOW TO VIEW THE APPS


lets create django views

add the following
**show add view
**show item view
**show list view
http://gist.github.com/376304
TEMPLATING

Django uses template to present to user, let start with a main
template, and the template for app

** show base.html
http://gist.github.com/376294
** show add.html
http://gist.github.com/376297
** show view.html
http://gist.github.com/376298
** show list.html
http://gist.github.com/376300
URL.PY


now lets create a url to point to the webapp
create this one
** show issue/urls.py
http://gist.github.com/376310

modify from the template
** show urls.py
http://gist.github.com/376311
and demo
EXTRA!!!!

NOW A REVIEW OF HAYSTACK
FINDING NEEDLE IN HAYSTACK

Haystack is a search api for django, it support several backend,
including solr, whoosh,
A LITTLE SETUP(AGAIN)

Let do a little setup

git clone http://github.com/toastdriven/django-haystack.git

**show changes in settings.py
http://gist.github.com/376659

**show search_index
http://gist.github.com/376662
TELL HAYSTACK WHICH NEEDLE

We create a search index

** show search index
http://gist.github.com/376668

** search document place on
<template dir>/search/indexes/issue/issue_text.txt
http://gist.github.com/376672
NOW TELL SOLR


Create solr index, and run index

create a schema.xml for solr
python manage.py build_solr_schema > schema.xml

create search index
python manage.py rebuild_index
NOW CREATE A SEARCH SITE


We just reuse the search view
** show urls.py
add (r'^search/',include("haystack.urls"))

and create a template
** show search/search.html
http://gist.github.com/376685
VOILA!!!

Now we have a basic search.

except haystack can do quite a lot, which is another story
altogether

Weitere ähnliche Inhalte

Was ist angesagt?

2 introduction-php-mvc-cakephp-m2-installation-slides
2 introduction-php-mvc-cakephp-m2-installation-slides2 introduction-php-mvc-cakephp-m2-installation-slides
2 introduction-php-mvc-cakephp-m2-installation-slidesMasterCode.vn
 
Scalable web application architecture
Scalable web application architectureScalable web application architecture
Scalable web application architecturepostrational
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupalsparkfabrik
 
4 introduction-php-mvc-cakephp-m4-controllers-slides
4 introduction-php-mvc-cakephp-m4-controllers-slides4 introduction-php-mvc-cakephp-m4-controllers-slides
4 introduction-php-mvc-cakephp-m4-controllers-slidesMasterCode.vn
 
Django for Beginners
Django for BeginnersDjango for Beginners
Django for BeginnersJason Davies
 
6 introduction-php-mvc-cakephp-m6-views-slides
6 introduction-php-mvc-cakephp-m6-views-slides6 introduction-php-mvc-cakephp-m6-views-slides
6 introduction-php-mvc-cakephp-m6-views-slidesMasterCode.vn
 
Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Tom Brander
 
CakePHP 2.0 - It'll rock your world
CakePHP 2.0 - It'll rock your worldCakePHP 2.0 - It'll rock your world
CakePHP 2.0 - It'll rock your worldGraham Weldon
 
CakePHP - Admin Acl Controlled
CakePHP - Admin Acl ControlledCakePHP - Admin Acl Controlled
CakePHP - Admin Acl ControlledLuís Fred
 
Play with Alfresco ADF 2.0.0 Angular
Play with Alfresco ADF 2.0.0 AngularPlay with Alfresco ADF 2.0.0 Angular
Play with Alfresco ADF 2.0.0 AngularEugenio Romano
 
Installation of Joomla on Windows XP
Installation of Joomla on Windows XPInstallation of Joomla on Windows XP
Installation of Joomla on Windows XPRupesh Kumar
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial之宇 趙
 
Web development with django - Basics Presentation
Web development with django - Basics PresentationWeb development with django - Basics Presentation
Web development with django - Basics PresentationShrinath Shenoy
 
Django app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh AgarwalDjango app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh Agarwalratneshsinghparihar
 
Introduction to django
Introduction to djangoIntroduction to django
Introduction to djangoIlian Iliev
 
Top 50 Interview Questions and Answers in CakePHP
Top 50 Interview Questions and Answers in CakePHPTop 50 Interview Questions and Answers in CakePHP
Top 50 Interview Questions and Answers in CakePHPKetan Patel
 
What The Flask? and how to use it with some Google APIs
What The Flask? and how to use it with some Google APIsWhat The Flask? and how to use it with some Google APIs
What The Flask? and how to use it with some Google APIsBruno Rocha
 

Was ist angesagt? (20)

CakePHP and AJAX
CakePHP and AJAXCakePHP and AJAX
CakePHP and AJAX
 
2 introduction-php-mvc-cakephp-m2-installation-slides
2 introduction-php-mvc-cakephp-m2-installation-slides2 introduction-php-mvc-cakephp-m2-installation-slides
2 introduction-php-mvc-cakephp-m2-installation-slides
 
CakePHP: An Introduction
CakePHP: An IntroductionCakePHP: An Introduction
CakePHP: An Introduction
 
Scalable web application architecture
Scalable web application architectureScalable web application architecture
Scalable web application architecture
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupal
 
4 introduction-php-mvc-cakephp-m4-controllers-slides
4 introduction-php-mvc-cakephp-m4-controllers-slides4 introduction-php-mvc-cakephp-m4-controllers-slides
4 introduction-php-mvc-cakephp-m4-controllers-slides
 
Django for Beginners
Django for BeginnersDjango for Beginners
Django for Beginners
 
6 introduction-php-mvc-cakephp-m6-views-slides
6 introduction-php-mvc-cakephp-m6-views-slides6 introduction-php-mvc-cakephp-m6-views-slides
6 introduction-php-mvc-cakephp-m6-views-slides
 
Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Django, What is it, Why is it cool?
Django, What is it, Why is it cool?
 
CakePHP 2.0 - It'll rock your world
CakePHP 2.0 - It'll rock your worldCakePHP 2.0 - It'll rock your world
CakePHP 2.0 - It'll rock your world
 
CakePHP - Admin Acl Controlled
CakePHP - Admin Acl ControlledCakePHP - Admin Acl Controlled
CakePHP - Admin Acl Controlled
 
Play with Alfresco ADF 2.0.0 Angular
Play with Alfresco ADF 2.0.0 AngularPlay with Alfresco ADF 2.0.0 Angular
Play with Alfresco ADF 2.0.0 Angular
 
Installation of Joomla on Windows XP
Installation of Joomla on Windows XPInstallation of Joomla on Windows XP
Installation of Joomla on Windows XP
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial
 
Web development with django - Basics Presentation
Web development with django - Basics PresentationWeb development with django - Basics Presentation
Web development with django - Basics Presentation
 
Django app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh AgarwalDjango app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh Agarwal
 
Introduction to django
Introduction to djangoIntroduction to django
Introduction to django
 
Top 50 Interview Questions and Answers in CakePHP
Top 50 Interview Questions and Answers in CakePHPTop 50 Interview Questions and Answers in CakePHP
Top 50 Interview Questions and Answers in CakePHP
 
Installing AtoM with Ansible
Installing AtoM with AnsibleInstalling AtoM with Ansible
Installing AtoM with Ansible
 
What The Flask? and how to use it with some Google APIs
What The Flask? and how to use it with some Google APIsWhat The Flask? and how to use it with some Google APIs
What The Flask? and how to use it with some Google APIs
 

Andere mochten auch

Flask patterns
Flask patternsFlask patterns
Flask patternsit-people
 
Writing your first web app using Python and Flask
Writing your first web app using Python and FlaskWriting your first web app using Python and Flask
Writing your first web app using Python and FlaskDanielle Madeley
 
Flask Full Stack - Desenvolvendo um CMS com Flask e MongoDB
Flask Full Stack - Desenvolvendo um CMS com Flask e MongoDBFlask Full Stack - Desenvolvendo um CMS com Flask e MongoDB
Flask Full Stack - Desenvolvendo um CMS com Flask e MongoDBBruno Rocha
 
Quokka CMS - Desenvolvendo web apps com Flask e MongoDB - grupy - Outubro 2015
Quokka CMS - Desenvolvendo web apps com Flask e MongoDB - grupy - Outubro 2015Quokka CMS - Desenvolvendo web apps com Flask e MongoDB - grupy - Outubro 2015
Quokka CMS - Desenvolvendo web apps com Flask e MongoDB - grupy - Outubro 2015Bruno Rocha
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with PythonBrian Lyttle
 
Making use of OpenStreetMap data with Python
Making use of OpenStreetMap data with PythonMaking use of OpenStreetMap data with Python
Making use of OpenStreetMap data with PythonAndrii Mishkovskyi
 
Flask Introduction - Python Meetup
Flask Introduction - Python MeetupFlask Introduction - Python Meetup
Flask Introduction - Python MeetupAreski Belaid
 
Django와 flask
Django와 flaskDjango와 flask
Django와 flaskJiho Lee
 
OpenStreetMap in 3D using Python
OpenStreetMap in 3D using PythonOpenStreetMap in 3D using Python
OpenStreetMap in 3D using PythonMartin Christen
 

Andere mochten auch (12)

Flask patterns
Flask patternsFlask patterns
Flask patterns
 
Writing your first web app using Python and Flask
Writing your first web app using Python and FlaskWriting your first web app using Python and Flask
Writing your first web app using Python and Flask
 
Flask Full Stack - Desenvolvendo um CMS com Flask e MongoDB
Flask Full Stack - Desenvolvendo um CMS com Flask e MongoDBFlask Full Stack - Desenvolvendo um CMS com Flask e MongoDB
Flask Full Stack - Desenvolvendo um CMS com Flask e MongoDB
 
Quokka CMS - Desenvolvendo web apps com Flask e MongoDB - grupy - Outubro 2015
Quokka CMS - Desenvolvendo web apps com Flask e MongoDB - grupy - Outubro 2015Quokka CMS - Desenvolvendo web apps com Flask e MongoDB - grupy - Outubro 2015
Quokka CMS - Desenvolvendo web apps com Flask e MongoDB - grupy - Outubro 2015
 
Python and GIS
Python and GISPython and GIS
Python and GIS
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with Python
 
Django vs Flask
Django vs FlaskDjango vs Flask
Django vs Flask
 
Making use of OpenStreetMap data with Python
Making use of OpenStreetMap data with PythonMaking use of OpenStreetMap data with Python
Making use of OpenStreetMap data with Python
 
Flask – Python
Flask – PythonFlask – Python
Flask – Python
 
Flask Introduction - Python Meetup
Flask Introduction - Python MeetupFlask Introduction - Python Meetup
Flask Introduction - Python Meetup
 
Django와 flask
Django와 flaskDjango와 flask
Django와 flask
 
OpenStreetMap in 3D using Python
OpenStreetMap in 3D using PythonOpenStreetMap in 3D using Python
OpenStreetMap in 3D using Python
 

Ähnlich wie Build website in_django

Mini Curso Django Ii Congresso Academico Ces
Mini Curso Django Ii Congresso Academico CesMini Curso Django Ii Congresso Academico Ces
Mini Curso Django Ii Congresso Academico CesLeonardo Fernandes
 
Easy Step-by-Step Guide to Develop REST APIs with Django REST Framework
Easy Step-by-Step Guide to Develop REST APIs with Django REST FrameworkEasy Step-by-Step Guide to Develop REST APIs with Django REST Framework
Easy Step-by-Step Guide to Develop REST APIs with Django REST FrameworkInexture Solutions
 
Django tutorial
Django tutorialDjango tutorial
Django tutorialKsd Che
 
Build and deploy Python Django project
Build and deploy Python Django projectBuild and deploy Python Django project
Build and deploy Python Django projectXiaoqi Zhao
 
Introduction to development with Django web framework
Introduction to development with Django web frameworkIntroduction to development with Django web framework
Introduction to development with Django web frameworkSammy Fung
 
An Introduction to Django Web Framework
An Introduction to Django Web FrameworkAn Introduction to Django Web Framework
An Introduction to Django Web FrameworkDavid Gibbons
 
1-_Introduction_To_Django_Model_and_Database (1).pptx
1-_Introduction_To_Django_Model_and_Database (1).pptx1-_Introduction_To_Django_Model_and_Database (1).pptx
1-_Introduction_To_Django_Model_and_Database (1).pptxTamilGamers4
 
Creating Openbravo Workspace Widgets
Creating Openbravo Workspace WidgetsCreating Openbravo Workspace Widgets
Creating Openbravo Workspace WidgetsRob Goris
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!David Gibbons
 
Akash rajguru project report sem v
Akash rajguru project report sem vAkash rajguru project report sem v
Akash rajguru project report sem vAkash Rajguru
 
Learn Django Tips, Tricks & Techniques for Developers
Learn Django Tips, Tricks & Techniques for DevelopersLearn Django Tips, Tricks & Techniques for Developers
Learn Django Tips, Tricks & Techniques for DevelopersMars Devs
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in DjangoLakshman Prasad
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture IntroductionHaiqi Chen
 

Ähnlich wie Build website in_django (20)

Django by rj
Django by rjDjango by rj
Django by rj
 
Mini Curso Django Ii Congresso Academico Ces
Mini Curso Django Ii Congresso Academico CesMini Curso Django Ii Congresso Academico Ces
Mini Curso Django Ii Congresso Academico Ces
 
DJango
DJangoDJango
DJango
 
Easy Step-by-Step Guide to Develop REST APIs with Django REST Framework
Easy Step-by-Step Guide to Develop REST APIs with Django REST FrameworkEasy Step-by-Step Guide to Develop REST APIs with Django REST Framework
Easy Step-by-Step Guide to Develop REST APIs with Django REST Framework
 
Django
DjangoDjango
Django
 
Django tutorial
Django tutorialDjango tutorial
Django tutorial
 
Mini Curso de Django
Mini Curso de DjangoMini Curso de Django
Mini Curso de Django
 
Django - basics
Django - basicsDjango - basics
Django - basics
 
Build and deploy Python Django project
Build and deploy Python Django projectBuild and deploy Python Django project
Build and deploy Python Django project
 
Introduction to development with Django web framework
Introduction to development with Django web frameworkIntroduction to development with Django web framework
Introduction to development with Django web framework
 
An Introduction to Django Web Framework
An Introduction to Django Web FrameworkAn Introduction to Django Web Framework
An Introduction to Django Web Framework
 
Introduce Django
Introduce DjangoIntroduce Django
Introduce Django
 
1-_Introduction_To_Django_Model_and_Database (1).pptx
1-_Introduction_To_Django_Model_and_Database (1).pptx1-_Introduction_To_Django_Model_and_Database (1).pptx
1-_Introduction_To_Django_Model_and_Database (1).pptx
 
Django crush course
Django crush course Django crush course
Django crush course
 
Creating Openbravo Workspace Widgets
Creating Openbravo Workspace WidgetsCreating Openbravo Workspace Widgets
Creating Openbravo Workspace Widgets
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
Akash rajguru project report sem v
Akash rajguru project report sem vAkash rajguru project report sem v
Akash rajguru project report sem v
 
Learn Django Tips, Tricks & Techniques for Developers
Learn Django Tips, Tricks & Techniques for DevelopersLearn Django Tips, Tricks & Techniques for Developers
Learn Django Tips, Tricks & Techniques for Developers
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in Django
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture Introduction
 

Mehr von swee meng ng

Civic tech in malaysia and beyond
Civic tech in malaysia and beyondCivic tech in malaysia and beyond
Civic tech in malaysia and beyondswee meng ng
 
High Level View of Civic Tech
High Level View of Civic TechHigh Level View of Civic Tech
High Level View of Civic Techswee meng ng
 
How we use Bottle and Elasticsearch
How we use Bottle and ElasticsearchHow we use Bottle and Elasticsearch
How we use Bottle and Elasticsearchswee meng ng
 
a hands on guide to django
a hands on guide to djangoa hands on guide to django
a hands on guide to djangoswee meng ng
 
introduction to linux desktop draft 5
introduction to linux desktop draft 5introduction to linux desktop draft 5
introduction to linux desktop draft 5swee meng ng
 

Mehr von swee meng ng (9)

Civic tech in malaysia and beyond
Civic tech in malaysia and beyondCivic tech in malaysia and beyond
Civic tech in malaysia and beyond
 
High Level View of Civic Tech
High Level View of Civic TechHigh Level View of Civic Tech
High Level View of Civic Tech
 
Python on pi
Python on piPython on pi
Python on pi
 
Lvl.up
Lvl.upLvl.up
Lvl.up
 
Data prospecting
Data prospectingData prospecting
Data prospecting
 
How we use Bottle and Elasticsearch
How we use Bottle and ElasticsearchHow we use Bottle and Elasticsearch
How we use Bottle and Elasticsearch
 
Hackerspacekl
HackerspaceklHackerspacekl
Hackerspacekl
 
a hands on guide to django
a hands on guide to djangoa hands on guide to django
a hands on guide to django
 
introduction to linux desktop draft 5
introduction to linux desktop draft 5introduction to linux desktop draft 5
introduction to linux desktop draft 5
 

Kürzlich hochgeladen

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 

Kürzlich hochgeladen (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 

Build website in_django

  • 1. BUILD WEBSITE IN DJANGO WITH A SEARCH ENGINE IN THE END
  • 2. DJANGO? a Web development framework Written in Python Originally used in a News Site Now used in many place
  • 3. FEATURES It comes with ORM Administration Site Development Tools Templates Form validation Authentication Framework Comments Framework Feeds And many more
  • 4. ENOUGH TALKING LET GET TO WORK
  • 5. LADIES AND GENTLEMEN Start your project, by using the command django-admin startproject projectname You should see the content in the new folder __init__.py manage.py settings.py urls.py
  • 6. CONFIGURE IT A LITTLE The settings is in settings.py we start with the database find the similar template in settings.py ** show settings.py http://gist.github.com/376201
  • 7. A LITTLE MORE here find the line in settings.py find the same similar in settings and change it accordingly ** show template_dirs http://gist.github.com/376203
  • 8. PHEW..... Now we can start working, after we python manage.py startapp issues Now we really can start working btw you should see the following __init__.py models.py tests.py views.py
  • 9. WHILE WE AT IT Lets get a enable admin page in urls.py change the part in settings.py **show settings.py http://gist.github.com/376207 and urls.py **show urls.py http://gist.github.com/376208
  • 10. WHO WANT TO BE A MODEL? model.py == database table (almost) copy into models.py **shows issues models http://gist.github.com/376205
  • 11. SETUP A APP now save the models.py add application in settings.py this is just part of settings.py **show example http://gist.github.com/376207 create in issue/admin.py **show admin.py http://gist.github.com/376210
  • 12. SYNC IT!!!! Now we can create a database, python manage.py syncdb python mange.py runserver **show admin page
  • 13. FIRST SUBMIT A FORM One cool aspect of django is you can automate form generation, free with validation!!!! create this one in issue/forms.py ** show form.py http://gist.github.com/376290
  • 14. NOW TO VIEW THE APPS lets create django views add the following **show add view **show item view **show list view http://gist.github.com/376304
  • 15. TEMPLATING Django uses template to present to user, let start with a main template, and the template for app ** show base.html http://gist.github.com/376294 ** show add.html http://gist.github.com/376297 ** show view.html http://gist.github.com/376298 ** show list.html http://gist.github.com/376300
  • 16. URL.PY now lets create a url to point to the webapp create this one ** show issue/urls.py http://gist.github.com/376310 modify from the template ** show urls.py http://gist.github.com/376311 and demo
  • 17. EXTRA!!!! NOW A REVIEW OF HAYSTACK
  • 18. FINDING NEEDLE IN HAYSTACK Haystack is a search api for django, it support several backend, including solr, whoosh,
  • 19. A LITTLE SETUP(AGAIN) Let do a little setup git clone http://github.com/toastdriven/django-haystack.git **show changes in settings.py http://gist.github.com/376659 **show search_index http://gist.github.com/376662
  • 20. TELL HAYSTACK WHICH NEEDLE We create a search index ** show search index http://gist.github.com/376668 ** search document place on <template dir>/search/indexes/issue/issue_text.txt http://gist.github.com/376672
  • 21. NOW TELL SOLR Create solr index, and run index create a schema.xml for solr python manage.py build_solr_schema > schema.xml create search index python manage.py rebuild_index
  • 22. NOW CREATE A SEARCH SITE We just reuse the search view ** show urls.py add (r'^search/',include("haystack.urls")) and create a template ** show search/search.html http://gist.github.com/376685
  • 23. VOILA!!! Now we have a basic search. except haystack can do quite a lot, which is another story altogether