SlideShare uma empresa Scribd logo
1 de 39
Deploying a Web Application

         Thierry Sans
What you need



 Web Host       A home for your website




                A name for your website
 Domain Name
                www.myflippylocation.com
Web Hosting
Development Server vs Production Server




➡   Django provides a development server

๏   Does not scale with multiple requests (high threading)

✓   We need to setup a production server
Web Hosting


 Storage      How much space do you need?



 Bandwidth    How much traffic do you expect?



 Money        How much do you want to spend daily?
Do you want/need to manage ...

                Yes       physical            No
                      infrastructure?




     physical                           Yes        operating   No
      server                                        system?



                                  Virtual                       Share
                                  Private                       Web
                                  Server                        Host
source “The State of Web Development 2010”
                  from www.webdirections.org
Dedicated Physical Server



✓   Total Control

๏   Maintenance of the physical infrastructure

๏   Administration of the operating system

๏   Flexibility
Virtual Private Server (VPS)




๏   Administration of the operating system

✓   No maintenance of the physical infrastructure

✓   Flexibility (pay for what you need)
Shared Web Host




✓   No administration of the operating system

๏   Cost

๏   Not adequate for specific needs
Choosing the Technology
Choosing an operating system




               source “The State of Web Development 2010”
                                 from www.webdirections.org
Choosing a web server




               source “The State of Web Development 2010”
                                 from www.webdirections.org
Choosing a database




               source “The State of Web Development 2010”
                                 from www.webdirections.org
The popularity of LAMP



•   Linux

•   Apache

•   MySQL

•   Perl / PHP / Pyhton
Choosing a technology



•   Choosing a technology depends on

                        Specific applications that your web
      Specific needs
                        applications uses
                        What you are comfortable to
      Security
                        administer
Domain Name
Internet Top Level Names




•   See List of Internet top-level domains (Wikipedia)
How to get a domain name?


•   You need to buy one from a Domain Name Registrar
What about Qatar?




✓   A domain name in .qa

➡   See Qatar Domain Registry
Step 1 - Buy your domain name




•   Can be more or less expensive
Step 2 - Configure




➡   Attach an IP address (or another URL) to your domaine name
Django with Apache
The big picture

                                        Server Side
Client Side



                       mod_wsgi


                       myServlet.java
Web Browser

                                          Database
                   Web Server              Server
Apache and Python - 3 solutions



➡   How Apache runs Python code

•   mod_wsgi

•   FastCGI

•   Mod_python (deprecated)
Apache and Python - 3 solutions



➡   How Apache runs Python code

•   mod_wsgi

•   FastCGI

•   Mod_python (deprecated)
Apache and mod_wsgi



•   Apache

    http://www.apache.org/


•   Python WSGI adapter for Apache (mod_wsgi)

    http://code.google.com/p/modwsgi/
django.wsgi
Wsgi file and permissions                tsansweb/
                                            __init__.py
                                            manage.py
                                            settings.py
➡   Create a django.wsgi file                urls.py
                                            tsans.db
➡   Modify the permissions for Apache
                                            uploads/
$ chown -R :_www tsans-web                  WebGallery/

➡   Modify the permissions for Apache
$ chmod g+w tsansweb
$ chmod g+w tsansweb/tsans.db
django.wsgi
Wsgi file and permissions                tsansweb/
                                            __init__.py
                                            manage.py
                                            settings.py
➡   Create a django.wsgi file                urls.py
                                            tsans.db
➡   Modify the permissions for Apache
                                            uploads/
$ chown -R :_www tsans-web                  WebGallery/

➡   Modify the permissions for Apache      _www for Mac OS
                                           www-data for Linux
$ chmod g+w tsansweb
$ chmod g+w tsansweb/tsans.db
Django WSGI file (Django version 1.3)                    django.wsgi
import os
import sys


path = os.path.abspath(os.path.dirname(__file__))
if path not in sys.path:
    sys.path.append(path)


path+="/tsansweb"
if path not in sys.path:
    sys.path.append(path)


os.environ['DJANGO_SETTINGS_MODULE'] = 'tsansweb.settings'


import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Django WSGI file (Django version 1.3)                    django.wsgi
import os
import sys


path = os.path.abspath(os.path.dirname(__file__))
if path not in sys.path:
    sys.path.append(path)
                            Django project path
