Skip to content

Commit 6ca5232

Browse files
authored
Merge pull request #1 from CHunYenc/online/django
[Migration] Flask to Django
2 parents f3a7e45 + 7b8560c commit 6ca5232

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1036
-1047
lines changed

.coverage

-52 KB
Binary file not shown.

.coveragerc

Lines changed: 0 additions & 5 deletions
This file was deleted.

.env.example

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
SECRET_KEY = INPUT_YOUR_SECRET_KEY
2-
REDIS_HOST = INPUT_YOUR_REDIS_HOST
3-
REDIS_PORT = INPUT_YOUR_REDIS_PORT
4-
5-
# CHANGE THE FILE NAME TO .env
1+
DEBUG=True
2+
SECRET_KEY=
3+
DATABASE_URL=
4+
CACHE_URL=
5+
# single
6+
# ALLOWED_HOSTS=*
7+
# mutiple
8+
ALLOWED_HOSTS=127.0.0.1,192.168.1.1

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
# virtualenv folder
22
venv/
3-
variables.py
43
config.py
54
pgdata/
65
__pycache__/
76
celerybeat-schedule
87
.idea/
98
secets.txt
10-
.vscode/
119
logs/
1210

1311
# Online
1412
**.log.**
1513
**.log
1614
**.pid
1715
.env
18-
.venv
16+
.venv
17+
.v39
18+
**.sqlite3
19+
mydatabase
20+
staticfiles

.prettierrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
2+
"printWidth": 120,
23
"tabWidth": 2,
34
"singleQuote": true,
45
"trailingComma": "none",
5-
"semi": false
6+
"semi": true,
7+
"bracketSameLine": true
68
}

.vscode/launch.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python: Django",
9+
"type": "python",
10+
"request": "launch",
11+
"program": "${workspaceFolder}/manage.py",
12+
"args": [
13+
"runserver"
14+
],
15+
"django": true,
16+
"justMyCode": true
17+
}
18+
]
19+
}

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"python.formatting.provider": "autopep8",
3+
"python.analysis.typeCheckingMode": "basic",
4+
"editor.formatOnSave": true,
5+
}

Procfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
web: gunicorn wsgi:app
2-
worker: celery -A celery_worker.celery worker -P eventlet -c 1000 --loglevel=info
3-
beat: celery -A celery_worker.celery beat -l info
1+
web: gunicorn core.asgi:application -w 2
2+
worker: celery -A core.celery worker -l info -B

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# dev/django
2+
3+
這個版本基於 django, 使用 celery.
4+
5+
[x] django-q. 不支援秒執行.
6+
7+
[x] apscheduler. 會導致任務重複執行.
8+
9+
[v] celery. perfect.
10+
11+
> 資料庫暫時使用 sqlite3, 若要使用 postgresql 請建立 .env 檔案至主目錄(與 manage.py 路徑相同)
12+
13+
# .env 內容
14+
15+
https://django-environ.readthedocs.io/en/latest/quickstart.html
16+
17+
```dotenv
18+
#.env
19+
DEBUG=True
20+
SECRET_KEY= ??
21+
DATABASE_URL= postgresql://??
22+
CACHE_URL= redis://??
23+
# single
24+
ALLOWED_HOSTS=*
25+
# mutiple
26+
# ALLOWED_HOSTS=127.0.0.1,192.168.1.1
27+
```

app.ini

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)