- Install docker from the offical website.
- Change the end of line sequence of wait-for-mysql.sh from CRLF to LF in your text-editor.
- Make sure port 3306 is free on your machine. To close a certain port: windows, Ubuntu
- go into the root directory of the project.
- Run
docker-compose up --buildto build the project.
-
Fork the git repo to your profile.
-
Clone repository.
(https://usernname@stgit.dcs.gla.ac.uk/username/cs33-main.git) -
Add upstream to forked repo.
git remote add upstream https://stgit.dcs.gla.ac.uk/tp3-2020-CS33/cs33-main.git
-
Install virtualenv.
pip install virtualenv -
Create virtual environment.
virtualenv env --python=python3.8 -
Activate virtual environment.
source env/bin/activate -
Install requirements
python -m pip install -r requirements.txt
-
Install MySQL on your system.*
sudo apt-get install mysql-serversudo apt-get install libmysqlclient-dev -
Start MySQL, create new user and make a database.
sudo mysqlCREATE USER account_name IDENTIFIED BY 'password';GRANT ALL ON '%''.* TO 'account_name@'%''exit -
Login to your new mysql user.
mysql -u account_name -pCREATE DATABASE BusinessSimulator;exit -
Add
key.pyto the same directory as settings.pyclass Key: # Secret key to use for django settings SECRET_KEY = 'a long string of characters.' MYSQL_USERNAME = 'username' MYSQL_PASSWORD = 'password'
-
Activate virtual environment.
source env/bin/activate -
On master branch pull changes from upstream.
git fetch upstream -
Normal Django models stuff.
python manage.py makemigrationspython manage.py migrate -
Create new branch for feature.
git checkout -b new-feature-name -
Make changes locally.
-
Commit and push.
git add .git commit -m "Change made to feature"git push -
Visit your repository/branch online and click on 'Create new merge request'.
-
Ask Aaron to review and merge code.
*If error
Package mysql-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'mysql-server' has no installation candidate
This means that the linux distro requires a slightly different mysql bundle Follow steps:
- Remove any current mysql files and upgrade system:
sudo apt-get purge mysql-*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get dist-upgrade
sudo rm -rf /etc/mysql
sudo rm -rf /var/lib/mysql*
- Find versions available:
apt-cache search mysql-server - select the mysql-version available. e.g default-mysql-server
- Install the version available, e.g:
sudo apt-get install default-mysql-server - To get available clients
apt-cache search libmysqlclient-dev - install corresponding client e.g:
sudo apt-get install default-libmysqlclient-dev - Allow non root to run mysql:
sudo chown mysql.mysql /var/run/mysqld/ - Finally start the service:
systemctl restart mysql - View
systemctland you should see MySql as one of the running processes.