Skip to content
Discussion board and q&a system
Python HTML JavaScript CSS
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
askapp
rules_light
siteprefs
tools
.gitignore
CNAME
LICENSE
README.md
_config.yml
manage.py
requirements.txt

README.md

Django based discussion board and a Q&A system

Steps to deploy a project:

  • git clone https://github.com/BanzaiTokyo/askapp.git <project_dir>
  • cd <project_dir>
  • sudo pip -r requirements.txt
  • create .env file with your credentials of format VARIABLE_NAME=VALUE. See list of variables below.
  • create database in MySQL
  • python manage.py migrate
  • python manage.py createsuperuser
  • python manage.py collectstatic
  • add a cron job python manage.py calculate_scores daily or hourly

Environment variables:

DB_HOST - database hostname
DB_DATABASE - database name
DB_USER, DB_PASSWORD - MySQL credentials
DB_PASSWORD - database user password
EMAIL_HOST - SMTP server address
EMAIL_ADDRESS, EMAIL_HOST_PASSWORD - SMTP credentials
GOOGLE_API_KEY - a key for Youtube API to pull description for Youtube videos```

### How to get Google API Key
There are numerous tutorials how to do that, for example
https://www.slickremix.com/docs/get-api-key-for-youtube/ or https://www.yotuwp.com/how-to-get-youtube-api-key/


## Peculiarities when deploying to a Django instance from Bitnami hosted on AWS
- DB_HOST is /opt/bitnami/mysql/tmp/mysql.sock, DB_USER=root, DB_PASSWORD is taken from https://docs.bitnami.com/aws/faq/get-started/find-credentials/
- python executable is named "python3" there
- cron job may look like "0  *  * * *   bitnami /bin/bash -c '. $HOME/.profile; python3 manage.py calculate_scores'"

#### Additional steps:
- cp ../Project/conf ./
- sed -i 's|Project/Project|<project_dir>/askapp|g' *
- sed -i 's|Project|<project_dir>|g' *
- sed -i 's|wsgi-djangostack |wsgi-djangostack user=bitnami group=bitnami|' conf/httpd-app.conf
- sudo echo Include \"$(readlink -f conf/httpd-prefix.conf)\" >> ~/stack/apache2/conf/bitnami/bitnami-apps-prefix.conf
- sudo /opt/bitnami/ctlscript.sh restart apache
- mkdir askapp/media
- sudo chmod 755 askapp/media
- mkdir -p /var/tmp/askapp_cache
You can’t perform that action at this time.