Be pedantic about readme.md
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
## Installation with docker
|
||||
|
||||
### installing docker
|
||||
### Installing docker
|
||||
|
||||
install docker and docker-compose. On ubuntu this can be done with
|
||||
Install docker and docker-compose. On ubuntu this can be done with
|
||||
|
||||
```BASH
|
||||
sudo apt-get install docker docker-compose
|
||||
@@ -14,50 +14,53 @@ sudo apt-get install docker docker-compose
|
||||
|
||||
```BASH
|
||||
sudo docker-compose up db
|
||||
# then configure following with another shell window
|
||||
sudo docker exec -ti <image_name> bash # image name can be found with sudo docker ps (propably web20_db_1)
|
||||
mysql -u root -p # then enter root password which is in docker-compose.yml
|
||||
|
||||
```
|
||||
|
||||
Then configure following with another shell window
|
||||
```BASH
|
||||
sudo docker exec -ti <image_name> bash # image name can be found with sudo docker ps (probably web20_db_1)
|
||||
mysql -u root -p # then enter root password which can be found in docker-compose.yml
|
||||
```
|
||||
|
||||
```SQL
|
||||
CREATE USER 'sik'@'%' IDENTIFIED BY 'password123';
|
||||
CREATE DATABASE sik DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
|
||||
GRANT ALL PRIVILEGES ON `sik\_%` . * TO 'sik'@'%' IDENTIFIED BY 'password123';
|
||||
GRANT ALL PRIVILEGES ON sik.* TO 'sik'@'%';
|
||||
```
|
||||
Then ctrl-d away from docker bash shell and shutdown db image with ctrl-c
|
||||
Then CTRL-D away from Docker bash shell and shut down database image with CTRL-C.
|
||||
|
||||
### Windows specific stuff
|
||||
|
||||
1. sudo is naturally not needed before any command on a windows environment
|
||||
2. before configuring web-image, click on taskbars docker icons. and from shared drives share the drive repository is on
|
||||
1. `sudo` is naturally not needed before any command on a windows environment
|
||||
2. Before configuring the web image, click on the taskbar docker icon. Activate "shared drives" -> "share the drive repository".
|
||||
|
||||
|
||||
### Configuring web-image
|
||||
### Configuring web image
|
||||
|
||||
1. Copy settings-sample.py to settings.py on sikweb folder.
|
||||
2. configure atleast following settings
|
||||
- dbsettings: use 'db' as host and correct user and password (configured above)
|
||||
3. run following commands
|
||||
1. Copy settings-sample.py to settings.py in sikweb folder.
|
||||
2. Configure at least the following settings
|
||||
- dbsettings: use 'db' as host and correct user and password (configured above)
|
||||
3. Run the following commands:
|
||||
|
||||
```BASH
|
||||
sudo docker-compose run web python manage.py migrate
|
||||
sudo docker-compose run web python manage.py makemigrations infoscreen members
|
||||
sudo docker-compose run web python manage.py makemigrations infoscreen members webapp
|
||||
sudo docker-compose run web python manage.py migrate
|
||||
sudo docker-compose run web python manage.py createsuperuser
|
||||
```
|
||||
|
||||
### starting dev unit
|
||||
### Starting the dev unit
|
||||
|
||||
```
|
||||
sudo docker-compose up
|
||||
```
|
||||
|
||||
now you should have dev environment running on localhost:8000
|
||||
Now you should have a dev environment running on localhost:8000
|
||||
|
||||
NOTE: as your working dir (web2.0) is mounted by images changes will be reflected immediately. no rebuilding needed. migrations and makemigrations must still be run separately though. see examples above
|
||||
NOTE: As your working directory (web2.0) is mounted by images, changes will be reflected immediately: no rebuilding is needed. `migrate` and `makemigrations` must still be run separately. See examples above.
|
||||
|
||||
|
||||
## Installation to python virtual env
|
||||
## Installation with python virtualenv
|
||||
|
||||
### Create a virtual environment for python
|
||||
|
||||
|
||||
Reference in New Issue
Block a user