Skip to content

Commit 784ee41

Browse files
committed
update
1 parent f95aeec commit 784ee41

32 files changed

+219
-647
lines changed

Taskfile.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ includes:
3939
dir: packages/py-gui/
4040
optional: true
4141

42+
web:
43+
aliases: ["w"]
44+
taskfile: packages/py-web/
45+
dir: packages/py-web/
46+
optional: true
47+
4248
crawler:
4349
aliases: ["cr"]
4450
taskfile: packages/py-crawler/

packages/py-data/Taskfile.yml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,7 @@ version: "3"
22

33
includes:
44
pygwalker:
5-
aliases: [ 'pyg' ]
5+
aliases: ["pyg"]
66
taskfile: try-pygwalker/
77
dir: try-pygwalker/
88
optional: true
9-
10-
11-
#
12-
# global vars: https://taskfile.dev/#/usage?id=variables
13-
#
14-
vars:
15-
VAR1: "some-var"
16-
17-
# global env:
18-
env:
19-
ENV1: testing
20-
21-
################################################################################################
22-
23-
24-
tasks:
25-
poetry:
26-
aliases: [ 'p' ]
27-
cmds:
28-
- poetry
29-
- poetry {{.CLI_ARGS}}

packages/py-web/Taskfile.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: "3"
2+
3+
includes:
4+
django-rest-framework:
5+
aliases: ["drf"]
6+
taskfile: try-django-drf/
7+
dir: try-django-drf/
8+
optional: true
9+
10+
django-ninja:
11+
aliases: ["dn"]
12+
taskfile: try-django-ninja/
13+
dir: try-django-ninja/
14+
optional: true

packages/try/try-django/README.md renamed to packages/py-web/try-django-drf/README.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,57 @@
66
## Features
77

88
- [django-rest-framework](https://www.django-rest-framework.org/tutorial/quickstart/)
9-
- token auth: [authentication](https://www.django-rest-framework.org/api-guide/authentication/)
9+
- token auth: [authentication](https://www.django-rest-framework.org/api-guide/authentication/)
1010
- [django-cors-headers](https://github.com/adamchainz/django-cors-headers)
1111
- [OpenAPI: Spectacular](https://github.com/tfranzel/drf-spectacular/)
1212
- [sentry](https://sentry.io/)
1313
- [django-simpleui]()
1414

15-
## Quick start:
15+
## Quick start
1616

17-
### init db:
17+
### init db
1818

1919
```ruby
20+
cd git-repo-root/
21+
task web:drf:init
22+
23+
# or
2024
task init
2125
```
2226

23-
### create admin user:
27+
### create admin user
2428

2529
```ruby
30+
cd git-repo-root/
31+
task web:drf:init:user
32+
33+
# or
2634
task init:user # input: admin/admin
2735
```
2836

29-
### run http server:
37+
### run http server
3038

3139
```ruby
40+
cd git-repo-root/
41+
task web:drf:run
42+
43+
# or
44+
cd this-dir/
3245
task run
3346
```
3447

35-
## Manual:
48+
## Manual
3649

37-
### new project:
50+
### new project
3851

3952
```ruby
4053

4154
django-admin startproject mysite
4255
```
4356

44-
### new app:
57+
### new app
4558

4659
```ruby
4760

4861
django-admin startapp myapp
49-
```
62+
```
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
version: "3"
2+
3+
#
4+
# global vars: https://taskfile.dev/#/usage?id=variables
5+
#
6+
vars:
7+
VAR1: "some-var"
8+
9+
# global env:
10+
env:
11+
ENV1: testing
12+
13+
################################################################################################
14+
15+
tasks:
16+
uv:
17+
aliases: ["pm", "pkg"]
18+
cmds:
19+
- uv {{.CLI_ARGS}}
20+
21+
run:
22+
aliases: ["r"]
23+
cmds:
24+
- uv run python src/manage.py runserver
25+
26+
exec:
27+
aliases: ["e"]
28+
cmds:
29+
- uv run python src/manage.py {{.CLI_ARGS}}
30+
31+
init:
32+
cmds:
33+
- uv run python src/manage.py makemigrations
34+
- uv run python src/manage.py migrate
35+
36+
# user: admin
37+
# email: admin@admin.com
38+
# pwd: admin
39+
init:user:
40+
cmds:
41+
- uv run python src/manage.py createsuperuser # admin/admin
42+
43+
install:
44+
aliases: ["i"]
45+
cmds:
46+
- uv install
47+
48+
add:
49+
aliases: ["a"]
50+
cmds:
51+
- uv add {{.CLI_ARGS}} # --dev
52+
53+
add:all:
54+
cmds:
55+
- uv add "typer[all]" selenium
56+
57+
new:project:
58+
aliases: ["np"]
59+
cmds:
60+
- uv run django-admin startproject {{.CLI_ARGS}}
61+
# dir: "src/try_django"
62+
63+
new:app:
64+
aliases: ["na"]
65+
cmds:
66+
- echo $(pwd)
67+
- uv run django-admin startapp {{.CLI_ARGS}}
68+
dir: "src/modules"
69+
ignore_error: true
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[project]
2+
name = "try-django-drf"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
requires-python = ">=3.12"
7+
dependencies = [
8+
"django>=5.1.7",
9+
"django-cors-headers>=4.7.0",
10+
"django-debug-toolbar>=5.1.0",
11+
"djangorestframework>=3.16.0",
12+
"drf-spectacular>=0.28.0",
13+
"sentry-sdk>=2.24.1",
14+
]

0 commit comments

Comments
 (0)