path+="/tsansweb"
if path not in sys.path:
    sys.path.append(path)


os.environ['DJANGO_SETTINGS_MODULE'] = 'tsansweb.settings'


import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Django WSGI file (Django version 1.3)                      django.wsgi
import os
import sys


path = os.path.abspath(os.path.dirname(__file__))
if path not in sys.path:
    sys.path.append(path)
                            Django project path
path+="/tsansweb"
if path not in sys.path:
    sys.path.append(path)
                                                    Settings module


os.environ['DJANGO_SETTINGS_MODULE'] = 'tsansweb.settings'


import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
httpd.conf (Apache)                         /etc/apache2/httpd.conf




....


LoadModule wsgi_module    libexec/apache2/mod_wsgi.so


WSGIScriptAlias / /Users/tsans/Sites/tsansweb.wsgi


....
httpd.conf (Apache)                          /etc/apache2/httpd.conf




                                 path to the wsgi module
....


LoadModule wsgi_module    libexec/apache2/mod_wsgi.so


WSGIScriptAlias / /Users/tsans/Sites/tsansweb.wsgi


....
httpd.conf (Apache)                            /etc/apache2/httpd.conf




                                  path to the wsgi module
....


LoadModule wsgi_module    libexec/apache2/mod_wsgi.so


WSGIScriptAlias / /Users/tsans/Sites/tsansweb.wsgi


....
                              path to your wsgi file
Django and MySQL
MySQL




•   MySQL

    http://www.mysql.com/
Configure Django for MySQL


                                                              tsansweb/settings.py
....
DATABASES = {
    'default': {
      'ENGINE':   'django.db.backends.mysql',
      'USER':     'Django',
      'PASSWORD': 'Pass4Django',
      'HOST': '',      # Set to empty string for localhost.
      'PORT': '',      # Set to empty string for default.
      }
}

....
Configure Django for MySQL


                                                               tsansweb/settings.py
....
DATABASES = {
    'default': {
      'ENGINE':
      'USER':
                  'django.db.backends.mysql',
                  'Django',
                                                MySQL user and password
      'PASSWORD': 'Pass4Django',
      'HOST': '',      # Set to empty string for localhost.
      'PORT': '',      # Set to empty string for default.
      }
}

....

Mais conteúdo relacionado

Mais procurados

Introducing Assetic: Asset Management for PHP 5.3
Introducing Assetic: Asset Management for PHP 5.3Introducing Assetic: Asset Management for PHP 5.3
Introducing Assetic: Asset Management for PHP 5.3Kris Wallsmith
 
HTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreHTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreRemy Sharp
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVCAlive Kuo
 
A re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiA re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiPraveen Puglia
 
Facebook的缓存系统
Facebook的缓存系统Facebook的缓存系统
Facebook的缓存系统yiditushe
 
Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)Jacob Kaplan-Moss
 
4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebookguoqing75
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesLindsay Holmwood
 
Even faster django
Even faster djangoEven faster django
Even faster djangoGage Tseng
 
Odoo - CMS performances optimization
Odoo - CMS performances optimizationOdoo - CMS performances optimization
Odoo - CMS performances optimizationOdoo
 
Beeline Firebase talk - Firebase event Jun 2017
Beeline Firebase talk - Firebase event Jun 2017Beeline Firebase talk - Firebase event Jun 2017
Beeline Firebase talk - Firebase event Jun 2017Chetan Padia
 
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryRemy Sharp
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesDoris Chen
 

Mais procurados (20)

Introducing Assetic: Asset Management for PHP 5.3
Introducing Assetic: Asset Management for PHP 5.3Introducing Assetic: Asset Management for PHP 5.3
Introducing Assetic: Asset Management for PHP 5.3
 
HTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreHTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymore
 
Presentation
PresentationPresentation
Presentation
 
Jsp
JspJsp
Jsp
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
A re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiA re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbai
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
 
Geotalk presentation
Geotalk presentationGeotalk presentation
Geotalk presentation
 
YouDrup_in_Drupal
YouDrup_in_DrupalYouDrup_in_Drupal
YouDrup_in_Drupal
 
RicoLiveGrid
RicoLiveGridRicoLiveGrid
RicoLiveGrid
 
Facebook的缓存系统
Facebook的缓存系统Facebook的缓存系统
Facebook的缓存系统
 
Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)
 
