Website for wisecitymbc 3.0. Brighter & better.
- Python >= 3.5.1
- Postgresql >= 9.4 (username: wisecity, password: 12345. Only for test)
$ [sudo -u postgres] createuser --pwprompt wisecity
$ [sudo -u postgres] createdb -Owisecity -Eutf8 app_wisecitymbc
Test:
$ [sudo -u postgres] psql app_wisecitymbc
# Install SCWS
wget http://www.xunsearch.com/scws/down/scws-1.2.2.tar.bz2
tar xvf scws-1.2.2.tar.bz2
cd scws-1.2.2
./configure
sudo make install
# Install postgresql-server-dev
# NOTICE: Use your own postgres version. Mine is 9.4
sudo apt-get install postgresql-server-dev-9.4
# Install zhparser
git clone https://github.com/amutu/zhparser.git
SCWS_HOME=/usr/local make
sudo make install
Alter user role:
[sudo -u postgres] psql -c "ALTER ROLE wisecity superuser;"
Checkout your config file location:
[sudo -u postgres] psql -c "show config_file"
Append the following lines to <config file>
:
zhparser.multi_short = t
zhparser.dict_in_memory = t
zhparser.punctuation_ignore = t
** Restart your postgres. **
Run initial operations:
./manage.py installdb
Install python virtual environment:
pyvenv .env
source .env/bin/activate
Install required python packages:
pip install -r requirements.txt
Install npm dependencies:
cd front-end && npm install
While constructing frontend modules, you should run cd front-end/ && webpack --watch
and ./manage.py runserver
first, and keep them running.
front-end/dest/
: contains compiled bundles included by the pages.front-end/entries/
: should ONLY contain entry scripts which will be compiled into bundles.front-end/components/
: should contain vue components.templates/
: contains template files for Django.
Checkout branch test-webpack for a detailed example.