diff --git a/deploy/README.md b/deploy/README.md index f6b0d0aeb40..9abb291b0d1 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -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 :)). @@ -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 diff --git a/django_installation/README.md b/django_installation/README.md index 43da9bda8a8..eda79c16cc2 100644 --- a/django_installation/README.md +++ b/django_installation/README.md @@ -20,7 +20,7 @@ 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`. @@ -28,37 +28,37 @@ We will make a virtualenv called `venv`. The general command will be in the form 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`. @@ -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 diff --git a/django_models/README.md b/django_models/README.md index 1dabaec8385..3f5a598b48a 100644 --- a/django_models/README.md +++ b/django_models/README.md @@ -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: @@ -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 ... diff --git a/django_start_project/README.md b/django_start_project/README.md index 33582210972..8d81b9e6773 100644 --- a/django_start_project/README.md +++ b/django_start_project/README.md @@ -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: @@ -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 @@ -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: diff --git a/optional_postgresql_installation/README.md b/optional_postgresql_installation/README.md index 0102b8fa9b1..ce9eef032bb 100644 --- a/optional_postgresql_installation/README.md +++ b/optional_postgresql_installation/README.md @@ -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