From 6258583fb15730e47dc81e0e47d6b12244ed4014 Mon Sep 17 00:00:00 2001 From: Audrey Roy Greenfeld Date: Sat, 3 Oct 2015 16:15:02 -0700 Subject: [PATCH 01/31] Docker Toolbox includes Virtualbox. No need to repeat. --- docs/developing-locally-docker.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index ee630545..d8a99850 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -16,7 +16,6 @@ Prerequisites If you don't already have these installed, you can get them at: * https://github.com/docker/toolbox/releases -* https://www.virtualbox.org/wiki/Downloads Go to the Root of your Project ------------------------------ From 606b026a8ca009c4ecaadd55a1d0b610779b730f Mon Sep 17 00:00:00 2001 From: Audrey Roy Greenfeld Date: Sat, 3 Oct 2015 16:21:08 -0700 Subject: [PATCH 02/31] Simplify docs and un-deprecate the part that's still valid. --- docs/developing-locally-docker.rst | 43 ++++++++++++------------------ 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index d8a99850..132bcb0a 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -4,6 +4,7 @@ Getting Up and Running with Docker .. index:: Docker The steps below will get you up and running with a local development environment. +All of these commands assume you are in the root of your generated project. Prerequisites -------------- @@ -17,11 +18,6 @@ If you don't already have these installed, you can get them at: * https://github.com/docker/toolbox/releases -Go to the Root of your Project ------------------------------- - -All of these commands assume you are in the root of your generated project. - Create the Machine ------------------- @@ -33,15 +29,6 @@ Create the Machine name them accordingly. Instead of 'dev1' you might have 'dev2', 'myproject', 'djangopackages', et al. -Make the new machine the active unit -------------------------------------- - -This tells our computer that all future commands are specifically for the just -created machine. Using the ``eval`` command we can switch machines as needed. - -:: - - $ eval "$(docker-machine env dev1)" Get the IP Address -------------------- @@ -122,17 +109,8 @@ Example: $ docker-compose run django python manage.py createsuperuser - -Deprecated -========== - -**Note:** This segment of documentation is being kept in this location as part of our documentation transition process. - - -The steps below will get you up and running with a local development environment. We assume you have the following installed: - -* docker -* docker-compose +Working With Your Container +----------------------------- Open a terminal at the project root and run the following for local development:: @@ -146,9 +124,22 @@ And then run:: $ docker-compose up - To migrate your app and to create a superuser, run:: $ docker-compose run django python manage.py migrate $ docker-compose run django python manage.py createsuperuser + + +Other Useful Tips +------------------ + +Make a machine the active unit +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This tells our computer that all future commands are specifically for the dev1 machine. +Using the ``eval`` command we can switch machines as needed. + +:: + + $ eval "$(docker-machine env dev1)" From 765bb32fbe11ecdd3b7c631b29e9bd7c7ae85c11 Mon Sep 17 00:00:00 2001 From: Audrey Roy Greenfeld Date: Sat, 3 Oct 2015 16:35:48 -0700 Subject: [PATCH 03/31] Simplify redundant parts of docker-compose instructions. --- docs/developing-locally-docker.rst | 43 +++++++++++++----------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index 132bcb0a..809a796d 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -75,28 +75,6 @@ on your development system. $ docker-compose build -Boot the System ------------------------------- - -This brings up both Django and PostgreSQL. The first time it is run it might -take a while to get started, but subsequent runs will occur quickly. - -:: - - $ docker-compose -f dev.yml up - -If you want to run the entire system in production mode, then run: - -:: - - $ docker-compose up - -If you want to run the stack in detached mode (in the background), use the ``-d`` argument:: - -:: - - $ docker-compose up -d - Running bash commands (i.e. management commands) ---------------------------------------------------- @@ -108,9 +86,13 @@ Example: $ docker-compose run django python manage.py migrate $ docker-compose run django python manage.py createsuperuser +Boot the System +--------------- -Working With Your Container ------------------------------ +This brings up both Django and PostgreSQL. + +The first time it is run it might take a while to get started, but subsequent +runs will occur quickly. Open a terminal at the project root and run the following for local development:: @@ -130,6 +112,10 @@ To migrate your app and to create a superuser, run:: $ docker-compose run django python manage.py createsuperuser +Production Mode +~~~~~~~~~~~~~~~~ + +Instead of using `dev.yml`, you would use `docker-compose.yml`. Other Useful Tips ------------------ @@ -143,3 +129,12 @@ Using the ``eval`` command we can switch machines as needed. :: $ eval "$(docker-machine env dev1)" + +Detached Mode +~~~~~~~~~~~~~ + +If you want to run the stack in detached mode (in the background), use the ``-d`` argument:: + +:: + + $ docker-compose up -d \ No newline at end of file From c9b4d1f16ef6a1797a4e521aec3b5ab92d0e6075 Mon Sep 17 00:00:00 2001 From: Audrey Roy Greenfeld Date: Sat, 3 Oct 2015 16:44:43 -0700 Subject: [PATCH 04/31] Unify docker-compose run sections. --- docs/developing-locally-docker.rst | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index 809a796d..fa3e670c 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -69,23 +69,10 @@ Build the Stack --------------- This can take a while, especially the first time you run this particular command -on your development system. - -:: +on your development system:: $ docker-compose build -Running bash commands (i.e. management commands) ----------------------------------------------------- - -This is done using the ``docker-compose run`` command. In the following examples -we specify the ``django`` container as the location to run our management commands. - -Example: - - $ docker-compose run django python manage.py migrate - $ docker-compose run django python manage.py createsuperuser - Boot the System --------------- @@ -105,13 +92,20 @@ You can also set the environment variable ``COMPOSE_FILE`` pointing to ``dev.yml And then run:: $ docker-compose up + +Running management commands +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +As with any shell command that we wish to run in our container, this is done +using the ``docker-compose run`` command. To migrate your app and to create a superuser, run:: $ docker-compose run django python manage.py migrate - $ docker-compose run django python manage.py createsuperuser +Here we specify the ``django`` container as the location to run our management commands. + Production Mode ~~~~~~~~~~~~~~~~ From 2d609432b916735d20018bde7b2f3ebcd973aba7 Mon Sep 17 00:00:00 2001 From: Audrey Roy Greenfeld Date: Sat, 3 Oct 2015 16:54:01 -0700 Subject: [PATCH 05/31] Add @jayfk's note from #356. --- docs/developing-locally-docker.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index fa3e670c..ec7686f1 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -18,10 +18,14 @@ If you don't already have these installed, you can get them at: * https://github.com/docker/toolbox/releases -Create the Machine -------------------- +Create the Machine (Optional) +------------------------------- -:: +On Ubuntu you have native Docker, so you don't need to create a VM with +docker-machine to use it. + +However, on Mac/Windows/other systems without native Docker, you'll want to +start by creating a VM with docker-machine:: $ docker-machine create --driver virtualbox dev1 @@ -29,7 +33,6 @@ Create the Machine name them accordingly. Instead of 'dev1' you might have 'dev2', 'myproject', 'djangopackages', et al. - Get the IP Address -------------------- From d09abc8d86370eabf5efd6650150f216ae735efc Mon Sep 17 00:00:00 2001 From: Audrey Roy Greenfeld Date: Sat, 3 Oct 2015 16:56:53 -0700 Subject: [PATCH 06/31] More simplification. --- docs/developing-locally-docker.rst | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index ec7686f1..0568d5d1 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -36,16 +36,13 @@ name them accordingly. Instead of 'dev1' you might have 'dev2', 'myproject', Get the IP Address -------------------- -Acquiring the IP Address is good for two reasons: - -1. Confirms that the machine is up and running. -2. Tells us the IP address where our Django project is being served. - -:: +Once your machine is up and running, run this:: $ docker-machine ip dev1 123.456.789.012 +This is also the IP address where the Django project will be served from. + Saving changes -------------- @@ -53,15 +50,12 @@ If you are using OS X or Windows, you need to create a /data partition inside th virtual machine that runs the docker deamon in order make all changes persistent. If you don't do that your /data directory will get wiped out on every reboot. -To create a persistent folder, log into the virtual machine by running: - -:: +To create a persistent folder, log into the virtual machine by running:: $ docker-machine ssh dev1 $ sudo su $ echo 'ln -sfn /mnt/sda1/data /data' >> /var/lib/boot2docker/bootlocal.sh - In case you are wondering why you can't use a host volume to keep the files on your mac: As of `boot2docker` 1.7 you'll run into permission problems with mounted host volumes if the container creates his own user and chown's the directories From d19ddbcf1e2ee048cf7ce0db73577ca095e6053f Mon Sep 17 00:00:00 2001 From: Audrey Roy Greenfeld Date: Sat, 3 Oct 2015 16:59:52 -0700 Subject: [PATCH 07/31] Explain Docker Toolbox better. --- docs/developing-locally-docker.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index 0568d5d1..145eda5e 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -9,14 +9,14 @@ All of these commands assume you are in the root of your generated project. Prerequisites -------------- +If you don't already have these installed, get them all by installing `Docker Toolbox`_. + * docker * docker-machine * docker-compose * virtualbox -If you don't already have these installed, you can get them at: - -* https://github.com/docker/toolbox/releases +.. _`Docker Toolbox`: https://github.com/docker/toolbox/releases Create the Machine (Optional) ------------------------------- From 694bbb2e810408c9224c07b74fdfd1b02c515801 Mon Sep 17 00:00:00 2001 From: Chris Franklin Date: Sun, 4 Oct 2015 15:44:06 +0100 Subject: [PATCH 08/31] Fixes #363 - Remove stray closing tags, fix navbar margin Removes stray tags that don't seem like they should be there. Reduces topbar bottom margin because it looked bad. --- .../{{cookiecutter.repo_name}}/templates/base.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/templates/base.html b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/templates/base.html index 50944cd2..0931ca8f 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/templates/base.html +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/templates/base.html @@ -31,7 +31,7 @@ -
+