Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
estvita committed Oct 8, 2024
1 parent d61e0b0 commit 6437116
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 21 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pip install -r requirements/production.txt
cp docs/example/env_example .env
nano .env
заменить ALLOWED_HOSTS, CSRF_TRUSTED_ORIGINS на свои значения
Заменить значение DATABASE_URL на свое значение (база psql должна быть предварительно создана)
python manage.py migrate
python manage.py collectstatic
Expand All @@ -36,7 +37,7 @@ python manage.py createsuperuser
python manage.py runserver 0.0.0.0:8000 (для тестирования и отладки)
```
После запуска сервера в файле .env будет создан ADMIN_URL, который необходимо исопльзовать для входа в админку
Путь по умолчанию для входа в админку /admin. Чтобы задать свой путь измените значение переменной DJANGO_ADMIN_URL в .env

## База данных
Модуль [DJ-Database-URL](https://github.com/jazzband/dj-database-url?tab=readme-ov-file#url-schema) позволяет подключать различные базы. См документацию по ссылке.
Expand Down
5 changes: 3 additions & 2 deletions docs/bitrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
![alt text](img/token.png)

+ В разделе Sites переименуйте example.com в домен по котрому будет доступен thoth
+ Bitrix > Apps - добавить приложение. Заполнить имя (waba, olx) и выбрать домен, установить чекбокс "Connector", Скопировать Id
+ Bitrix > Apps - добавить приложение. Заполнить имя (waba, olx) и выбрать домен, установить чекбокс "Connector"
+ После сохранения записи скопировать Id, который отображается в списке приложений.

+ В Битрикс24 создайте серверное локальное приложение без интерфейса (Приложения – Разработчикам – Другое – Локальное приложение) в Битрикс24 и заполните соответствующие поля (Путь вашего обработчика и Путь для первоначальной установки)
+ Необходимые права (Настройка прав): crm,imopenlines,contact_center,user,messageservice,im,imconnector,disk
+ Необходимые права (Настройка прав): crm, imopenlines, contact_center, user, messageservice, im, imconnector, disk
```
url установки https://example.com/api/bitrix/?api-key=XXXXXXX&app-id=YYYYYYY
Expand Down
2 changes: 1 addition & 1 deletion docs/waba.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
+ В админке THOTH - WABA - Add waba
+ + name - имя вашего приложения
+ + Access token - Постоянный или временный маркер
+ + Verify token - скопируйте
+ + После сохранения в списке WABA скопируйте Verify token для нужной учётки

+ На портале разработчиков - Quickstart > Configuration >
+ + Callback URL - https://example.com/api/waba/?api-key=XXXXXXX
Expand Down
3 changes: 2 additions & 1 deletion requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

Werkzeug[watchdog]==3.0.3 # https://github.com/pallets/werkzeug
ipdb==0.13.13 # https://github.com/gotcha/ipdb
psycopg[c]==3.2.1 # https://github.com/psycopg/psycopg
# psycopg[c]==3.2.1 # https://github.com/psycopg/psycopg
psycopg2-binary
watchfiles==0.21.0 # https://github.com/samuelcolvin/watchfiles

# Testing
Expand Down
3 changes: 2 additions & 1 deletion requirements/production.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
-r base.txt

gunicorn==23.0.0 # https://github.com/benoitc/gunicorn
psycopg[c]==3.2.1 # https://github.com/psycopg/psycopg
# psycopg[c]==3.2.1 # https://github.com/psycopg/psycopg
psycopg2-binary

# Django
# ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions thoth/bitrix/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
from .models import App, AppInstance, Bitrix, Line, FAQ



@admin.register(App)
class AppAdmin(admin.ModelAdmin):
list_display = ("name", "id", "site")
search_fields = ("name",)
fields = ("id", "connector", "site", "name", "client_id", "client_secret")
readonly_fields = ("id",)
fields = ("connector", "site", "name", "client_id", "client_secret")


@admin.register(AppInstance)
Expand Down
20 changes: 10 additions & 10 deletions thoth/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@
<!-- Your stuff: Third-party javascript libraries go here -->
<!-- place project specific Javascript in this file -->
<script defer src="{% static 'js/project.js' %}"></script>

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-33XNMJS79W"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-33XNMJS79W');
</script>
{% endblock javascript %}
</head>

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-33XNMJS79W"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-33XNMJS79W');
</script>

<body class="{% block bodyclass %}{% endblock bodyclass %}">
{% block body %}
Expand Down
3 changes: 1 addition & 2 deletions thoth/waba/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
@admin.register(Waba)
class WabaAdmin(admin.ModelAdmin):
list_display = ("name", "verify_token", "owner")
fields = ("name", "verify_token", "access_token", "owner")
readonly_fields = ("verify_token",)
fields = ("name", "access_token", "owner")


@admin.register(Phone)
Expand Down

0 comments on commit 6437116

Please sign in to comment.