-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AU-4] Working for start with Celerity... Have a problem with a show …
…tasks into flower. See issues: mher/flower#895 mher/flower#909 mher/flower#787
- Loading branch information
1 parent
e10afc7
commit 8dd3dca
Showing
7 changed files
with
237 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Python | ||
__pycache__/ | ||
*.pyc | ||
*.pyo | ||
*$py.class | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
*.manifest | ||
*.spec | ||
|
||
# Log files | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
*.log | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
.pytest_cache/ | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Environment | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
|
||
# If you are using PyCharm | ||
.idea/ | ||
|
||
# vscode | ||
.vscode/settings.json | ||
|
||
.env |
51 changes: 51 additions & 0 deletions
51
aides/python/buy_on_ebay_celery/.vscode/settings.default.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"workbench.colorTheme": "GitHub Dark Default", | ||
"workbench.iconTheme": "fira-code-material-minimal", | ||
"editor.fontFamily": "fira-code-nerd, FiraCode Nerd Font, Consolas, 'Courier New', monospace", | ||
"editor.fontLigatures": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"editor.unicodeHighlight.allowedLocales": { | ||
"ru": true, | ||
"uk": true | ||
}, | ||
|
||
"editor.accessibilitySupport": "off", | ||
"explorer.confirmDragAndDrop": false, | ||
"redhat.telemetry.enabled": true, | ||
"editor.unicodeHighlight.allowedCharacters": { | ||
"і": true | ||
}, | ||
"git.openRepositoryInParentFolders": "never", | ||
|
||
"typescript.tsserver.watchOptions": {}, | ||
|
||
"[dart]": { | ||
"editor.formatOnSave": true, | ||
"editor.formatOnType": true, | ||
"editor.rulers": [80], | ||
"editor.selectionHighlight": false, | ||
"editor.suggest.snippetsPreventQuickSuggestions": false, | ||
"editor.suggestSelection": "first", | ||
"editor.tabCompletion": "onlySnippets", | ||
"editor.wordBasedSuggestions": false | ||
}, | ||
"dart.openDevTools": "flutter", | ||
"dart.warnWhenEditingFilesOutsideWorkspace": false, | ||
"dart.showInspectorNotificationsForWidgetErrors": false, | ||
"dart.debugExternalPackageLibraries": true, | ||
"dart.debugSdkLibraries": true, | ||
|
||
"[python]": { | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "ms-python.black-formatter" | ||
}, | ||
|
||
"[env]": { | ||
"editor.defaultFormatter": "IronGeek.vscode-env" | ||
}, | ||
|
||
"files.associations": { | ||
".env": "env" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Buy on eBay | ||
|
||
The server for appraise purchase the items on eBay. | ||
|
||
Powered by [Celery & FastAPI](https://testdriven.io/courses/fastapi-celery/getting-started/). | ||
|
||
## Run | ||
|
||
Work into the Bash terminal. In VSCode bottom pane: open `Git Bash`. | ||
|
||
Run the commands below in the root foolder. | ||
|
||
### Activate the virtual environment | ||
|
||
#### Activate on Windows | ||
|
||
```cmd | ||
.\venv\Scripts\activate | ||
``` | ||
|
||
#### Linux | ||
|
||
### Install requirements | ||
|
||
```cmd | ||
pip install -r requirements.txt | ||
``` | ||
|
||
### Install & run Redis | ||
|
||
#### Install Redis on Windows | ||
|
||
[How do run Redis on Windows?](https://stackoverflow.com/questions/6476945/how-do-i-run-redis-on-windows) | ||
|
||
Start Ubuntu and typing: | ||
|
||
```cmd | ||
sudo apt-add-repository ppa:redislabs/redis | ||
``` | ||
|
||
```cmd | ||
sudo apt-get update | ||
``` | ||
|
||
```cmd | ||
sudo apt-get upgrade | ||
``` | ||
|
||
```cmd | ||
sudo apt-get install redis-server | ||
``` | ||
|
||
```cmd | ||
sudo service redis-server restart | ||
``` | ||
|
||
Check installation: | ||
|
||
```cmd | ||
set user:1 "Andrii" | ||
``` | ||
|
||
```cmd | ||
get user:1 | ||
``` | ||
|
||
### Run Redis on Windows | ||
|
||
Start Ubuntu. | ||
|
||
```cmd | ||
sudo service redis-server start | ||
``` | ||
|
||
### Run Celery server | ||
|
||
```cmd | ||
celery -A main.celery worker --loglevel=info | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from celery import Celery | ||
from fastapi import FastAPI | ||
|
||
app = FastAPI() | ||
|
||
# TIMEZONE = "US/Eastern" | ||
|
||
celery = Celery( | ||
__name__, | ||
broker="redis://127.0.0.1:6379/0", | ||
backend="redis://127.0.0.1:6379/0", | ||
) | ||
|
||
# celery.conf.timezone = TIMEZONE | ||
|
||
|
||
@app.get("/") | ||
def root(): | ||
return {"message": "Hello World"} | ||
|
||
|
||
@celery.task | ||
def divide(x, y): | ||
import time | ||
|
||
# print(f"{x} / {y} = ...") | ||
|
||
time.sleep(12) | ||
|
||
return x / y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
fastapi==0.79.0 | ||
uvicorn[standard]==0.18.2 | ||
celery==5.2.7 | ||
redis==4.3.4 | ||
tzdata==2023.3 | ||
flower==1.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@hostname = 127.0.0.1 | ||
@port = 8000 | ||
@host = {{hostname}}:{{port}} | ||
|
||
### | ||
|
||
GET http://{{host}}/ | ||
|
||
### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Buy on eBay FastAPI | ||
# Buy on eBay | ||
|
||
The server for appraise purchase the items on eBay. | ||
|
||
|