mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-12-04 23:44:07 +03:00
Update virtualenv notes
This commit is contained in:
parent
62efb742fe
commit
96e5d288c9
|
@ -127,6 +127,7 @@ margin-top: 5px;
|
|||
<ul class="nav nav-list side-nav">
|
||||
<li class="main"><a href="#tutorial-1-serialization">Tutorial 1: Serialization</a></li>
|
||||
<li><a href="#introduction">Introduction</a></li>
|
||||
<li><a href="#setting-up-a-new-environment">Setting up a new environment</a></li>
|
||||
<li><a href="#getting-started">Getting started</a></li>
|
||||
<li><a href="#creating-a-model-to-work-with">Creating a model to work with</a></li>
|
||||
<li><a href="#creating-a-serializer-class">Creating a Serializer class</a></li>
|
||||
|
@ -143,8 +144,20 @@ margin-top: 5px;
|
|||
<h1 id="tutorial-1-serialization">Tutorial 1: Serialization</h1>
|
||||
<h2 id="introduction">Introduction</h2>
|
||||
<p>This tutorial will walk you through the building blocks that make up REST framework. It'll take a little while to get through, but it'll give you a comprehensive understanding of how everything fits together.</p>
|
||||
<h2 id="setting-up-a-new-environment">Setting up a new environment</h2>
|
||||
<p>Before we do anything else we'll create a new virtual environment, using <a href="http://www.virtualenv.org/en/latest/index.html">virtualenv</a>. This will make sure our package configuration is keep nicely isolated from any other projects we're working on.</p>
|
||||
<pre><code>mkdir ~/env
|
||||
virtualenv --no-site-packages ~/env/djangorestframework
|
||||
source ~/env/djangorestframework/bin/activate
|
||||
</code></pre>
|
||||
<p>Now that we're inside a virtualenv environment, we can install our package requirements.</p>
|
||||
<pre><code>pip install django
|
||||
pip install djangorestframework
|
||||
</code></pre>
|
||||
<p><strong>*Note:</strong> To exit the virtualenv environment at any time, just type <code>deactivate</code>. For more information see the <a href="http://www.virtualenv.org/en/latest/index.html">virtualenv documentation</a>.*</p>
|
||||
<h2 id="getting-started">Getting started</h2>
|
||||
<p>To get started, let's create a new project to work with.</p>
|
||||
<p>Okay, we're ready to get coding.
|
||||
To get started, let's create a new project to work with.</p>
|
||||
<pre><code>django-admin.py startproject tutorial
|
||||
cd tutorial
|
||||
</code></pre>
|
||||
|
|
Loading…
Reference in New Issue
Block a user