Solve Chinese characters like riddles.
jiezi/
django main appaccounts/
app manages theUser
model and its basic information.content/
app manages the data created by our content team, i.e. theCharacter
,Radical
, andCharacterSet
models. The data can be updated and synchronized from content team's Google Drive by staff when needed.learning
app implements our learning algorithm, see the wiki page for detailclassroon
app manages theStudent
,Class
, andTeacher
models and their interactions within a classroom setting.static/
&templates/
for front end use
We are now using Django REST Framework's self-browsable API served at https://solvedchinese.org/api_root. You can also test it locally in your development server.
this is supposed to be done on a Ubuntu machine
- clone this repo
git clone [email protected]:solved-chinese/app.git
- Create a conda environment using the
env.yaml
file in project root and activate it:
conda env create -f env.yaml
conda activate jiezi
- Setup PostgresSQL:
install PostgresSQL https://www.postgresql.org/download/linux/ubuntu/
setup the database to match
jiezi.settings.DATABASES
:
sudo -u postgres psql
postgre# \password postgres (use this to change the password of postgres to 'jiezi')
-
Create your own secret files:
- Generate your own django secret_key, in python:
from django.core.management.utils import get_random_secret_key get_random_secret_key() # the returned value is your secret key
- Create
jiezi_secret/secret.py
using your secret key:
"""This file is suppose to keep secret variables """ SECRET_KEY = 'YOUR_SECRET_KEY' # This should store jiezi_secret or local database, and it will update setting # DATABASES (you may override default database if necessary) DATABASES = { }
- get
jiezi_secret/datafile_service_account.json
from us, this is used to access our google drive data
-
Make the required migrations
python manage.py migrate
-
For the setup of Celery and Redis, reference wiki page Note that Celery doesn't work with Windows!
-
Locally run the development server
python manage.py runserver