From d2d0fcca0ba880e921faaad0f9b3edb4201bef55 Mon Sep 17 00:00:00 2001 From: jardiamj <1088732+jardiamj@users.noreply.github.com> Date: Sat, 23 Oct 2021 10:54:01 -0700 Subject: [PATCH 1/3] Updated README file with Linux set up instructions --- README.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c70ee43..d96d6d7 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,43 @@ Run 'python manage.py migrate' to apply them.` you can ignore them for now. - [ ] Quit the server by either closing the terminal window or running `Control C` on macOS ## Linux -//TODO +- [ ] Install Python 3 if you don't already have it (Python 3 ships with pip): + - Debian based distros: `sudo apt install python3` + - RedHat based: `sudo dnf install python3` or `sudo yum install python3` +- [ ] Install pipenv in the terminal to manage dependencies: `pip3 install pipenv` +- [ ] For whichever IDE you're using, install whichever extensions are needed to develop Python applications +- [ ] Clone the project to your computer: `git clone https://github.com/NSC-Computer-Science-Club/converger_app.git` +- [ ] Move into the project's directory: `cd converger_app` +- [ ] Create a virtual environment for the project (that uses Python 3): `pipenv --three` +- [ ] Take note of the location of your virtual environment, look for this line in the output: + - `virtualenv location: /home/jardi/.local/share/virtualenvs/converger_app-UaPtKjcA` +- [ ] You can always get the location of your virtual environment by running `pipenv --venv` +- [ ] Now, it's time to activate your virtual environment. You will install your depencies in it. + - Run: `source /bin/activate` (append /bin/activate to your virtual environment's path). +- [ ] Your prompt will change to `(converger_app) username@hostname` indicating that you are now working within you virtual environment. +- [ ] Install Django: `pip3 install django` +- [ ] Run the server: `python3 manage.py runserver` +- [ ] On you browser visit `http://127.0.0.1:8000/` to see your Django ap. +- [ ] If you see a warning about unapplied migrations: `You have unapplied migrations; your app may not work properly until they are applied.` + - Run 'python manage.py migrate' to apply them.` you can ignore them for now. +- [ ] Quit the server by either closing the terminal window or pressing `Control + C`. +- [ ] To deactivate the virtual environment run: `deactivate` + +### Creating an alias for activating your virtual environment + +Typing `source /home/jardi/.local/share/virtualenvs/converger_app-UaPtKjcA/bin/activate` every time +I want to work withing that virtual environment gets a little tiring (even with autocomplete). +It might be a good idea to create an alias for it in your `~/.bashrc` file, to append a line +with an alias for that command to your `.bashrc` file do: + - `echo "alias activate_converger_app='source /bin/activate'" >> ~/.bashrc` + - Nota bene: Make sure you use two greather than symbols `>>` in that command because using only one will overwrite your .bashrc + +The alias will be available the next time you open a bash session (open a terminal). If you want to have it +in your current session you will need to source the .bashrc script: `source ~/.bashrc` + +Then: +- To activate the virtual environment run: `activate_converger_app` +- To deactivate the virtual environment run: `deactivate` ## Windows //TODO From d75d290c6ea61270e17f4855db4f843fd1a79c3c Mon Sep 17 00:00:00 2001 From: jardiamj <1088732+jardiamj@users.noreply.github.com> Date: Sat, 23 Oct 2021 10:59:53 -0700 Subject: [PATCH 2/3] Fixed bullet points and some typos --- README.md | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index d96d6d7..48fdcb8 100644 --- a/README.md +++ b/README.md @@ -21,27 +21,30 @@ Run 'python manage.py migrate' to apply them.` you can ignore them for now. - [ ] Quit the server by either closing the terminal window or running `Control C` on macOS ## Linux -- [ ] Install Python 3 if you don't already have it (Python 3 ships with pip): +- Install Python 3 if you don't already have it (Python 3 ships with pip): - Debian based distros: `sudo apt install python3` - RedHat based: `sudo dnf install python3` or `sudo yum install python3` -- [ ] Install pipenv in the terminal to manage dependencies: `pip3 install pipenv` -- [ ] For whichever IDE you're using, install whichever extensions are needed to develop Python applications -- [ ] Clone the project to your computer: `git clone https://github.com/NSC-Computer-Science-Club/converger_app.git` -- [ ] Move into the project's directory: `cd converger_app` -- [ ] Create a virtual environment for the project (that uses Python 3): `pipenv --three` -- [ ] Take note of the location of your virtual environment, look for this line in the output: +- Install pipenv in the terminal to manage dependencies: `pip3 install pipenv` +- For whichever IDE you're using, install whichever extensions are needed to develop Python applications +- Clone the project to your computer: `git clone https://github.com/NSC-Computer-Science-Club/converger_app.git` +- Move into the project's directory: `cd converger_app` +- Create a virtual environment for the project (that uses Python 3): `pipenv --three` +- Take note of the location of your virtual environment, look for this line in the output: - `virtualenv location: /home/jardi/.local/share/virtualenvs/converger_app-UaPtKjcA` -- [ ] You can always get the location of your virtual environment by running `pipenv --venv` -- [ ] Now, it's time to activate your virtual environment. You will install your depencies in it. - - Run: `source /bin/activate` (append /bin/activate to your virtual environment's path). -- [ ] Your prompt will change to `(converger_app) username@hostname` indicating that you are now working within you virtual environment. -- [ ] Install Django: `pip3 install django` -- [ ] Run the server: `python3 manage.py runserver` -- [ ] On you browser visit `http://127.0.0.1:8000/` to see your Django ap. -- [ ] If you see a warning about unapplied migrations: `You have unapplied migrations; your app may not work properly until they are applied.` - - Run 'python manage.py migrate' to apply them.` you can ignore them for now. -- [ ] Quit the server by either closing the terminal window or pressing `Control + C`. -- [ ] To deactivate the virtual environment run: `deactivate` +- You can always get the location of your virtual environment by running `pipenv --venv` + +Now, it's time to activate your virtual environment. You will install all the dependencies within it. +- Run: `source /bin/activate` (append /bin/activate to your virtual environment's path). + +Your prompt will change to `(converger_app) username@hostname` indicating that +you are now working within you virtual environment. We can now install Django. +- Install Django: `pip3 install django` +- Run the server: `python3 manage.py runserver` +- On you browser visit `http://127.0.0.1:8000/` to see your Django ap. +- If you see a warning about unapplied migrations: `You have unapplied migrations; your app may not work properly until they are applied.` + - Run 'python manage.py migrate' to apply them. you can ignore them for now. +- Quit the server by either closing the terminal window or pressing `Control + C`. +- To deactivate the virtual environment run: `deactivate` ### Creating an alias for activating your virtual environment From 1683076f92c612c8d009095a9f5b44516cafd0f0 Mon Sep 17 00:00:00 2001 From: jardiamj <1088732+jardiamj@users.noreply.github.com> Date: Sat, 23 Oct 2021 11:01:32 -0700 Subject: [PATCH 3/3] Fixed some bullent points --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 48fdcb8..1608382 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,6 @@ with an alias for that command to your `.bashrc` file do: The alias will be available the next time you open a bash session (open a terminal). If you want to have it in your current session you will need to source the .bashrc script: `source ~/.bashrc` - -Then: - To activate the virtual environment run: `activate_converger_app` - To deactivate the virtual environment run: `deactivate`