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
In this case PostgreSQL will run accepting 200 maximum connections.
218
+
219
+
## Developing with Dev Containers in VS Code
220
+
221
+
This repo includes a .devcontainer folder with the condigurations to run Django and Celery inside a VS Code Dev Container.
222
+
A `docker.sh` script aliases the `docker compose` command with the pre-configured arguments to use the customized compose files.
223
+
224
+
You can run the Dev Container with the following commands:
225
+
226
+
```bash
227
+
cd .devcontainer
228
+
chmod +x docker.sh
229
+
./docker.sh build
230
+
.docker.sh up -d
231
+
```
232
+
233
+
The Django and the Celery containers will be started **without** running the Django and Celery processes. They can be started manually inside the dev container. The container is autopopulated with VS Code development extensions for Python and a list of pre-configured luanch configurations (for Django and Celery).
234
+
235
+
Within VS Code open the command palette with `Ctrl+P` and run `Dev Container: Reopen in Container`. VS Code will recognize the presence of the two dev container, and will allow to reopen the current window inside the container's workspace.
236
+
Wait a few seconds to let VS Code setup the dev extensions, then you should see the launch configurations.
237
+
238
+
To simplify the debugging of GeoNode and the GeoNode client, these modules can be installed as editable (PEP-660) with the following commands:
The modules will be isntalled under `/usr/src` and so at te root of the VS Code workspace.
246
+
Notice that at the time of writing Pylance can't resolve PEP-660 editable installs. For this reason the `.vscode/settings.py` contain extrPaths for the modules.
247
+
248
+
### Running Django
249
+
The `GeoNode` launch configuration for Django sets the `ASYNC_SIGNALS` env variable to False. This way GeoNode can be developed and debugged in sync mode, without Celery.
250
+
If you want to test Django in async mode, you can switch this variable to `True` and tun Celery (see below).
251
+
252
+
Running the Debug sessions for Django will start Django with its internal development server.
253
+
254
+
### Running Celery
255
+
Celery exectutions requires luanching three Debug processes:
256
+
257
+
- `Celery Worker`: the generic worker process
258
+
- `Celery Beat`: the scheduler
259
+
- `Celery Harvesters`: The worker dedicated to the harvesters
260
+
261
+
You can also remove the `-X harvesting` argument inside the Celery Worker launch configuration to have also the harvesters running in the same worker. this way you don't need to run the Beat and the Celery Harvesters processes.
0 commit comments