mirror of
https://github.com/Alexander-D-Karpov/akarpov
synced 2024-11-28 01:03:43 +03:00
Compare commits
5 Commits
2f008bcfbf
...
5fd8d7a217
Author | SHA1 | Date | |
---|---|---|---|
|
5fd8d7a217 | ||
cdec1efdef | |||
4dec3867ca | |||
773fd2830e | |||
1644fa5403 |
|
@ -12,7 +12,6 @@ https://git.akarpov.ru/sanspie/akarpov
|
||||||
### installation
|
### installation
|
||||||
```shell
|
```shell
|
||||||
$ poetry install & poetry shell
|
$ poetry install & poetry shell
|
||||||
$ ./spacy_setup.sh
|
|
||||||
$ python3 manage.py migrate
|
$ python3 manage.py migrate
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,8 @@ def extract_file_text(file: str) -> str:
|
||||||
try:
|
try:
|
||||||
rawdata = open(file, "rb").read()
|
rawdata = open(file, "rb").read()
|
||||||
enc = chardet.detect(rawdata)
|
enc = chardet.detect(rawdata)
|
||||||
with open(file, encoding=enc["encoding"]) as file:
|
with open(file, encoding=enc["encoding"]) as f:
|
||||||
text = file.read()
|
text = f.read()
|
||||||
except Exception:
|
except Exception:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from config.celery_app import app
|
from config.celery_app import app
|
||||||
|
|
||||||
|
|
||||||
def get_scheduled_tasks_name() -> [str]:
|
def get_scheduled_tasks_name() -> list[str]:
|
||||||
i = app.control.inspect()
|
i = app.control.inspect()
|
||||||
t = i.scheduled()
|
t = i.scheduled()
|
||||||
all_tasks = []
|
all_tasks = []
|
||||||
|
|
|
@ -52,10 +52,6 @@ COPY ./compose/local/django/start /start
|
||||||
RUN sed -i 's/\r$//g' /start
|
RUN sed -i 's/\r$//g' /start
|
||||||
RUN chmod +x /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
|
COPY ./compose/local/django/start-redirect /start-redirect
|
||||||
RUN sed -i 's/\r$//g' /start-redirect
|
RUN sed -i 's/\r$//g' /start-redirect
|
||||||
RUN chmod +x /start-redirect
|
RUN chmod +x /start-redirect
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
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 auth
|
||||||
python manage.py migrate
|
python manage.py migrate
|
||||||
python manage.py runserver_plus 0.0.0.0:8000
|
daphne config.asgi:application --port 8000 --bind 0.0.0.0
|
||||||
|
|
|
@ -4,8 +4,14 @@
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.asgi import get_asgi_application
|
from django.core.asgi import get_asgi_application
|
||||||
|
|
||||||
from akarpov.common.channels import HeaderAuthMiddleware
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
||||||
from config import routing
|
# 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
|
||||||
|
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
||||||
|
@ -14,7 +20,7 @@
|
||||||
|
|
||||||
application = ProtocolTypeRouter(
|
application = ProtocolTypeRouter(
|
||||||
{
|
{
|
||||||
"http": get_asgi_application(),
|
"http": django_asgi_app,
|
||||||
"websocket": HeaderAuthMiddleware(URLRouter(routing.websocket_urlpatterns)),
|
"websocket": HeaderAuthMiddleware(URLRouter(routing.websocket_urlpatterns)),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
@ -19,6 +19,7 @@ services:
|
||||||
- mailhog
|
- mailhog
|
||||||
- elasticsearch
|
- elasticsearch
|
||||||
volumes:
|
volumes:
|
||||||
|
- /var/www/media:/app/akarpov/media
|
||||||
- .:/app:z
|
- .:/app:z
|
||||||
env_file:
|
env_file:
|
||||||
- ./.envs/.local/.django
|
- ./.envs/.local/.django
|
||||||
|
@ -44,7 +45,7 @@ services:
|
||||||
- ./.envs/.local/.django
|
- ./.envs/.local/.django
|
||||||
- ./.envs/.local/.postgres
|
- ./.envs/.local/.postgres
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3025:3000"
|
||||||
command: /start-redirect
|
command: /start-redirect
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
|
|
1315
poetry.lock
generated
1315
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
|
@ -56,7 +56,7 @@ django-extensions = "^3.2.1"
|
||||||
django-coverage-plugin = "^3.0.0"
|
django-coverage-plugin = "^3.0.0"
|
||||||
pytest-django = "^4.5.2"
|
pytest-django = "^4.5.2"
|
||||||
gunicorn = "^21.2.0"
|
gunicorn = "^21.2.0"
|
||||||
sentry-sdk = "^1.25.1"
|
sentry-sdk = "^1.38.0"
|
||||||
django-anymail = {extras = ["mailgun"], version = "^10.1"}
|
django-anymail = {extras = ["mailgun"], version = "^10.1"}
|
||||||
django-polymorphic = "^3.1.0"
|
django-polymorphic = "^3.1.0"
|
||||||
django-jazzmin = "^2.6.0"
|
django-jazzmin = "^2.6.0"
|
||||||
|
@ -95,8 +95,6 @@ yt-dlp = "^2023.7.6"
|
||||||
pytube = "^15.0.0"
|
pytube = "^15.0.0"
|
||||||
urllib3 = ">=1.26"
|
urllib3 = ">=1.26"
|
||||||
requests = ">=2.25"
|
requests = ">=2.25"
|
||||||
spacy = {extras = ["lookups"], version = "^3.6.1"}
|
|
||||||
spacy-transformers = "^1.2.5"
|
|
||||||
extract-msg = "0.28.7"
|
extract-msg = "0.28.7"
|
||||||
pytest-factoryboy = "2.3.1"
|
pytest-factoryboy = "2.3.1"
|
||||||
pytest-xdist = "^3.3.1"
|
pytest-xdist = "^3.3.1"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user