download the lastest code, go into the src path and run
$ docker-compose build
3 images are expected:
- Python 2.7 / Django 1.8
- Redis 3.0.7
- MySQL 5.7
Required:
- Python 2.7
- Redis 3.0.7
download the lastest code, go into the src path and run
pip install -r requirements.txt
use either MySQL or SQLite3
Env-with-Docker uses MySQL by default
$ docker-compose run backend /bin/bash
$ python manage.py migrate
$ python manage.py createsuperuser --username=admin [email protected]
# interactive input and output
# Password: (123)
# Password (again): (123)
# Superuser created successfully.
Env-without-Docker uses MySQL by default
run script in src path
./install.sh
-
without docker:
./run.sh
-
docker:
docker-compose up
-
go into docker
- go into docker:
docker-compose run backend /bin/bash
- run server:
./run.sh
- go into docker:
-
Backend basic testing
- operation: visit
127.0.0.1:8000
in browser - expection: home page is opened
- operation: visit
-
Redis Connection
- operation: visit
127.0.0.1:8000
in browser, and refresh it - expection:
I have been seen xxx times.
is shown and xxx increase by refreshing
- operation: visit
-
MySQL Connection
- operation: visit
127.0.0.1:8000/admin
in browser, login in by username / password - expection: logined and admin page is opened.
- operation: visit
$ python manage.py runscript crawler