Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions content/artigo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
Instalando e Configurando o Python e Django no Windows
######################################################
:date: 2014-05-13 17:20
:tags: python,django,windows
:category: Tutoriais
:slug: instalacao-python-django-windows
:author: Thiago Corôa
:email: [email protected]
:github: macabroaff

=========================
Instalação do Python 2.7
=========================

Para começar a desenvolver algo em Python, devemos baixar o Python(Nossa, que descoberta!),
sendo a versão mais indicada o 2.7, por ser mais estável, possuir mais bibliotecas disponíveis
e compatíveis e ser utilizada por mais desenvolvedores no mundo pythonico.


Vejamos como fazer esta instalação:
-----------------------------------
-Baixar a versão 2.7 do Python no endereço: https://www.python.org/downloads/


.. image:: images/macabroaff/1.png
:alt: Escolhendo a versão a ser instalada

Seguindo os passos:

.. image:: images/macabroaff/2.png
:alt: Instalar para todos os usuários

.. image:: images/macabroaff/3.png
:alt: O diretório padrão Python27(evitando pontuação ou caracteres distintos)

.. image:: images/macabroaff/4.png
:alt: Instale todo o conteúdo, nunca se sabe quando irá precisar de algo

Após feita a instalação é hora de adicionar o Python às variáveis de ambiente, o Windows não o faz sozinho, para testar, podemos digitar "python" no prompt de comando, caso esteja funcionando corretamente ele deverá mostrar a versão do python que está instalada e ativar o console interativo Python para uso, não estando adicionada a variável ao ambiente, faremos a seguinte operação:

.. image:: images/5.png
:alt: Adicionando Variável de Ambiente

Procurar em variáveis do sistema a Variável "Path" e editar a mesma com o caminho onde foi instalado o Python, neste caso, "C:\Python27\" .

Não esquecer de adicionar um ponto e vírgula antes do caminho, pois é o que define o fim da variável anterior e início da próxima.

.. image:: images/6.png
:alt: Editando a Variável Path


Pronto! O Python 2.7 está instalado, agora instalaremos o Pip, baixaremos do site:

"http://www.pip-installer.org/en/latest/installing.html#install-pip"

Baixar o arquivo get-pip.py na pasta “C:\Python27\Scripts”, logo após no cmd digite as seguintes linhas:


.. code-block:: python

cd “C:\Python27\Scripts\”

python get-pip.py install


Ele efetuará a instalação do pip, para testar digite pip no prompt de comando e execute, ele aparecerá a lista de comandos disponíveis para uso do PIP incluindo o Install que é uma bela mão na roda, onde ele instala pacotes sem precisar baixar arquivos e instalar manualmente.
O próximo passo será a instalação do Virtualenv, como recomendação para um ambiente de desenvolvimento saudável, instalaremos para evitar problemas com o uso de muitas bibliotecas diferentes para cada projeto, ele separa os ambientes de produção por ambientes virtuais, então é possível usar distribuições e bibliotecas diferentes em diferentes projetos mas no mesmo sistema operacional(usando a instalação limpa), o que seria impossível sem o Virtualenv.
Instalaremos digitando no prompt de comando:


<<<<<<< HEAD
=======
Syntax Highlight
----------------

>>>>>>> cecd4453bd9aaaa61f8e470a0c9a136a1e2b4130
.. code-block:: python

pip install virtualenv

Agora o passo mais difícil, instalar o Django depois do Pip instalado, digite o comando:




.. code-block:: python

pip install django==1.4.3

Muito difícil não?




Binary file added content/images/macabroaff/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/images/macabroaff/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/images/macabroaff/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/images/macabroaff/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/images/macabroaff/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/images/macabroaff/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/images/macabroaff/Thumbs.db
Binary file not shown.