Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update README.MD (#56) #57

Merged
merged 1 commit into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .envexample
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ DEBUG=False
TIME_ZONE=Europe/Moscow
LANGUAGE_CODE=ru-RU
ALLOWED_HOSTS=localhost,127.0.0.1,
CORS_ALLOWED_ORIGINS=localhost,127.0.0.1,
CORS_ALLOWED_ORIGINS=http://localhost:8000,http://localhost:3000,
USE_POSTGRESQL=False
DB_NAME=ipr
DB_HOST=db
Expand Down
39 changes: 27 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,37 @@
![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white)
![Nginx](https://img.shields.io/badge/nginx-%23009639.svg?style=for-the-badge&logo=nginx&logoColor=white)

TO-DO: Описание проекта.
![Main page](./docs/pics/main_page.png)

## [Репозиторий Frontend](https://github.com/NataliyaNikulshina/ipr-hackathon-yandex-alfa)
Проект для отслеживания индивидуальных планов развития.\
Сделан командой № 8 в рамках хакатона Яндекс-Практикума и Альфа-Банка.\
Для ознакомления, проект временно [доступен на сервере](https://ipr.ddns.net/), для входа используйте [эти аккаунты](./docs/authorization.md).

## Документация API
## [Ссылка на репозиторий Frontend](https://github.com/NataliyaNikulshina/ipr-hackathon-yandex-alfa)

## Запуск проекта

### 1. Требуется заполнить `.env` файл

Пример адреса на запущенном сервере:
- пример заполнения находится в `.envexample`

- <http://127.0.0.1:8000/api/v1/swagger/>
- <http://127.0.0.1:8000/api/v1/redoc/>
### 2. Запуск проекта

- Весь проект, используя docker: `docker compose up`
- Проект будет доступен по адресу `localhost:8080`
- Локальный запуск бэкенда:
- Перейти в папку со скопированным проектом
- Создание __venv__ `python -m venv venv`
- Установка зависимостей `pip install -r requirements.txt`
- Запуск сервера разработки `python manage.py runserver`

### 3. [Загрузка фикстур в БД](docs/authorization.md) - _Опционально_

## Документация API

- Документация на сервере: [Swagger](https://ipr.ddns.net/api/v1/schema/swagger-ui/), [ReDoc](https://ipr.ddns.net/api/v1/schema/redoc/)
- Скриншоты Swagger: [Развернутый](./docs/pics/doc_full_size.png), [Не развернутый](./docs/pics/doc.png)
- Документация на запущенном локально сервере: [Swagger](http://127.0.0.1:8000/api/v1/schema/swagger-ui/), [ReDoc](http://127.0.0.1:8000/api/v1/schema/redoc/)

## Используемые библиотеки и зависимости

Expand All @@ -43,12 +64,6 @@ TO-DO: Описание проекта.
- В начале требует активации хуков `pre-commit install`
- Далее будет запускаться при попытке сделать commit или при запуске `pre-commit`

## Запуск проекта

### 1. Требуется заполнить `.env` файл, пример заполнения находится в `.envexample`

### 2. [Загрузка фикстур в БД](docs/authorization.md) - _Опционально_

## Авторы

- [Miron Sadykov](https://github.com/Reagent992)
Expand Down
21 changes: 6 additions & 15 deletions api/v1/views/users_view.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from django.conf import settings
from django.db.models import F, Value
from django.db.models.functions import Coalesce, Concat
from django_filters.rest_framework import DjangoFilterBackend
Expand Down Expand Up @@ -43,20 +42,12 @@ class UserViewSet(UserViewSetFromDjoser):
filters.SearchFilter,
OrderingFilter,
)
if settings.USE_POSTGRESQL: # TODO: Проверить.
search_fields = (
"@last_name",
"@first_name",
"@patronymic",
"@position__name",
)
else:
search_fields = (
"last_name",
"first_name",
"patronymic",
"position__name",
)
search_fields = (
"last_name",
"first_name",
"patronymic",
"position__name",
)
serializer_class = CustomUserSerializer
http_method_names = ["get", "head", "options"]
ordering_fields = ("full_name", "position_name")
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ services:
- static:/app/static
- media:/app/media
- nginx_conf:/app/nginx/
- ./django_logs.log:/app/log_file.log
frontend:
image: reamisd/frontend_ipr:latest
env_file: .env
Expand Down
Binary file added docs/pics/doc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pics/doc_full_size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pics/main_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading