SlideShare a Scribd company logo
1 of 20
Getting started with Django
on Windows
Michelle Leu (flywindy)2013/05/28
2
Agenda
 Before install Django
1. (Optional) Install PowerShell (Download)
2. Install Python
3. (Optional) Install pip
 Install Django
 Run server
3
Unlike most Unix systems and services,
Windows does not require Python natively
and thus does not pre-install a version of
Python.
Install Python
4
Step 1: Download Python
 The core Django framework works with any
Python version from 2.5 to 2.7, inclusive.
1. Go to Python’s Download page.
2. Click the link to download installer, it’s depends on
your windows system is 32-bit or 64-bit.
3. The latest version: 2.7.5
32-bit
64-bit
5
Step 2: Run installer
1. Click the file you downloaded, and run the
installer.
2. Select a directory for Python, for example I
choose C disk.
6
Step 3: Setup path
C:Python27;
7
Step 4: Try it! “Hello world”
1. Open “Python (command line)”, or open cmd
(powershell) and input “python”
2. Type print “Hello world”
3. If output “Hello world”, it works.
8
pip works on Unix/Linux, OS X, and
Windows.
(Optional) Install pip
9
Install pip
 Option 1
1. Download the get-pip.py script
2. Run it using Python
 C:> python get-pip.py
 Option 2
1. Download and install it.
10
Requirements files
1. Create a requirements file something like:
2. If you save this in pip-requirements.txt, then
you can type this on you commend line:
 pip install -r pip-requirements.txt
Django==1.4.5
……
11
If you are upgrading your installation of
Django from a previous version, you will
need to uninstall the old Django version
before installing the new version.
Install Django
12
Install Django
 Installing an official release with pip
 $ pip install django (or use requirements file.)
 Installing an official release manually (ex:
version 1.4.3)
1. Go to Django’s download page.
13
Install Django
2. Click “Django-1.4.3.tar.gz” to download.
3. Unzip this file to get the folder called “Django-
1.4.3”.
4. Open your commend line, cd into the folder,
and input “python setup.py install” to install
setup.py, and you will see it’s installing now!
14
Step 3: Try it!
1. In cmd or powershell, input “python” then you
can open Python’s command line.
2. Input “import django”, and “django.VERSION”,
you can see the version, that means django
already installed.
Version: 1.4.5
15
Step 4: setup path
1. Go to “Environment Variables” again, edit
“Path” variable, add value
“;C:Python27Scripts”, click “OK” to save.
2. Test it: open cmd(powershell), input “django-
admin.py” then you will see some options, it’s
works.
16
Create new django project
17
Step 1: create project
 We use “django-admin.py startproject
[projectname]” to create project, for example
the project name is “mysite”.
1. Open cmd(powershell), go to the folder that
you want to put project, input “django-
admin.py startproject mysite” ,then you can
see the new project already in your folder.
18
Step 2: run server
1. In your project, input “python manage.py
runserver”, if see “Development server is
running at http://127.0.0.1:8000/”,then go to
the link, you can see “It worked!”.
19
Reference
 Using Python on Windows
 The Django Book
 Django doc
 Unofficial Windows Binaries for Python
Extension Packages (ex: pip or PIL…)
 Pip requirements files
Thanks for your listening :)

More Related Content

Viewers also liked

Pytables
PytablesPytables
Pytablesgowell
 
真蝦意外接到的Case
真蝦意外接到的Case真蝦意外接到的Case
真蝦意外接到的CaseTom Chen
 
Command line 初級寶典
Command line 初級寶典Command line 初級寶典
Command line 初級寶典Tom Chen
 
Live Performance Effects
Live Performance EffectsLive Performance Effects
Live Performance EffectsTom Chen
 
Elasticsearch intro output
Elasticsearch intro outputElasticsearch intro output
Elasticsearch intro outputTom Chen
 
AngularJS Sharing
AngularJS SharingAngularJS Sharing
AngularJS SharingTom Chen
 
愛樂工程師
愛樂工程師愛樂工程師
愛樂工程師Tom Chen
 
Integrating tornado and webpack
Integrating tornado and webpackIntegrating tornado and webpack
Integrating tornado and webpackTom Chen
 
Learning django step 1
Learning django step 1Learning django step 1
Learning django step 1永昇 陳
 
解密解密
解密解密解密解密
解密解密Tom Chen
 
Django sharing
Django sharingDjango sharing
Django sharingTom Chen
 

Viewers also liked (14)

Pytables
PytablesPytables
Pytables
 
