Django for Designers/Laptop setup/Linux virtualenv: Difference between revisions
Content added Content deleted
imported>Paulproteus No edit summary |
imported>Paulproteus No edit summary |
||
Line 29: | Line 29: | ||
It installs development-related tools that virtualenv relies on. |
It installs development-related tools that virtualenv relies on. |
||
== Navigate to the pages-to-apps folder == |
|||
Open a command prompt, and use the ''cd'' command to find the ''pages-to-apps'' folder. |
|||
You can use the ''ls'' command to list the folder. Run this command: |
|||
<pre>ls</pre> |
|||
and make sure you see a requirements.txt file. |
|||
== Create a virtualenv == |
|||
A virtualenv is a limited Python environment that permits you to install whatever Python code you like without impacting other Python programs. |
|||
First, we will have to create the virtualenv. In your command prompt, type: |
|||
<pre> |
|||
virtualenv env |
|||
</pre> |
|||
If you get a ''command not found'' error, type this instead: |
|||
<pre> |
|||
python virtualenv.py env |
|||
</pre> |
|||
Eventually you will get your prompt back. |
|||
== Activate the virtualenv == |
|||
When you ''activate'' a virtualenv, it gives you access to the Python code within the virtualenv. (By contrast, your system Python does not have access to the code within the virtualenv.) |
|||
Run this command: |
|||
<pre> |
|||
source env/bin/activate |
|||
</pre> |
|||
You should see your command prompt change to say ''env''; that is how you know you have it activated. |
|||
== Install the requirements == |
|||
You need to use the ''pip'' package manager within your virtualenv to install all the code required to have a successful tutorial. To do that, first make sure your command prompt has the virtualenv activated. |
|||
Then run: |
|||
<pre> |
|||
pip install -r requirements.txt |
|||
</pre> |
|||
This will run for a few minutes, downloading code. Eventually, you will get your prompt back. Success! |
|||
== Return to laptop setup == |
|||
« [[../|Return to laptop setup]] |