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

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Kürzlich hochgeladen (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

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