Pārlūkot izejas kodu

Update README.md for development environment

Mohidul Islam 5 gadi atpakaļ
vecāks
revīzija
8ee1992421
2 mainītis faili ar 53 papildinājumiem un 2 dzēšanām
  1. 51 1
      README.md
  2. 2 1
      review/model_pred_report.py

+ 51 - 1
README.md

@@ -1 +1,51 @@
-# ER Care24 review automation.
+# Byte Trek Reputation Management
+
+## Installation:
+
+### 1. Clone The reporsitory
+```bash
+➜  git clone http://bytetrek.com:30000/ByteTrek-Projects/review-automation-backend.git
+```
+
+### 2. Create a virtual environment and active it.
+```bash
+➜  python3 -m venv env
+➜  source env/bin/activate
+```
+
+### 3. Create a mysql database and import the .sql file
+```bash
+(env) ➜  mysql -u root -h localhost -p                 # mysql -u user -h host -p
+mysql> CREATE DATABASE review_automation;
+mysql> SHOW DATABASES;                                 # Make sure database is created or not.
+exit                                                   # Exit out of the mysql prompt
+(env) ➜  mysql -u root -p review_automation < review_automation.sql
+# Make sure everything is just fine.
+(env) ➜  mysql -u root -h localhost -p
+mysql> USE review_automation;
+mysql> SHOW TABLES;
+```
+
+### 4. Run the development server
+```bash
+(env) ➜ python manage.py runserver
+```
+
+### 5. Add all corn jobs
+```bash
+(env) ➜ python manage.py crontab add
+# Make sure corn job has added successfully
+(env) ➜ crontab -l                                     # Return list of cronjobs
+```
+
+### 6. Some usefull management command
+- Store all un-recorded reviews to the database.
+    ```bash
+    (env) ➜ python manage.py collect_reviews
+    ```
+- Get model prediction report.
+    ```bash
+    (env) ➜ python manage.py model_report n_days
+    # Example for last 30 days:
+    (env) ➜ python manage.py model_report 30
+    ```

+ 2 - 1
review/model_pred_report.py

@@ -3,12 +3,13 @@ import json
 import requests
 from difflib import SequenceMatcher
 from django.utils import timezone
+from django.conf import settings
 
 from .models import Review, CustomReply
 
 
 # constants
-nlu_server_url = 'http://localhost:5005'
+nlu_server_url = settings.NLU_SERVER_URI
 replies = CustomReply.objects.all()