SlideShare uma empresa Scribd logo
1 de 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 :)

Mais conteúdo relacionado

Destaque

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
 

Destaque (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
 

Último

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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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
 
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
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
🐬 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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
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
 
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
 

Último (20)

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...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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...
 
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
 
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...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
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...
 
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
 

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 :)