generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Technical: Deployment
Ethan-Strominger edited this page Nov 19, 2023
·
38 revisions
- Installed Git, Python, Postgres, Python IDE (pycharm or vscode recommended), Postgres IDE (for example, DBVisualizer)
- Git
- Python Click here and read up to and including "Data Structures". This will be enough to get you started.
- Django Part 1 and Part 2 of "Writing your first Django app"
=================================================================
- If using your account
- Fork repository in github
- Clone fork
- If you have maintain privileges for this repo, just clone this repo directly
Since you started the server in the previous step, you can skip the next section.
From the terminal, type:
docker build -t kb-web-image . # this only needs to be done once
docker-compose up
After docker-compose up
, you might get ./start-docker.sh: no such file or directory
.
To avoid issues with Git line endings, disable Git EOL conversion before running the Docker script.
From the bash terminal, type:
git config --global core.autocrlf false
git add --renormalize .
If you need to open the terminal to try some Django or Python commands:
Open terminal in Docker for django-hfla-web Run
cd django_root
source ./activate.sh
Docker is the preferred method for starting. If Docker is not working or you have some other reason to run it locally:
- Start Postgres
- From terminal:
cd django_root
source ./start-dev.sh
- Modify models.py and admin.py. Look for "tool" for example of code to add. DO NOT MODIFY 0001_initial.py. The scripts in the directory for this file are autogenerated when makemigrations is run.
- Kill server started with ./start-dev.sh
-
./start-dev.sh
will automatically run makemigrations and migrate.
This would only be done if the development team wants fewer migration scripts to make it easier to read.
- Drop all tables under public schema
- Remove django_kp_app/migrations directory using gui or with command
rm -rf django_kb_app/migrations
- Starting Docker (or running ./start-dev.sh locally) will automatically regenerate migrate scripts.
- localhost:8000/admin
- Log in with admin for username and password
- Populate Gdoc table, set Google ID to
1rGLToDtbpnhKtkIcdcVQA3N3hWbyKFEs_BUmuD90VaE