真蝦意外接到的Case
真蝦意外接到的Case真蝦意外接到的Case
真蝦意外接到的Case
 
Xmas
XmasXmas
Xmas
 
Command line 初級寶典
Command line 初級寶典Command line 初級寶典
Command line 初級寶典
 
Live Performance Effects
Live Performance EffectsLive Performance Effects
Live Performance Effects
 
Elasticsearch intro output
Elasticsearch intro outputElasticsearch intro output
Elasticsearch intro output
 
AngularJS Sharing
AngularJS SharingAngularJS Sharing
AngularJS Sharing
 
Django step0
Django step0Django step0
Django step0
 
Gitlab
GitlabGitlab
Gitlab
 
愛樂工程師
愛樂工程師愛樂工程師
愛樂工程師
 
Integrating tornado and webpack
Integrating tornado and webpackIntegrating tornado and webpack
Integrating tornado and webpack
 
Learning django step 1
Learning django step 1Learning django step 1
Learning django step 1
 
解密解密
解密解密解密解密
解密解密
 
Django sharing
Django sharingDjango sharing
Django sharing
 

Recently uploaded

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 

Recently uploaded (20)

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

Getting started with Django on Windows

  • 1. Getting started with Django on Windows Michelle Leu (flywindy)2013/05/28
  • 2. 2 Agenda  Before install Django 1. (Optional) Install PowerShell (Download) 2. Install Python 3. (Optional) Install pip  Install Django  Run server
  • 3. 3 Unlike most Unix systems and services, Windows does not require Python natively and thus does not pre-install a version of Python. Install Python
  • 4. 4 Step 1: Download Python  The core Django framework works with any Python version from 2.5 to 2.7, inclusive. 1. Go to Python’s Download page. 2. Click the link to download installer, it’s depends on your windows system is 32-bit or 64-bit. 3. The latest version: 2.7.5 32-bit 64-bit
  • 5. 5 Step 2: Run installer 1. Click the file you downloaded, and run the installer. 2. Select a directory for Python, for example I choose C disk.
  • 6. 6 Step 3: Setup path C:Python27;
  • 7. 7 Step 4: Try it! “Hello world” 1. Open “Python (command line)”, or open cmd (powershell) and input “python” 2. Type print “Hello world” 3. If output “Hello world”, it works.
  • 8. 8 pip works on Unix/Linux, OS X, and Windows. (Optional) Install pip
  • 9. 9 Install pip  Option 1 1. Download the get-pip.py script 2. Run it using Python  C:> python get-pip.py  Option 2 1. Download and install it.
  • 10. 10 Requirements files 1. Create a requirements file something like: 2. If you save this in pip-requirements.txt, then you can type this on you commend line:  pip install -r pip-requirements.txt Django==1.4.5 ……
  • 11. 11 If you are upgrading your installation of Django from a previous version, you will need to uninstall the old Django version before installing the new version. Install Django
  • 12. 12 Install Django  Installing an official release with pip  $ pip install django (or use requirements file.)  Installing an official release manually (ex: version 1.4.3) 1. Go to Django’s download page.
  • 13. 13 Install Django 2. Click “Django-1.4.3.tar.gz” to download. 3. Unzip this file to get the folder called “Django- 1.4.3”. 4. Open your commend line, cd into the folder, and input “python setup.py install” to install setup.py, and you will see it’s installing now!
  • 14. 14 Step 3: Try it! 1. In cmd or powershell, input “python” then you can open Python’s command line. 2. Input “import django”, and “django.VERSION”, you can see the version, that means django already installed. Version: 1.4.5
  • 15. 15 Step 4: setup path 1. Go to “Environment Variables” again, edit “Path” variable, add value “;C:Python27Scripts”, click “OK” to save. 2. Test it: open cmd(powershell), input “django- admin.py” then you will see some options, it’s works.
  • 17. 17 Step 1: create project  We use “django-admin.py startproject [projectname]” to create project, for example the project name is “mysite”. 1. Open cmd(powershell), go to the folder that you want to put project, input “django- admin.py startproject mysite” ,then you can see the new project already in your folder.
  • 18. 18 Step 2: run server 1. In your project, input “python manage.py runserver”, if see “Development server is running at http://127.0.0.1:8000/”,then go to the link, you can see “It worked!”.
  • 19. 19 Reference  Using Python on Windows  The Django Book  Django doc  Unofficial Windows Binaries for Python Extension Packages (ex: pip or PIL…)  Pip requirements files
  • 20. Thanks for your listening :)