4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
Even faster django
Even faster djangoEven faster django
Even faster django
 
Odoo - CMS performances optimization
Odoo - CMS performances optimizationOdoo - CMS performances optimization
Odoo - CMS performances optimization
 
YUI on the go
YUI on the goYUI on the go
YUI on the go
 
Beeline Firebase talk - Firebase event Jun 2017
Beeline Firebase talk - Firebase event Jun 2017Beeline Firebase talk - Firebase event Jun 2017
Beeline Firebase talk - Firebase event Jun 2017
 
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQuery
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best Practices
 

Semelhante a Deploying

“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.Graham Dumpleton
 
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.Graham Dumpleton
 
Rapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 PlatformRapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 PlatformWSO2
 
Vagrant WordCamp Hamilton
Vagrant  WordCamp HamiltonVagrant  WordCamp Hamilton
Vagrant WordCamp HamiltonPaul Bearne
 
Continuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin StachniukContinuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin StachniukMarcinStachniuk
 
Django deployment with PaaS
Django deployment with PaaSDjango deployment with PaaS
Django deployment with PaaSAppsembler
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture IntroductionHaiqi Chen
 
Deployment with Fabric
Deployment with FabricDeployment with Fabric
Deployment with Fabricandymccurdy
 
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2Yros
 
Running Node.js in Production using Passenger
Running Node.js in Production using PassengerRunning Node.js in Production using Passenger
Running Node.js in Production using Passengerdavidchubbs
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsPablo Godel
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabricandymccurdy
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments Ohad Raz
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerOrtus Solutions, Corp
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Ortus Solutions, Corp
 
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...LumoSpark
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 

Semelhante a Deploying (20)

“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.
 
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
 
Rapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 PlatformRapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 Platform
 
Vagrant WordCamp Hamilton
Vagrant  WordCamp HamiltonVagrant  WordCamp Hamilton
Vagrant WordCamp Hamilton
 
Continuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin StachniukContinuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin Stachniuk
 
Django deployment with PaaS
Django deployment with PaaSDjango deployment with PaaS
Django deployment with PaaS
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture Introduction
 
Deployment with Fabric
Deployment with FabricDeployment with Fabric
Deployment with Fabric
 
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
 
Django
DjangoDjango
Django
 
Running Node.js in Production using Passenger
Running Node.js in Production using PassengerRunning Node.js in Production using Passenger
Running Node.js in Production using Passenger
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web Applications
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
 
Django Girls Tutorial
Django Girls TutorialDjango Girls Tutorial
Django Girls Tutorial
 
