diff --git a/database/README.md b/database/README.md index cab49ace707..a071704c846 100644 --- a/database/README.md +++ b/database/README.md @@ -2,7 +2,7 @@ Most of web applications have their own database. A database is a collection of data. This is a place in which you will store all information about users, all your blog post texts, etc.. -We will be using a PostgreSQL database to store our data. It would be easier to use a default Django database called *sqlite*, but it's not good for a production use (by *production* we mean: real, running websites). If you want to have your application available in the Internet, not only on your computer, you will need PostgreSQL. +We will be using a PostgreSQL database to store our data. It would be easier to use a default Django database called *sqlite*, but it's not good for production use (by *production* we mean: real, running websites). If you want to have your application available in the Internet, not only on your computer, you will need PostgreSQL. # PostgreSQL installation @@ -10,7 +10,7 @@ We will be using a PostgreSQL database to store our data. It would be easier to PostgreSQL is recommending to install it using a program you can find here: http://www.enterprisedb.com/products-services-training/pgdownload#windows -Choose a newest version available for your operating system. Download this Installer, run it and then follow the instructions available here: http://www.postgresqltutorial.com/install-postgresql/ +Choose a newest version available for your operating system. Download this Installer, run it and then follow the instructions available here: http://www.postgresqltutorial.com/install-postgresql/. Take note of the installation directory, you will need it in the next step (most likely it will be `C:\Program Files\PostgreSQL\9.3`). ## Mac OS X @@ -36,8 +36,18 @@ Go to your console and run a following command: Now we need to create our database user and our first database. You can add many databases in PostgreSQL, so if you have more than one website, you should have a separate database for each one! +## Windows + +If you're using Windows, there is a little bit more we need to do. For now you don't need to understand these steps, but feel free to ask your coach if you're curious! + +1. Open the Command Prompt (Start menu → All Programs → Accessories → Command Prompt) +2. Type the following `setx PATH "%PATH%;C:\Program Files\PostgreSQL\9.3\bin"` (you can also paste things into the Command Prompt by right clicking and selecting `Paste`). Make sure that the path is the same as you noted during installation with `\bin` added at the end. You should see the message `SUCCESS: Specified value was saved.`. +3. Close the Command Prompt and it open again. + +## Create the database + First, let's make our console into postgres mode by typing `psql`. Remember the part about console? ->On Mac OS X you can do this by launching the `Terminal` application (it's in Applications → Utilities). On Windows you need to go to Start menu → All Programs → Accessories → Command Prompt. On Linux, it's probably under Applications → Accessories → Terminal. +>On Mac OS X you can do this by launching the `Terminal` application (it's in Applications → Utilities). On Linux, it's probably under Applications → Accessories → Terminal. On Windows you need to go to Start menu → All Programs → Accessories → Command Prompt. Further, on Windows, `psql` might require logging in using the username and password you chose during installation. If `psql` is asking you for password and doesn't seem to work, try `psql -U -W` first and enter the password later. $ psql psql (9.3.4) diff --git a/django_installation/README.md b/django_installation/README.md index 5e5dd7363da..c8ff6edf65c 100644 --- a/django_installation/README.md +++ b/django_installation/README.md @@ -46,7 +46,7 @@ or: so the prefix `(blog)` appears! -Ok, we have all important things in place. We can finally install Django! +OK, we have all important things in place. We can finally install Django! ## Installing Django @@ -66,6 +66,14 @@ Now, when you have your `virtualenv` started, you can install Django using PIP. Successfully installed psycopg2 Cleaning up... +On Windows, you will probably have to replace the first line with +`pip install git+https://github.com/nwcell/psycopg2-windows.git@win32-py34#egg=psycopg2` +or +`pip install git+https://github.com/nwcell/psycopg2-windows.git@win64-py34#egg=psycopg2` +depending on whether you have 32 or 64 bit Windows. + +Once it's completed execute `python -c "import psycopg2"`. If you get no errors, everything works. + That's it! Now you are finally ready to create a Django application! But to do that, you need some nice program to edit the code... diff --git a/python_installation/README.md b/python_installation/README.md index 3cc3e92d156..3fb9aae3bb4 100644 --- a/python_installation/README.md +++ b/python_installation/README.md @@ -2,9 +2,9 @@ Huh, it's exciting, right?! You'll write your first line of code in just minutes! -But first, let us tell you what Python is. Python is a very popular programming language that can be used to write websites, games, science, graphics, and many, many more. +But first, let us tell you what Python is. Python is a very popular programming language that can be used for creating websites, games, science, graphics, and much, much more. -Python was conceived in the late 1980s and its main goal is to be readable by human beings (not only machines!) that's why it looks much simpler than other programming languages. That also makes it easy to learn, but don't worry, Python is also really powerful! +Python was conceived in the late 1980s and its main goal is to be readable by human beings (not only machines!), which is why it looks much simpler than other programming languages. That makes it easy to learn, but don't worry, Python is also really powerful! # Python installation