forked from orf/django-docker-box
-
Notifications
You must be signed in to change notification settings - Fork 42
Include information about Windows usage and Python/DB versions in README #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
anorthall
wants to merge
4
commits into
django:main
Choose a base branch
from
anorthall:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,26 @@ database versions, including Oracle. | |
|
||
## Quickstart | ||
|
||
Clone this repository somewhere. Also make sure you have docker and docker-compose installed. | ||
Clone this repository and ensure you have docker and docker-compose installed. | ||
|
||
Ensure that the `DJANGO_PATH` variable points to the root of the Django repo: | ||
### Environment | ||
|
||
You must set the `DJANGO_PATH` environment variable to the path of your local Django installation. | ||
This can either be added to the `.env` file, or interactively set in your shell, like so: | ||
|
||
`export DJANGO_PATH=~/projects/django/` | ||
|
||
If you see a docker-compose warning about it not being defined followed by an error ensure that is defined in the shell you are using. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed this because I tested the error and it is extremely specific and could not be confused - not necessary to have here. |
||
You must also check the `.env` file (in the root of this repository) and ensure that the versions | ||
of both Python and and database(s) you wish to test against are properly configured. For example, | ||
Django 5.0 requires Python 3.10 (or later) and PostgreSQL 13 (or later), so if you wish to | ||
test against Django 5.0 with PostgreSQL, an appropriate `.env` file may be: | ||
|
||
```env | ||
PYTHON_VERSION=3.10 | ||
POSTGRES_VERSION=13 | ||
``` | ||
|
||
anorthall marked this conversation as resolved.
Show resolved
Hide resolved
anorthall marked this conversation as resolved.
Show resolved
Hide resolved
|
||
### Running tests | ||
|
||
You can now either download the latest image used on the CI servers with the dependencies pre-installed: | ||
|
||
|
@@ -26,14 +39,14 @@ Or build it yourself: | |
|
||
`docker-compose build sqlite` | ||
|
||
Then simply run: | ||
Then run the following command to test against SQLite: | ||
|
||
`docker-compose run --rm sqlite` | ||
|
||
All arguments are passed to `runtests.py`. Before they are run all specific dependencies are | ||
installed (and cached across runs). | ||
|
||
## Different databases | ||
### Different databases | ||
|
||
Simply substitute `sqlite` for any supported database: | ||
|
||
|
@@ -47,19 +60,16 @@ And if you're mad you can run all the tests for all databases in parallel: | |
|
||
`docker-compose up` | ||
|
||
#### Database versions | ||
### Setting versions | ||
|
||
You can customize the version of the database you test against by changing the appropriate `[db]_VERSION` environment variable. See the Configuration section below for the available options and their defaults. | ||
For convenience, you may quickly change between Python and database versions by setting the | ||
appropriate environment variables inline, for example: | ||
|
||
## Different Python versions | ||
`PYTHON_VERSION=3.12 POSTGRES_VERSION=15 docker-compose pull postgres` | ||
|
||
The `PYTHON_VERSION` environment variable customizes which version of Python you are running the tests against. e.g: | ||
Or run the following command to run the tests immediately: | ||
|
||
`PYTHON_VERSION=3.8 docker-compose run --rm sqlite` | ||
|
||
You can also pull the pre-built image in the same way: | ||
|
||
`PYTHON_VERSION=3.8 docker-compose pull sqlite` | ||
`PYTHON_VERSION=3.12 POSTGRES_VERSION=15 docker-compose run --rm postgres` | ||
|
||
## Oracle | ||
|
||
|
@@ -102,7 +112,6 @@ To enter a bash shell within the container, run: | |
| `MYSQL_VERSION` | `8` | The mysql version to use | | ||
| `MARIADB_VERSION` | `10.4` | The mariadb version to use | | ||
|
||
|
||
## Why? | ||
|
||
I prefer using docker over Vagrant and virtualbox, which is what django-box uses. I think this | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.