Skip to content

Commit e12cdbf

Browse files
committed
Tweak installation docs and playbook a bit
- Require Ansble 2.0+ - Python 3 is installed by default in 18.04 - Make installation docs a bit more explicit
1 parent 2536962 commit e12cdbf

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

Vagrantfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Vagrant.configure(2) do |config|
1313
end
1414
config.vm.provision "ansible" do |ansible|
1515
ansible.playbook = "provisioning/pythondotorg.yml"
16+
ansible.compatibility_mode = "2.0"
1617
ansible.host_key_checking = false
1718
end
1819
config.ssh.insert_key = false

docs/source/install.rst

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Here are two ways to hack on python.org:
1111
Easy setup using Vagrant
1212
------------------------
1313

14-
First, install Vagrant_ and Ansible_ on your machine.
14+
First, install Vagrant_ (2.0+) and Ansible_ (2.0+) on your machine.
1515
You should then be able to provision the Vagrant box.
1616

1717
::
@@ -21,7 +21,8 @@ You should then be able to provision the Vagrant box.
2121
The box will be provisioned with a latest Python 3.6 version, a virtual
2222
environment with all the requirements installed, and a database ready to use.
2323

24-
Once this is done it's time to create some data and run the server::
24+
Once this is done it's time to create some data and start the development server
25+
for the first time::
2526

2627
# SSH into the Vagrant box.
2728
$ vagrant ssh
@@ -36,8 +37,15 @@ Once this is done it's time to create some data and run the server::
3637
# Run the server.
3738
$ ./manage.py runserver 0.0.0.0:8000
3839

39-
Now use your favorite browser to go to http://localhost:8001/.
40-
The admin pages can be found at http://localhost:8001/admin/.
40+
Now use your favorite browser to go to http://localhost:8001/. The admin pages
41+
can be found at http://localhost:8001/admin/. You can use your superuser
42+
credentials to log in to Django admin.
43+
44+
You will only need to run the following two commands the next time you want to
45+
work on python.org::
46+
47+
$ vagrant ssh
48+
$ ./manage.py runserver 0.0.0.0:8000
4149

4250
.. _Vagrant: https://www.vagrantup.com/downloads.html
4351
.. _Ansible: https://docs.ansible.com/ansible/intro_installation.html
@@ -55,7 +63,8 @@ Then create a virtual environment::
5563

5664
$ python3.6 -m venv venv
5765

58-
And then you'll need to install dependencies::
66+
And then you'll need to install dependencies. You don't need to use ``pip3``
67+
inside a Python 3 virtual environment::
5968

6069
$ pip install -r dev-requirements.txt
6170

@@ -76,6 +85,9 @@ default. Run the following command to create a new database::
7685

7786
$ sudo -u postgres createdb pythondotorg -E utf-8 -l en_US.UTF-8
7887

88+
Note that this solution may not work if you've installed PostgreSQL via
89+
Homebrew.
90+
7991
If you get an error like this::
8092

8193
createdb: database creation failed: ERROR: new collation (en_US.UTF-8) is incompatible with the collation of the template database (en_GB.UTF-8)
@@ -88,7 +100,7 @@ To change database configuration, you can add the following setting to
88100
variable)::
89101

90102
DATABASES = {
91-
'default': dj_database_url.parse('postgres:///your_database_name')
103+
'default': dj_database_url.parse('postgres:///your_database_name'),
92104
}
93105

94106
If you prefer to use a simpler setup for your database you can use SQLite.

provisioning/pythondotorg.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
- libpq-dev
1919
- lib32z1-dev
2020
- git
21-
- python3
2221
- python3-dev
2322
- python3-setuptools
2423
- python3-pip
@@ -76,7 +75,7 @@
7675
clone=no
7776
update=no
7877

79-
- name: Install packages required by the Django app inside virtualenv
78+
- name: Install dependencies for the Django app inside virtual environment
8079
pip: virtualenv={{ project.virtualenv }}
8180
virtualenv_command="/usr/bin/python3 -m venv"
8281
requirements={{ project.requirements }}
@@ -88,7 +87,7 @@
8887
register: result
8988
changed_when: "result.rc is defined and result.stderr is defined and result.rc != 0 or result.stderr != ''"
9089

91-
- name: Install database migrations
90+
- name: Apply database migrations
9291
django_manage: command=migrate
9392
app_path={{ project.path }}
9493
virtualenv={{ project.virtualenv }}

0 commit comments

Comments
 (0)