Skip to content

Commit

Permalink
Merge pull request #59 from BluesFiend/master
Browse files Browse the repository at this point in the history
Rename venv to myvenv for a little clarity
  • Loading branch information
oinopion committed Jul 26, 2014
2 parents 82df3eb + 6fcdef8 commit 7d87dce
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ We need to create a `requirements.txt` file to tell Heroku what Python packages

But first, Heroku needs us to install the `django-toolbelt` package. Go to your console with `virtualenv` activated and type this:

(venv) $ pip install dj-database-url gunicorn whitenoise
(myvenv) $ pip install dj-database-url gunicorn whitenoise

After the installation is finished, run this command:

(venv) $ pip freeze > requirements.txt
(myvenv) $ pip freeze > requirements.txt

This will create a file called `requirements.txt` with a list of your installed packages (i.e. Python libraries that you are using, for example Django :)).

Expand Down Expand Up @@ -118,7 +118,7 @@ Heroku uses git repository to manage your project files, so we need to use it to

Create `.gitignore` file with following content:

venv
myvenv
__pycache__
staticfiles
local_settings.py
Expand Down
22 changes: 11 additions & 11 deletions django_installation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,45 +20,45 @@ For this tutorial we will be using a new directory `djangogirls` from your home

mkdir djangogirls

We will make a virtualenv called `venv`. The general command will be in the format:
We will make a virtualenv called `myvenv`. The general command will be in the format:

python -m venv `name_of_venv`.

### Windows

To create a new `virtualenv`, you need to open the console (we told you about that a few tutorials ago - remember?) and run `C:\Python\python -m venv venv`. It will look like this:

C:\Users\Name\djangogirls> C:\Python34\python -m venv venv
C:\Users\Name\djangogirls> C:\Python34\python -m venv myvenv

where `C:\Python34\python` is the folder in which you previously installed Python and the second `venv` is the name of your `virtualenv`. You can use any other name, but stick to lowercase and use no spaces. It is also good idea to keep the name short - you'll be referencing it a lot!
where `C:\Python34\python` is the folder in which you previously installed Python and `myvenv` is the name of your `virtualenv`. You can use any other name, but stick to lowercase and use no spaces. It is also good idea to keep the name short - you'll be referencing it a lot!

### Linux and OS X

Creating a `virtualenv` on both Linux and OS X is as simple as running:

~/djangogirls$ python3 -m venv venv
~/djangogirls$ python3 -m venv myvenv

## Working with virtualenv

The command above will create a folder called `venv` that contains our virtual environment (basically bunch of folders and files). All we want to do now is starting it by running:
The command above will create a folder called `myvenv` that contains our virtual environment (basically bunch of folders and files). All we want to do now is starting it by running:

C:\Users\Name\djangogirls> venv\Scripts\activate
C:\Users\Name\djangogirls> myvenv\Scripts\activate

on Windows, or:

~/djangogirls$ source venv/bin/activate
~/djangogirls$ source myvenv/bin/activate

on OS X and Linux.

You will know that you have `virtualenv` started when you see that the prompt in your console looks like:

(venv) C:\Users\Name\djangogirls>
(myvenv) C:\Users\Name\djangogirls>

or:

(venv) ~/djangogirls$
(myvenv) ~/djangogirls$

Notice the prefix `(venv)` appears!
Notice the prefix `(myvenv)` appears!

When working within a virtual environment, `python` will automatically refer to the correct version so you can use `python` instead of `python3`.

Expand All @@ -68,7 +68,7 @@ OK, we have all important dependencies in place. We can finally install Django!

Now that you have your `virtualenv` started, you can install Django using `pip`. In the console, run `pip install django==1.6.5` (note that we use a double equal sign: `==`).

(venv) ~$ pip install django==1.6.5
(myvenv) ~$ pip install django==1.6.5
Downloading/unpacking django==1.6.5
Installing collected packages: django
Successfully installed django
Expand Down
4 changes: 2 additions & 2 deletions django_models/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ A model in Django is a special kind of object - it is saved in the `database` (d

To keep everything tidy, we will create a separate application inside our project. It is very nice to have everything organized from the very beginning. To create an application we need to run in the console (from `djangogirls` folder where `manage.py` file is) `python manage.py startapp blog`.

(venv) ~/djangogirls$ python manage.py startapp blog
(myvenv) ~/djangogirls$ python manage.py startapp blog

You will notice that a new `blog` folder is created and it contains a number of files now. Our folders and files in our project should look like this:

Expand Down Expand Up @@ -144,7 +144,7 @@ If something is still not clear about models, feel free to ask your coach! We kn

The last step here is to add our new model to our database. It is as easy as typing `python manage.py syncdb`. It will look like this:

(venv) ~/djangogirls$ python manage.py syncdb
(myvenv) ~/djangogirls$ python manage.py syncdb
Creating tables ...
Creating table blog_post
Installing custom SQL ...
Expand Down
12 changes: 6 additions & 6 deletions django_start_project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ The first step towards creating it is starting a new Django project. Basically,

The names of some files and directories are very important for Django. You should not rename the files that we are about to create. Moving them to a different place is also not a good idea. Django needs to maintain a certain structure in order to be able to find important things.

In console you should run (remember that you don't type `(venv) ~/djangogirls$`, ok?):
In console you should run (remember that you don't type `(myvenv) ~/djangogirls$`, ok?):

> Remember to run everything in the virtualenv. If you don't see a prefix `(venv)` in your console you need to activate your virtualenv. We explained how to that in __Django installation__ chapter in __Working with virtualenv__ part.
> Remember to run everything in the virtualenv. If you don't see a prefix `(myvenv)` in your console you need to activate your virtualenv. We explained how to that in __Django installation__ chapter in __Working with virtualenv__ part.
Run on Linux or Mac OS:

(venv) ~/djangogirls$ django-admin.py startproject mysite .
(myvenv) ~/djangogirls$ django-admin.py startproject mysite .

or on Windows:

(venv) ~/djangogirls$ python venv\Scripts\django-admin.py startproject mysite .
(myvenv) ~/djangogirls$ python myvenv\Scripts\django-admin.py startproject mysite .

`django-admin.py` is a script that will create the folders and files for you. You should now have a folder structure which looks like this:

Expand Down Expand Up @@ -83,7 +83,7 @@ Make sure to replace `yourname` with the username you created in __Database__ se

To create a database for our blog, let's run the following in the console: `python manage.py syncdb` (we need to be in a parent `mysite` directory that contains `manage.py` file). If that goes well, you should see something like this:

(venv) ~/djangogirls$ python manage.py syncdb
(myvenv) ~/djangogirls$ python manage.py syncdb
Creating tables ...
Creating table django_admin_log
Creating table auth_permission
Expand Down Expand Up @@ -112,7 +112,7 @@ And we're done! Time to start the web server and see if our website is working!

You need to be in the folder that contains the `manage.py` file (the `mysite` folder). In the console, we can start the web server by running `python manage.py runserver`:

(venv) ~/djangogirls$ python manage.py runserver
(myvenv) ~/djangogirls$ python manage.py runserver

Now all you need to do is check that your website is running - open your browser (Firefox, Chrome, Safari, Internet Explorer or whatever you use) and enter the address:

Expand Down
2 changes: 1 addition & 1 deletion optional_postgresql_installation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Once that's done, enter the following command in the terminal (make sure your `v

Run the following in your console:

(venv) ~/djangogirls$ pip install psycopg2
(myvenv) ~/djangogirls$ pip install psycopg2

If that goes well, you'll see something like this

Expand Down

0 comments on commit 7d87dce

Please sign in to comment.