#### 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
-- "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
(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