Skip to content

Commit ede7606

Browse files
authored
fix permissions and build issues (#2219)
## Summary Fix Django permissions by granting the default user permissions to the public schema Fix potential psycopg2 build issues by adding the dev output of openssl ## How was it tested? Localhost and Devbox.sh
1 parent fd82154 commit ede7606

File tree

3 files changed

+68
-67
lines changed

3 files changed

+68
-67
lines changed

examples/stacks/django/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
1. Install [Devbox](https://www.jetify.com/devbox/docs/installing_devbox/)
1010
1. Run `devbox shell` to install your packages and run the init_hook. This will activate your virtual environment and install Django.
1111
1. Initialize PostgreSQL with `devbox run initdb`.
12+
1. Start the Postgres service by running `devbox services up postgresql`. You can start it in the background using `devbox services up -b postgresql`.
1213
1. In the root directory, run `devbox run create_db` to create the database and run your Django migrations
1314
1. In the root directory, run `devbox run server` to start the server. You can access the Django example at `localhost:8000`
1415

examples/stacks/django/devbox.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
2-
"packages": [
3-
"python@latest",
4-
"python311Packages.pip@latest",
5-
"openssl@latest",
6-
"postgresql@latest"
7-
],
2+
"packages": {
3+
"python": "latest",
4+
"openssl": {
5+
"version": "latest",
6+
"outputs": ["out", "dev"]
7+
},
8+
"postgresql": "latest",
9+
"zlib": "latest"
10+
},
811
"env": {
912
"PGPORT": "5434"
1013
},
@@ -19,6 +22,8 @@
1922
"dropdb --if-exists todo_db",
2023
"createdb todo_db",
2124
"psql todo_db -c \"CREATE USER todo_user WITH PASSWORD 'secretpassword';\"",
25+
"psql todo_db -c \"ALTER DATABASE todo_db OWNER TO todo_user;\"",
26+
"psql todo_db -c \"ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO todo_user;\"",
2227
"python todo_project/manage.py makemigrations",
2328
"python todo_project/manage.py migrate"
2429
],

examples/stacks/django/devbox.lock

Lines changed: 56 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -234,145 +234,140 @@
234234
}
235235
}
236236
},
237-
"python311Packages.pip@latest": {
237+
"python@latest": {
238238
"last_modified": "2024-02-10T18:15:24Z",
239-
"plugin_version": "0.0.2",
240-
"resolved": "github:NixOS/nixpkgs/10b813040df67c4039086db0f6eaf65c536886c6#python311Packages.pip",
239+
"plugin_version": "0.0.3",
240+
"resolved": "github:NixOS/nixpkgs/10b813040df67c4039086db0f6eaf65c536886c6#python312",
241241
"source": "devbox-search",
242-
"version": "23.3.1",
242+
"version": "3.12.1",
243243
"systems": {
244244
"aarch64-darwin": {
245245
"outputs": [
246246
{
247247
"name": "out",
248-
"path": "/nix/store/k6snj78rgh2x8vwifg7dgr1fjcgpsfdx-python3.11-pip-23.3.1",
249-
"default": true
250-
},
251-
{
252-
"name": "man",
253-
"path": "/nix/store/pzaf53l42g6vkifk0ds6nzp4xbjb7rcq-python3.11-pip-23.3.1-man",
248+
"path": "/nix/store/s1mr5bmvfcy4hm7669d2xx3gqgj481qk-python3-3.12.1",
254249
"default": true
255-
},
256-
{
257-
"name": "dist",
258-
"path": "/nix/store/93lazq44rfpkz6ibfk18rbkhc88hkb02-python3.11-pip-23.3.1-dist"
259250
}
260251
],
261-
"store_path": "/nix/store/k6snj78rgh2x8vwifg7dgr1fjcgpsfdx-python3.11-pip-23.3.1"
252+
"store_path": "/nix/store/s1mr5bmvfcy4hm7669d2xx3gqgj481qk-python3-3.12.1"
262253
},
263254
"aarch64-linux": {
264255
"outputs": [
265256
{
266257
"name": "out",
267-
"path": "/nix/store/2f2666vr91manr2290mc6r8ysjspj32s-python3.11-pip-23.3.1",
268-
"default": true
269-
},
270-
{
271-
"name": "man",
272-
"path": "/nix/store/i5mjfwavfy5zi9i52bm2hznkzapa2y01-python3.11-pip-23.3.1-man",
258+
"path": "/nix/store/qv710q1p74qb7bswpwh59px28gfj51b1-python3-3.12.1",
273259
"default": true
274260
},
275261
{
276-
"name": "dist",
277-
"path": "/nix/store/cazjlkbrsj4d9rvjvj5lmy52bjszz55q-python3.11-pip-23.3.1-dist"
262+
"name": "debug",
263+
"path": "/nix/store/6i8r0lq7m7rf7lcqjrwizkcaznmhd2cm-python3-3.12.1-debug"
278264
}
279265
],
280-
"store_path": "/nix/store/2f2666vr91manr2290mc6r8ysjspj32s-python3.11-pip-23.3.1"
266+
"store_path": "/nix/store/qv710q1p74qb7bswpwh59px28gfj51b1-python3-3.12.1"
281267
},
282268
"x86_64-darwin": {
283269
"outputs": [
284270
{
285271
"name": "out",
286-
"path": "/nix/store/k7pk07yj3ich8q93w6g4c60ac6zwm5cd-python3.11-pip-23.3.1",
287-
"default": true
288-
},
289-
{
290-
"name": "man",
291-
"path": "/nix/store/74p97gd82q10ngfgypv7p6d0w9b5s2mw-python3.11-pip-23.3.1-man",
272+
"path": "/nix/store/051hdrw5qmgbplch184mplcnv4djfb8a-python3-3.12.1",
292273
"default": true
293-
},
294-
{
295-
"name": "dist",
296-
"path": "/nix/store/cg5s3fj3g6pzc2zxqv9sfqvrci2jg9jb-python3.11-pip-23.3.1-dist"
297274
}
298275
],
299-
"store_path": "/nix/store/k7pk07yj3ich8q93w6g4c60ac6zwm5cd-python3.11-pip-23.3.1"
276+
"store_path": "/nix/store/051hdrw5qmgbplch184mplcnv4djfb8a-python3-3.12.1"
300277
},
301278
"x86_64-linux": {
302279
"outputs": [
303280
{
304281
"name": "out",
305-
"path": "/nix/store/9mywabcbd363zr20bl2cvz09hij0ywiw-python3.11-pip-23.3.1",
306-
"default": true
307-
},
308-
{
309-
"name": "man",
310-
"path": "/nix/store/f5m5mxqq4nhnkl9i8qzpx0ypwhs7xd3p-python3.11-pip-23.3.1-man",
282+
"path": "/nix/store/y4dxr00qg40pwgxx9nxj61091zk8bsvl-python3-3.12.1",
311283
"default": true
312284
},
313285
{
314-
"name": "dist",
315-
"path": "/nix/store/z9232w9zq46dypkka116bbbjqdhj6wnc-python3.11-pip-23.3.1-dist"
286+
"name": "debug",
287+
"path": "/nix/store/n8jysaqvk89q6fbif4mlacni6wwq0sgc-python3-3.12.1-debug"
316288
}
317289
],
318-
"store_path": "/nix/store/9mywabcbd363zr20bl2cvz09hij0ywiw-python3.11-pip-23.3.1"
290+
"store_path": "/nix/store/y4dxr00qg40pwgxx9nxj61091zk8bsvl-python3-3.12.1"
319291
}
320292
}
321293
},
322-
"python@latest": {
323-
"last_modified": "2024-02-10T18:15:24Z",
324-
"plugin_version": "0.0.3",
325-
"resolved": "github:NixOS/nixpkgs/10b813040df67c4039086db0f6eaf65c536886c6#python312",
294+
"zlib@latest": {
295+
"last_modified": "2024-08-04T20:22:49Z",
296+
"resolved": "github:NixOS/nixpkgs/785feb91183a50959823ff9ba9ef673105259cd5#zlib",
326297
"source": "devbox-search",
327-
"version": "3.12.1",
298+
"version": "1.3.1",
328299
"systems": {
329300
"aarch64-darwin": {
330301
"outputs": [
331302
{
332303
"name": "out",
333-
"path": "/nix/store/s1mr5bmvfcy4hm7669d2xx3gqgj481qk-python3-3.12.1",
304+
"path": "/nix/store/0ib2jb462dh3mg5yrv77g4zv7x5m2gy3-zlib-1.3.1",
334305
"default": true
306+
},
307+
{
308+
"name": "static",
309+
"path": "/nix/store/4fj2pdvfkjswrar0psn7hs83izdsz5p1-zlib-1.3.1-static"
310+
},
311+
{
312+
"name": "dev",
313+
"path": "/nix/store/f2xa3kz4yi0dld22v26gx7szqqvcrh32-zlib-1.3.1-dev"
335314
}
336315
],
337-
"store_path": "/nix/store/s1mr5bmvfcy4hm7669d2xx3gqgj481qk-python3-3.12.1"
316+
"store_path": "/nix/store/0ib2jb462dh3mg5yrv77g4zv7x5m2gy3-zlib-1.3.1"
338317
},
339318
"aarch64-linux": {
340319
"outputs": [
341320
{
342321
"name": "out",
343-
"path": "/nix/store/qv710q1p74qb7bswpwh59px28gfj51b1-python3-3.12.1",
322+
"path": "/nix/store/s6wl1gipyv3zrg2qxg3r95fz8fr3wx9v-zlib-1.3.1",
344323
"default": true
345324
},
346325
{
347-
"name": "debug",
348-
"path": "/nix/store/6i8r0lq7m7rf7lcqjrwizkcaznmhd2cm-python3-3.12.1-debug"
326+
"name": "static",
327+
"path": "/nix/store/cfc0kw9iw953753my6hnbi3issc01i39-zlib-1.3.1-static"
328+
},
329+
{
330+
"name": "dev",
331+
"path": "/nix/store/b1nffz5ndqpxfhbmga9rln62cqp2v69h-zlib-1.3.1-dev"
349332
}
350333
],
351-
"store_path": "/nix/store/qv710q1p74qb7bswpwh59px28gfj51b1-python3-3.12.1"
334+
"store_path": "/nix/store/s6wl1gipyv3zrg2qxg3r95fz8fr3wx9v-zlib-1.3.1"
352335
},
353336
"x86_64-darwin": {
354337
"outputs": [
355338
{
356339
"name": "out",
357-
"path": "/nix/store/051hdrw5qmgbplch184mplcnv4djfb8a-python3-3.12.1",
340+
"path": "/nix/store/nkvmqr2m7p5i3grkrlypnj4jgp7gkl15-zlib-1.3.1",
358341
"default": true
342+
},
343+
{
344+
"name": "dev",
345+
"path": "/nix/store/bh4s6742cgmqqyxjc018b6wynlmbq2rc-zlib-1.3.1-dev"
346+
},
347+
{
348+
"name": "static",
349+
"path": "/nix/store/sdsilixvl5q3mpi3yybns6k3malr28p2-zlib-1.3.1-static"
359350
}
360351
],
361-
"store_path": "/nix/store/051hdrw5qmgbplch184mplcnv4djfb8a-python3-3.12.1"
352+
"store_path": "/nix/store/nkvmqr2m7p5i3grkrlypnj4jgp7gkl15-zlib-1.3.1"
362353
},
363354
"x86_64-linux": {
364355
"outputs": [
365356
{
366357
"name": "out",
367-
"path": "/nix/store/y4dxr00qg40pwgxx9nxj61091zk8bsvl-python3-3.12.1",
358+
"path": "/nix/store/phnpfqk1j35nil4hqgaslqm9a1q2gffy-zlib-1.3.1",
368359
"default": true
369360
},
370361
{
371-
"name": "debug",
372-
"path": "/nix/store/n8jysaqvk89q6fbif4mlacni6wwq0sgc-python3-3.12.1-debug"
362+
"name": "dev",
363+
"path": "/nix/store/fw1jqi1ia1sinknci20m95mybpidrbhc-zlib-1.3.1-dev"
364+
},
365+
{
366+
"name": "static",
367+
"path": "/nix/store/3wwn6ydps6ph61yzh0iiaib4a452h8k7-zlib-1.3.1-static"
373368
}
374369
],
375-
"store_path": "/nix/store/y4dxr00qg40pwgxx9nxj61091zk8bsvl-python3-3.12.1"
370+
"store_path": "/nix/store/phnpfqk1j35nil4hqgaslqm9a1q2gffy-zlib-1.3.1"
376371
}
377372
}
378373
}

0 commit comments

Comments
 (0)