You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,12 @@
6
6
7
7
- Support for Django 4.0 ([#164](https://github.com/torchbox/django-pattern-library/pull/164)).
8
8
- Support for Python 3.10 ([#163](https://github.com/torchbox/django-pattern-library/pull/163)).
9
+
- VS Code devcontainer for development [#178](https://github.com/torchbox/django-pattern-library/pull/178)
10
+
11
+
### Changed
12
+
13
+
- Change Poetry version to be `>=1.1.12,<2` in Docker development setup (prevents `JSONDecodeError` issue under Python 3.10) [#178](https://github.com/torchbox/django-pattern-library/pull/178)
14
+
- Move demo/test app pattern-library from `/pattern-library/` to `/`[#178](https://github.com/torchbox/django-pattern-library/pull/178)
9
15
10
16
### Removed
11
17
@@ -29,7 +35,7 @@ This addresses the following limitations of the pattern library:
29
35
-[#113 Django form fields not well supported](https://github.com/torchbox/django-pattern-library/issues/113)
30
36
-[#135 Competing tag/context config for image provides inconsistent result](https://github.com/torchbox/django-pattern-library/issues/135)
31
37
32
-
View the [documentation](https://torchbox.github.io/django-pattern-library/guides/defining-template-context/#modifying-template-contexts-with-python), as well as demos leveraging the new capability: [forms](https://torchbox.github.io/django-pattern-library/demo/pattern-library/pattern/patterns/pages/forms/example_form.html) (see [forms and fields recipe](https://torchbox.github.io/django-pattern-library/recipes/forms-and-fields/)), and [pagination](https://torchbox.github.io/django-pattern-library/demo/pattern-library/pattern/patterns/pages/search/search.html) (see [pagination recipe](https://torchbox.github.io/django-pattern-library/recipes/pagination/)).
38
+
View the [documentation](https://torchbox.github.io/django-pattern-library/guides/defining-template-context/#modifying-template-contexts-with-python), as well as demos leveraging the new capability: [forms](https://torchbox.github.io/django-pattern-library/demo/pattern/patterns/pages/forms/example_form.html) (see [forms and fields recipe](https://torchbox.github.io/django-pattern-library/recipes/forms-and-fields/)), and [pagination](https://torchbox.github.io/django-pattern-library/demo/pattern/patterns/pages/search/search.html) (see [pagination recipe](https://torchbox.github.io/django-pattern-library/recipes/pagination/)).
Once you have the code, there are several ways of running the project:
16
19
17
-
We use [Poetry](https://poetry.eustace.io/docs/) to manage Python dependencies, so make sure you've got it installed.
20
+
-[In a VS Code devcontainer](#vs-code-devcontainer)
21
+
-[In Docker, via docker-compose](#docker-compose)
22
+
-[Locally, with Poetry](#run-locally-with-poetry)
18
23
19
-
Then you can install the dependencies and run the test app:
24
+
### VS Code devcontainer
20
25
21
-
```sh
22
-
poetry install
23
-
# Start the server for testing:
24
-
poetry run django-admin runserver --settings=tests.settings.dev --pythonpath=.
25
-
# Or to try out the render_patterns command:
26
-
poetry run django-admin render_patterns --settings=tests.settings.dev --pythonpath=. --dry-run --verbosity 2
27
-
```
26
+
For users of Docker and VS Code, there is a [devcontainer](https://code.visualstudio.com/docs/remote/containers) setup included in the repository
27
+
that will automatically install the Python dependencies and start the frontend tooling.
28
+
29
+
Once the container is built, open a terminal with VS Code and run `django-admin runserver` and click the URL (normally http://127.0.0.1:8000/) to open the app in your browser. You'll see a 404 page, because there's nothing at `/`, add `pattern-libary/` to the end of the URL to view the demo app.
28
30
29
-
### Run a local build with docker
31
+
### `docker-compose`
30
32
31
-
First [install Docker and docker-compose](https://docs.docker.com/compose/install/), and make sure Docker is started.
33
+
First [install Docker and docker-compose](https://docs.docker.com/compose/install/), and make sure Docker is started. Then:
32
34
33
35
```sh
34
36
# Install the front-end tooling in the docker container:
35
37
docker-compose run frontend npm ci
36
-
#Start the dev server and run the front-end tooling in watch mode:
38
+
#Bring up the web container and run the front-end tooling in watch mode:
37
39
docker-compose up
40
+
# Run the development server:
41
+
docker-compose exec web django-admin runserver 0.0.0.0:8000
38
42
```
39
43
40
-
Once the server is started, the pattern library will be available at `http://localhost:8000/pattern-library/`.
44
+
Once the server is started, the pattern library will be available at `http://localhost:8000/`.
45
+
46
+
### Run locally with Poetry
41
47
42
-
### Front-end tooling
48
+
We use [Poetry](https://python-poetry.org/docs/) to manage Python dependencies, so make sure you've got it installed.
49
+
50
+
Then you can install the dependencies and run the test app:
51
+
52
+
```sh
53
+
poetry install
54
+
# Start the server for testing:
55
+
poetry run django-admin runserver --settings=tests.settings.dev --pythonpath=.
56
+
# Or to try out the render_patterns command:
57
+
poetry run django-admin render_patterns --settings=tests.settings.dev --pythonpath=. --dry-run --verbosity 2
58
+
```
59
+
60
+
## Front-end tooling
43
61
44
62
If you want to make changes to the front-end assets (located in the `pattern_library/static/pattern_library/src` folder), you'll need to ensure the tooling is set up in order to build the assets.
45
63
46
-
If you are using Docker you will already have the tooling set up and running in watch mode. Otherwise,
64
+
If you are using Docker, you will already have the tooling set up and running in watch mode. You can view the logs with `docker-compose logs frontend` from your host machine.
65
+
66
+
Otherwise, we recommend using [`nvm`](https://github.com/nvm-sh/nvm):
47
67
48
68
```sh
49
69
# Install the correct version of Node
@@ -56,7 +76,7 @@ npm run build
56
76
npm run start
57
77
```
58
78
59
-
###Documentation
79
+
## Documentation
60
80
61
81
The project’s documentation website is built with [MkDocs](https://www.mkdocs.org/).

8
8
@@ -31,8 +31,8 @@ Learn more by watching our presentation – [Reusable UI components: A journey f
31
31
32
32
The pattern library is dependent on Django for rendering – but also supports exporting as a static site if needed. Try out our online demo:
33
33
34
-
- For a component, [accordion.html](https://torchbox.github.io/django-pattern-library/demo/pattern-library/pattern/patterns/molecules/accordion/accordion.html)
35
-
- For a page-level template, [person_page.html](https://torchbox.github.io/django-pattern-library/demo/pattern-library/pattern/patterns/pages/people/person_page.html)
34
+
- For a component, [accordion.html](https://torchbox.github.io/django-pattern-library/demo/pattern/patterns/molecules/accordion/accordion.html)
35
+
- For a page-level template, [person_page.html](https://torchbox.github.io/django-pattern-library/demo/pattern/patterns/pages/people/person_page.html)
Copy file name to clipboardExpand all lines: docs/getting-started.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Getting started
2
2
3
-
> If you just want to see django-pattern-library up and running, have a look at our [online demo](https://torchbox.github.io/django-pattern-library/demo/pattern-library/pattern/patterns/molecules/accordion/accordion.html).
3
+
> If you just want to see django-pattern-library up and running, have a look at our [online demo](https://torchbox.github.io/django-pattern-library/demo/pattern/patterns/molecules/accordion/accordion.html).
Copy file name to clipboardExpand all lines: docs/index.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,8 +29,8 @@ Pattern libraries will change your workflow for the better:
29
29
30
30
The pattern library is dependent on Django for rendering – but also supports exporting as a static site if needed. Try out our online demo:
31
31
32
-
- For a component, [accordion.html](https://torchbox.github.io/django-pattern-library/demo/pattern-library/pattern/patterns/molecules/accordion/accordion.html)
33
-
- For a page-level template, [person_page.html](https://torchbox.github.io/django-pattern-library/demo/pattern-library/pattern/patterns/pages/people/person_page.html)
32
+
- For a component, [accordion.html](https://torchbox.github.io/django-pattern-library/demo/pattern/patterns/molecules/accordion/accordion.html)
33
+
- For a page-level template, [person_page.html](https://torchbox.github.io/django-pattern-library/demo/pattern/patterns/pages/people/person_page.html)
0 commit comments