mirror of
https://github.com/Alexander-D-Karpov/akarpov
synced 2024-11-24 07:53:42 +03:00
Compare commits
1 Commits
5fd8d7a217
...
2f008bcfbf
Author | SHA1 | Date | |
---|---|---|---|
|
2f008bcfbf |
|
@ -12,6 +12,7 @@ https://git.akarpov.ru/sanspie/akarpov
|
|||
### installation
|
||||
```shell
|
||||
$ poetry install & poetry shell
|
||||
$ ./spacy_setup.sh
|
||||
$ python3 manage.py migrate
|
||||
```
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@ def extract_file_text(file: str) -> str:
|
|||
try:
|
||||
rawdata = open(file, "rb").read()
|
||||
enc = chardet.detect(rawdata)
|
||||
with open(file, encoding=enc["encoding"]) as f:
|
||||
text = f.read()
|
||||
with open(file, encoding=enc["encoding"]) as file:
|
||||
text = file.read()
|
||||
except Exception:
|
||||
return ""
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from config.celery_app import app
|
||||
|
||||
|
||||
def get_scheduled_tasks_name() -> list[str]:
|
||||
def get_scheduled_tasks_name() -> [str]:
|
||||
i = app.control.inspect()
|
||||
t = i.scheduled()
|
||||
all_tasks = []
|
||||
|
|
|
@ -52,6 +52,10 @@ COPY ./compose/local/django/start /start
|
|||
RUN sed -i 's/\r$//g' /start
|
||||
RUN chmod +x /start
|
||||
|
||||
COPY ./compose/local/django/spacy_setup /spacy_setup
|
||||
RUN sed -i 's/\r$//g' /spacy_setup
|
||||
RUN chmod +x /spacy_setup
|
||||
|
||||
COPY ./compose/local/django/start-redirect /start-redirect
|
||||
RUN sed -i 's/\r$//g' /start-redirect
|
||||
RUN chmod +x /start-redirect
|
||||
|
|
3
compose/local/django/spacy_setup
Executable file
3
compose/local/django/spacy_setup
Executable file
|
@ -0,0 +1,3 @@
|
|||
python -m spacy download en_core_web_lg
|
||||
python -m spacy download xx_sent_ud_sm
|
||||
python -m spacy download ru_core_news_lg
|
|
@ -7,4 +7,4 @@ set -o nounset
|
|||
|
||||
python manage.py migrate auth
|
||||
python manage.py migrate
|
||||
daphne config.asgi:application --port 8000 --bind 0.0.0.0
|
||||
python manage.py runserver_plus 0.0.0.0:8000
|
||||
|
|
|
@ -4,14 +4,8 @@
|
|||
from django.conf import settings
|
||||
from django.core.asgi import get_asgi_application
|
||||
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
||||
# Initialize Django ASGI application early to ensure the AppRegistry
|
||||
# is populated before importing code that may import ORM models.
|
||||
django_asgi_app = get_asgi_application()
|
||||
|
||||
|
||||
from akarpov.common.channels import HeaderAuthMiddleware # noqa
|
||||
from config import routing # noqa
|
||||
from akarpov.common.channels import HeaderAuthMiddleware
|
||||
from config import routing
|
||||
|
||||
if settings.DEBUG:
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
||||
|
@ -20,7 +14,7 @@
|
|||
|
||||
application = ProtocolTypeRouter(
|
||||
{
|
||||
"http": django_asgi_app,
|
||||
"http": get_asgi_application(),
|
||||
"websocket": HeaderAuthMiddleware(URLRouter(routing.websocket_urlpatterns)),
|
||||
}
|
||||
)
|
||||
|
|
|
@ -19,7 +19,6 @@ services:
|
|||
- mailhog
|
||||
- elasticsearch
|
||||
volumes:
|
||||
- /var/www/media:/app/akarpov/media
|
||||
- .:/app:z
|
||||
env_file:
|
||||
- ./.envs/.local/.django
|
||||
|
@ -45,7 +44,7 @@ services:
|
|||
- ./.envs/.local/.django
|
||||
- ./.envs/.local/.postgres
|
||||
ports:
|
||||
- "3025:3000"
|
||||
- "3000:3000"
|
||||
command: /start-redirect
|
||||
|
||||
postgres:
|
||||
|
|
1297
poetry.lock
generated
1297
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
|
@ -95,6 +95,8 @@ yt-dlp = "^2023.7.6"
|
|||
pytube = "^15.0.0"
|
||||
urllib3 = ">=1.26"
|
||||
requests = ">=2.25"
|
||||
spacy = {extras = ["lookups"], version = "^3.6.1"}
|
||||
spacy-transformers = "^1.2.5"
|
||||
extract-msg = "0.28.7"
|
||||
pytest-factoryboy = "2.3.1"
|
||||
pytest-xdist = "^3.3.1"
|
||||
|
|
Loading…
Reference in New Issue
Block a user