Home Information - Your home, your data, organized.
Python
A bunch of tweaks from going through dev setup with other account.
Tony C670459cfaa47
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 3919e514..405abcb1 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -14,8 +14,8 @@ We've only just begun this journey. We've put some basic functonality in place tWe are open to contributions from anyone. There are a few different ways to contribute:- **User** - Only requires installing and using the app.-- **Graphic or UX Design** - For those with ideas on better visuals and/or better user experiences.- **Software Development** - For those wanting to get involved with writing code.+- **Graphic or UX Design** - For those with ideas on better visuals and/or better user experiences.See the sections below for more details for each way to contribute.@@ -30,12 +30,6 @@ Any and all feedback and ideas are welcome, such as:- Good and bad usability issues.- And bugs or glitches.-### Graphic and UX Design Contributions--As with most software projects like this, the UI and UX design tends to be done by software developers with only a passing sense of what "good" looks like and/or are too busy trying to make everything actually work to have time to devote to refining the UI/UX. If you tend toward thinking and caring about the visual style and user experience, it would greatly complement the team.--We are not currently set up with a workflow for contributing in this manner, but all we need are some people with the interest and we'll develop something. Just let us know if this sounds like something you are interested in.-### Software Development ContributionsThe following pages are for those wanting to contribute to the code base:@@ -45,6 +39,12 @@ The following pages are for those wanting to contribute to the code base:- [Development Workflow Page](docs/dev/Workflow.md)- [Developer Documentation](docs/dev/README.md)+### Graphic and UX Design Contributions++As with most software projects like this, the UI and UX design tends to be done by software developers with only a passing sense of what "good" looks like and/or are too busy trying to make everything actually work to have time to devote to refining the UI/UX. If you tend toward thinking and caring about the visual style and user experience, it would greatly complement the team.++We are not currently set up with a workflow for contributing in this manner, but all we need are some people with the interest and we'll develop something. Just let us know if this sounds like something you are interested in.+## Code of ConductRegardless of how you contribute, you must adhere to the golden rule and:diff --git a/deploy/env-generate.py b/deploy/env-generate.pyindex 42027b4a..5eceb679 100755--- a/deploy/env-generate.py+++ b/deploy/env-generate.py@@ -407,18 +407,37 @@ class HiEnvironmentGenerator:@staticmethoddef print_warning( message : str ):- print( f'\n\033[93m[WARNING]\033[0m {message}\n' ) # Yellow text+ print( f'\n\033[96m[WARNING]\033[0m {message}\n' ) # Yellow text@staticmethoddef print_success( message : str ):- print( f'\033[92m[SUCCESS]\033[0m {message}' ) # Green text+ print( f'\033[32m[SUCCESS]\033[0m {message}' ) # Green text@staticmethod- def print_important( message : str ):+ def print_important(message: str):+ lines = message.split('\n')+ max_width = min( 80, max( len(line) for line in lines ) + 6 )++ def pad_line( line ):+ return line.center( max_width )++ padded_lines = [ pad_line(line) for line in lines ]+ border = " " * max_width++ # Inverted fg/bg text+ print( f'\n\033[7m{border}\033[0m' )+ for padded_line in padded_lines:+ print( f'\033[7m{padded_line}\033[0m' )+ continue+ print( f'\033[7m{border}\033[0m\n' )+ return++ @staticmethod+ def zzzprint_important( message : str ):border = '=' * ( min( len(message), 74 ) + 6)- print( f'\n\033[94m{border}\033[0m' ) # Blue border- print( f'\033[94m{message}\033[0m' ) # Blue text- print( f'\033[94m{border}\033[0m\n' ) # Blue border+ print( f'\n\033[7m{border}\033[0m' ) # Blue border+ print( f'\033[7m{message}\033[0m' ) # Blue text+ print( f'\033[7m{border}\033[0m\n' ) # Blue borderCOMMON_EMAIL_PROVIDER_SETTINGS = {'gmail.com': SmtpSettings(diff --git a/docs/Development.md b/docs/Development.mdindex b2b00d26..3d6c3374 100644--- a/docs/Development.md+++ b/docs/Development.md@@ -4,8 +4,9 @@## Requirements and Dependencies-- Python 3.11 (or higher) - installed-- Redis - installed and running+- Python 3.11 (or higher) - installed.+- Redis - installed and running.+- A GitHub account.See the [Dependencies Page](dev/Dependencies.md) if you want help installing those.diff --git a/docs/dev/Dependencies.md b/docs/dev/Dependencies.mdindex 23b93f8e..16aca494 100644--- a/docs/dev/Dependencies.md+++ b/docs/dev/Dependencies.md@@ -8,6 +8,8 @@ _Provided for convenience. May be outdated._### Python+_Needed for running and for local development._+#### MacOSGet python 3.11 package and install from: [https://www.python.org/downloads/](https://www.python.org/downloads/)@@ -23,9 +25,10 @@ Get python 3.11 package and install from: [https://www.python.org/downloads/](htsudo apt install python3.11-venv```-### Docker+_For running, optional for local development._+#### MacOSSee: [https://docs.docker.com/desktop/setup/install/mac-install/](https://docs.docker.com/desktop/setup/install/mac-install/)@@ -40,8 +43,49 @@ sudo apt install docker-composesudo systemctl start docker```+### GitHub - SSH Key Setup++_For local development only._++#### MacOS and Ubuntu (GNU/Linux)++It is a better security practice, but not required, to generate an SSH key dedicated for GitHub use. If you do not have an SSH key already generated, or want to generate one for GitHub use, then use one of these, replacing with your email:+``` shell+ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/github_key++# or just+ssh-keygen -t ed25519 -C "[email protected]"+```++Then on GitHub:+- go to your profile settings (click your profile picture, then "Settings");+- click "SSH and GPG keys";+- click "New SSH key" (or "Add SSH key");+- give the key a descriptive name (e.g., "My Laptop"),+- type is "Authentication Key" (the default);+- paste your public key into the key field. (e..g, `~/.ssh/github_key.pub` or `~/.ssh/id_e25519.pub`); and then+- finish by clicking the "Add SSH Key" button.++If you decided to use a dedicated GitHub key (i.e., not the default key), it is also recommeneded (but not required) to add this section to `~/.ssh/config`:+``` shell+Host github.com+ IdentityFile ~/.ssh/github_key+ PreferredAuthentications publickey+```++You can test if this is set up and working properly from your local command line with:+``` shell+ssh -T [email protected]+```+If it is working, you should see a message like:+``` shell+Hi <yourname>! You've successfully authenticated, but GitHub does not provide shell access.+```+### Redis+_For local development only._+#### MacOSDownload tarball from: [https://redis.io/download](https://redis.io/download).diff --git a/docs/dev/Setup.md b/docs/dev/Setup.mdindex 6c4b82e5..4c99773d 100644--- a/docs/dev/Setup.md+++ b/docs/dev/Setup.md@@ -1,9 +1,10 @@<img src="../../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">-# Development Setup+# Development Setup (one-time setup)## Fork the Repository+- Sign into your GitHub account (required).- Go to the main repository on GitHub: https://github.com/cassandra/home-information- Click the "Fork" button in the upper-right corner.- This creates a copy of the repository in the your GitHub account (keep same name if you can for simplicity).@@ -26,15 +27,25 @@ git clone https://github.com/${YOURUSERNAME}/home-information.gitgit clone [email protected]:${YOURUSERNAME}/home-information.git```-Add the original repo as "upstream":+Now change into that directory and configure the repo including adding the source as the "upstream" target:``` shell+cd home-information++git config --global user.name "${YOUR_NAME}"+git config --global user.email "${YOUR_EMAIL}"+git remote add upstream https://github.com/cassandra/home-information.git+```++Your "origin" should already be pointing to your forked repository, but to be sure you can use one of these:+``` shell+git remote add origin [email protected]:${YOURUSERNAME}/home-information.git-# Or the SSH URL:-git remote add upstream [email protected]:${YOURUSERNAME}/home-information.git+# If no ssh keys added to GitHub+git remote set-url origin https://github.com/${YOURUSERNAME}/home-information.git```-Verfy everything is set up properly:+Verify everything is set up properly:``` shellgit remote -v@@ -45,6 +56,15 @@ upstream https://github.com/cassandra/home-information.git (fetch)upstream https://github.com/cassandra/home-information.git (push)```+## Staging Branch Setup++You will have forked the `master` branch, but all your branches and pull request contributions will be targeting the `staging` branch. To get your fork and local repositories in sync with the `staging` branch:+``` shell+git fetch upstream+git checkout -b staging upstream/staging+git push origin staging+```+## Environment SetupGenerate the environment variable file and review with the command below. The file will contain sensitive secrets and are stored in a `.private` directory. Also note that administrative credentials created during this next step.diff --git a/src/manage.py b/src/manage.pyindex 6c2915d9..89d091df 100755--- a/src/manage.py+++ b/src/manage.py@@ -25,7 +25,7 @@ def set_default_port_if_needed():if ( len(sys.argv) < 2 ) or ( sys.argv[1] != "runserver" ):return- default_port_override = os.environ.get( 'DJANGO_DEV_PORT' )+ default_port_override = os.environ.get( 'DJANGO_SERVER_PORT' )if not default_port_override:return