Deployment talk dpc 13
Deployment talk dpc 13Deployment talk dpc 13
Deployment talk dpc 13
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and docker
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018
 
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Último (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Deploying

  • 1. Deploying a Web Application Thierry Sans
  • 2. What you need Web Host A home for your website A name for your website Domain Name www.myflippylocation.com
  • 4. Development Server vs Production Server ➡ Django provides a development server ๏ Does not scale with multiple requests (high threading) ✓ We need to setup a production server
  • 5. Web Hosting Storage How much space do you need? Bandwidth How much traffic do you expect? Money How much do you want to spend daily?
  • 6. Do you want/need to manage ... Yes physical No infrastructure? physical Yes operating No server system? Virtual Share Private Web Server Host
  • 7. source “The State of Web Development 2010” from www.webdirections.org
  • 8. Dedicated Physical Server ✓ Total Control ๏ Maintenance of the physical infrastructure ๏ Administration of the operating system ๏ Flexibility
  • 9. Virtual Private Server (VPS) ๏ Administration of the operating system ✓ No maintenance of the physical infrastructure ✓ Flexibility (pay for what you need)
  • 10. Shared Web Host ✓ No administration of the operating system ๏ Cost ๏ Not adequate for specific needs
  • 12. Choosing an operating system source “The State of Web Development 2010” from www.webdirections.org
  • 13. Choosing a web server source “The State of Web Development 2010” from www.webdirections.org
  • 14. Choosing a database source “The State of Web Development 2010” from www.webdirections.org
  • 15. The popularity of LAMP • Linux • Apache • MySQL • Perl / PHP / Pyhton
  • 16. Choosing a technology • Choosing a technology depends on Specific applications that your web Specific needs applications uses What you are comfortable to Security administer
  • 18. Internet Top Level Names • See List of Internet top-level domains (Wikipedia)
  • 19. How to get a domain name? • You need to buy one from a Domain Name Registrar
  • 20. What about Qatar? ✓ A domain name in .qa ➡ See Qatar Domain Registry
  • 21. Step 1 - Buy your domain name • Can be more or less expensive
  • 22. Step 2 - Configure ➡ Attach an IP address (or another URL) to your domaine name
  • 24. The big picture Server Side Client Side mod_wsgi myServlet.java Web Browser Database Web Server Server
  • 25. Apache and Python - 3 solutions ➡ How Apache runs Python code • mod_wsgi • FastCGI • Mod_python (deprecated)
  • 26. Apache and Python - 3 solutions ➡ How Apache runs Python code • mod_wsgi • FastCGI • Mod_python (deprecated)
  • 27. Apache and mod_wsgi • Apache http://www.apache.org/ • Python WSGI adapter for Apache (mod_wsgi) http://code.google.com/p/modwsgi/
  • 28. django.wsgi Wsgi file and permissions tsansweb/ __init__.py manage.py settings.py ➡ Create a django.wsgi file urls.py tsans.db ➡ Modify the permissions for Apache uploads/ $ chown -R :_www tsans-web WebGallery/ ➡ Modify the permissions for Apache $ chmod g+w tsansweb $ chmod g+w tsansweb/tsans.db
  • 29. django.wsgi Wsgi file and permissions tsansweb/ __init__.py manage.py settings.py ➡ Create a django.wsgi file urls.py tsans.db ➡ Modify the permissions for Apache uploads/ $ chown -R :_www tsans-web WebGallery/ ➡ Modify the permissions for Apache _www for Mac OS www-data for Linux $ chmod g+w tsansweb $ chmod g+w tsansweb/tsans.db
  • 30. Django WSGI file (Django version 1.3) django.wsgi import os import sys path = os.path.abspath(os.path.dirname(__file__)) if path not in sys.path: sys.path.append(path) path+="/tsansweb" if path not in sys.path: sys.path.append(path) os.environ['DJANGO_SETTINGS_MODULE'] = 'tsansweb.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
  • 31. Django WSGI file (Django version 1.3) django.wsgi import os import sys path = os.path.abspath(os.path.dirname(__file__)) if path not in sys.path: sys.path.append(path) Django project path path+="/tsansweb" if path not in sys.path: sys.path.append(path) os.environ['DJANGO_SETTINGS_MODULE'] = 'tsansweb.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
  • 32. Django WSGI file (Django version 1.3) django.wsgi import os import sys path = os.path.abspath(os.path.dirname(__file__)) if path not in sys.path: sys.path.append(path) Django project path path+="/tsansweb" if path not in sys.path: sys.path.append(path) Settings module os.environ['DJANGO_SETTINGS_MODULE'] = 'tsansweb.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
  • 33. httpd.conf (Apache) /etc/apache2/httpd.conf .... LoadModule wsgi_module libexec/apache2/mod_wsgi.so WSGIScriptAlias / /Users/tsans/Sites/tsansweb.wsgi ....
  • 34. httpd.conf (Apache) /etc/apache2/httpd.conf path to the wsgi module .... LoadModule wsgi_module libexec/apache2/mod_wsgi.so WSGIScriptAlias / /Users/tsans/Sites/tsansweb.wsgi ....
  • 35. httpd.conf (Apache) /etc/apache2/httpd.conf path to the wsgi module .... LoadModule wsgi_module libexec/apache2/mod_wsgi.so WSGIScriptAlias / /Users/tsans/Sites/tsansweb.wsgi .... path to your wsgi file
  • 37. MySQL • MySQL http://www.mysql.com/
  • 38. Configure Django for MySQL tsansweb/settings.py .... DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'USER': 'Django', 'PASSWORD': 'Pass4Django', 'HOST': '', # Set to empty string for localhost. 'PORT': '', # Set to empty string for default. } } ....
  • 39. Configure Django for MySQL tsansweb/settings.py .... DATABASES = { 'default': { 'ENGINE': 'USER': 'django.db.backends.mysql', 'Django', MySQL user and password 'PASSWORD': 'Pass4Django', 'HOST': '', # Set to empty string for localhost. 'PORT': '', # Set to empty string for default. } } ....

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n