Commit 03cb35c5 authored by Giorgos Kazelidis's avatar Giorgos Kazelidis

Used GitLab-flavored markdown to correct README.md layout

parent 5d8b0571
#### ENVIRONMENT SPECIFICATIONS ## ENVIRONMENT SPECIFICATIONS
* Working OS: Ubuntu 16.04 LTS * Working OS: Ubuntu 16.04 LTS
* Python version: 3.5.2 (pre-installed) * Python version: 3.5.2 (pre-installed)
* Git version: 2.7.4 * Git version: 2.7.4
...@@ -6,69 +6,68 @@ ...@@ -6,69 +6,68 @@
* virtualenv version: 15.2.0 * virtualenv version: 15.2.0
* Django version: 2.0.4 * Django version: 2.0.4
* MySQL server version: 5.7.22 * MySQL server version: 5.7.22
---
#### DOWNLOADING THE PROJECT & SETTING UP THE ENVIRONMENT ## DOWNLOADING THE PROJECT & SETTING UP THE ENVIRONMENT
(A) install pip3 (`pip3 --version` to see if it is already installed): (A) install pip3 (`pip3 --version` to see if it is already installed):
sudo apt-get install python3-pip sudo apt-get install python3-pip
(B) install virtualenv (`virtualenv --version` to see if it is already installed): (B) install virtualenv (`virtualenv --version` to see if it is already installed):
pip3 install virtualenv pip3 install virtualenv
(C\) install and configure Git [sources: (C\) install and configure Git [sources:
       -- "How To Install Git with Apt" and "How To Set Up Git" sections of https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-16-04       -- "How To Install Git with Apt" and "How To Set Up Git" sections of https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-16-04
       -- https://www.tutorialspoint.com/git/git_environment.htm       -- https://www.tutorialspoint.com/git/git_environment.htm
       ]:       ]:
       (1) install Git (`git --version` to see if it is already installed):       (1) install Git (`git --version` to see if it is already installed):
sudo apt-get install git sudo apt-get install git
       (2) set the Git "name" and "email" global parameters (`git config --list` to see if they have already been set):       (2) set the Git "name" and "email" global parameters (`git config --list` to see if they have already been set):
git config --global user.name "YOUR_NAME" git config --global user.name "YOUR_NAME"
git config --global user.email "YOUR_EMAIL" git config --global user.email "YOUR_EMAIL"
(D) create a local instance of the remote repository (userbase): (D) create a local instance of the remote repository (userbase):
       (1) navigate to Desktop:       (1) navigate to Desktop:
cd ~/Desktop cd ~/Desktop
       (2) clone the repository to create the corresponding instance locally:       (2) clone the repository to create the corresponding instance locally:
git clone https://git.softlab.ntua.gr/giorgkazelidis/userbase.git git clone https://git.softlab.ntua.gr/giorgkazelidis/userbase.git
       (3) navigate to the local instance:       (3) navigate to the local instance:
cd userbase cd userbase
(E) install Django and MySQL inside the local instance using virtualenv with Python 3 [sources: (E) install Django and MySQL inside the local instance using virtualenv with Python 3 [sources:
       -- steps 2 and 3 of https://help.dreamhost.com/hc/en-us/articles/215317948-How-to-install-Django-using-virtualenv       -- steps 2 and 3 of https://help.dreamhost.com/hc/en-us/articles/215317948-How-to-install-Django-using-virtualenv
       -- step 3 of https://www.digitalocean.com/community/tutorials/how-to-create-a-django-app-and-connect-it-to-a-database       -- step 3 of https://www.digitalocean.com/community/tutorials/how-to-create-a-django-app-and-connect-it-to-a-database
       -- end of section http://docs.python-guide.org/en/latest/dev/virtualenvs/#lower-level-virtualenv       -- end of section http://docs.python-guide.org/en/latest/dev/virtualenvs/#lower-level-virtualenv
       -- https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-16-04       -- https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-16-04
       -- "Create a MySQL Database" section of http://www.marinamele.com/taskbuster-django-tutorial/install-and-configure-mysql-for-django       -- "Create a MySQL Database" section of http://www.marinamele.com/taskbuster-django-tutorial/install-and-configure-mysql-for-django
       -- https://www.tutorialspoint.com/django/django_admin_interface.htm       -- https://www.tutorialspoint.com/django/django_admin_interface.htm
       ]:       ]:
       (1) specify the full file path (/usr/bin/python3) to the installed Python version:       (1) specify the full file path (/usr/bin/python3) to the installed Python version:
which python3 which python3
       (2) create the virtual environment (venv) and specify the desired Python version to be used:       (2) create the virtual environment (venv) and specify the desired Python version to be used:
virtualenv ~/Desktop/userbase/venv -p /usr/bin/python3 virtualenv ~/Desktop/userbase/venv -p /usr/bin/python3
       (3) activate the virtual environment:       (3) activate the virtual environment:
