File translator used Google Translator API
- Python 3.x
pip install Django
pip install bootstrap4
pip install django-background-tasks
pip install google-cloud-translate
pip install django-bootstrap4
pip install lxml
pip install environ
pip install django-crontab
pip install python-dateutil
pip install 'git+https://github.com/takatsugu-kato/MasuDa.git'
- Okapi
- Java 1.8
- supervisor
- Optional
Set the PATH
python3 manage.py migrate
python3 manage.py createsuperuser
python3 manage.py collectstatic
python3 manage.py crontab add
chmod 766 db.sqlite3
mkdir media
mkdir log
yum install supervisor
sudo vi /etc/supervisord.d/process_tasks.ini
[program:process_tasks]
command=python3 /home/<username>/kon_nyaku/manage.py process_tasks
user=<username>
autostart=true
autorestart=true
environment=PATH="<okapi path>:/usr/bin:$(ENV_PATH)s"
stdout_logfile=/var/log/supervisor/jobs/process_tasks.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=5
stdout_capture_maxbytes=1MB
redirect_stderr=true
sudo service supervisord start
sudo systemctl enable supervisord.service
See this site.
#run background tasks
python manage.py process_tasks
#run server
python manage.py runserver
If model is changes, you should run the following command.
python manage.py makemigrations
python manage.py migrate
See this site
If static files are changes, you should run the following command.
python manage.py collectstatic
If model is changes, you should run the following command.
python3 manage.py migrate
sudo service supervisord restart
Change /etc/sysconfig/httpd
file to above
LANG='ja_JP.UTF-8'
LC_ALL='ja_JP.UTF-8'
For more information, see this site