source venv/bin/activate source venv/bin/activate
       (4) install necessary Python and MySQL development headers and libraries (if you have not already done so):       (4) install necessary Python and MySQL development headers and libraries (if you have not already done so):
sudo apt-get install python3-dev libmysqlclient-dev sudo apt-get install python3-dev libmysqlclient-dev
       (5) install appropriate versions of virtual-environment-specific packages:       (5) install appropriate versions of virtual-environment-specific packages:
pip install -r requirements.txt pip install -r requirements.txt
             ALTERNATIVELY, you could install the packages (Django and MySQL Database Connector - mysqlclient) individually by typing the following:            ALTERNATIVELY, you could install the packages (Django and MySQL Database Connector - mysqlclient) individually by typing the following:
pip install Django==2.0.4 pip install Django==2.0.4
pip install mysqlclient pip install mysqlclient
       (6) install MySQL server (`mysql --version` to see if it is already installed):        (6) install MySQL server (`mysql --version` to see if it is already installed):
              * WARNING: while installing MySQL server, you will be asked to set the password for the root user.              * WARNING: while installing MySQL server, you will be asked to set the password for the root user.
sudo apt-get install mysql-server sudo apt-get install mysql-server
mysql_secure_installation mysql_secure_installation
       (7) use the password that was set for the root user during MySQL server installation as the 'PASSWORD' value of the 'default' dictionary of the DATABASES dictionary in **~/Desktop/userbase/myprj/myprj/settings.py**        (7) use the password that was set for the root user during MySQL server installation as the 'PASSWORD' value of the 'default' dictionary of the DATABASES dictionary in **~/Desktop/userbase/myprj/myprj/settings.py**
       (8) if you have not created the project database (usermergeDB) yet, open MySQL console with root privileges (you should provide the password that was set for the root user during MySQL server installation), create the project database and exit MySQL console:        (8) if you have not created the project database (usermergeDB) yet, open MySQL console with root privileges (you should provide the password that was set for the root user during MySQL server installation), create the project database and exit MySQL console:
mysql -u root -p (ALTERNATIVELY: python manage.py dbshell) mysql -u root -p (ALTERNATIVELY: python manage.py dbshell)
...@@ -80,17 +79,8 @@ ...@@ -80,17 +79,8 @@
       (10) deactivate the virtual environment:        (10) deactivate the virtual environment:
deactivate deactivate
---
#### UPDATING THE PROJECT ## RUNNING THE PROJECT (INSIDE THE VIRTUAL ENVIRONMENT)
Provided you have already downloaded the (source code of the) project (that is, you have followed the steps of the "DOWNLOADING THE PROJECT & SETTING UP THE ENVIRONMENT" section above), the recommended steps to update the (source code of the) project are:
       (1) delete the local instance of the remote repository (userbase) as well as the virtual environment:
rm -rf ~/Desktop/userbase
       (2) follow steps (D) and (E) of the "DOWNLOADING THE PROJECT & SETTING UP THE ENVIRONMENT" section above
---
#### RUNNING THE PROJECT (INSIDE THE VIRTUAL ENVIRONMENT):
(A) activate the virtual environment: (A) activate the virtual environment:
cd ~/Desktop/userbase cd ~/Desktop/userbase
...@@ -103,10 +93,16 @@ Provided you have already downloaded the (source code of the) project (that is, ...@@ -103,10 +93,16 @@ Provided you have already downloaded the (source code of the) project (that is,
python manage.py runserver python manage.py runserver
(D) navigate to http://127.0.0.1:8000/ via web browser to run the project (D) navigate to http://127.0.0.1:8000/ via web browser to run the project
--- ## STOPPING THE PROJECT (AND EXITING THE VIRTUAL ENVIRONMENT)
#### STOPPING THE PROJECT (AND EXITING THE VIRTUAL ENVIRONMENT): (A) stop the Django development server (running at http://127.0.0.1:8000/):
(A) stop the Django development server (running at http://127.0.0.1:8000/):        -- return to the terminal where you have run `python manage.py runserver` and press `Ctrl-C`
       -- return to the terminal where you have run `python manage.py runserver` and press "Ctrl-C"
(B) deactivate the virtual environment: (B) deactivate the virtual environment:
deactivate deactivate
## UPDATING THE PROJECT
Provided you have already downloaded the (source code of the) project (that is, you have followed the steps of the "DOWNLOADING THE PROJECT & SETTING UP THE ENVIRONMENT" section above), the recommended steps to update the (source code of the) project are:
       (1) delete the local instance of the remote repository (userbase) as well as the virtual environment:
rm -rf ~/Desktop/userbase
       (2) follow steps (D) and (E) of the "DOWNLOADING THE PROJECT & SETTING UP THE ENVIRONMENT" section above
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment