Skip to content

RobertBagdahn/inspi

Repository files navigation

Run Django

poetry run python manage.py runserver

run tailwinf

poetry run python manage.py tailwind start

Installation

poetry install poetry run python manage.py makemigrations

poetry run python manage.py migrate

Load Example Data

  1. poetry run python manage.py add_users

Mac, Linux:

  1. poetry run python manage.py loaddata data/activity/master-data/*.json
  2. poetry run python manage.py loaddata data/activity/test-data/*.json
  3. poetry run python manage.py loaddata data/food/*.json
  4. poetry run python manage.py loaddata data/blog/*.json
  5. poetry run python manage.py loaddata data/masterdata/*.json
  6. poetry run python manage.py loaddata data/group/*.json

all together in one shell script sh setup.sh ``

Windows:

  1. poetry run python manage.py add_fixtures data\activity\master-data\ Run Server poetry run python manage.py runserver

If statics are not already in static folder run this: poetry run python manage.py collectstatic

env file

in folder /config you need to put the .env file. Next to the file settings.py

the file need to look like the example.env file in that folder

login gcp database

export USE_CLOUD_SQL_AUTH_PROXY=true ./cloud-sql-proxy inspi-441320:europe-west3:inspi-prod

migrate remote database (new terminal)

export USE_CLOUD_SQL_AUTH_PROXY=true poetry run python manage.py migrate

build css into the static directory served by App Engine

poetry run python manage.py tailwind build

deploy

gcloud app deploy

cost controls

  • App Engine is capped at a single F1 instance in app.yaml to avoid scale-out cost. Raise max_instances again if latency under burst traffic becomes a problem.
  • Visitor tracking is off by default in production. Re-enable it only if you need those analytics by setting ENABLE_VISITOR_TRACKING=true. Anonymous tracking stays off unless TRACK_ANONYMOUS_USERS=true is also set.

formater for template files

poetry run djlint . --reformat

linter for template files

poetry run djlint . --lint

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors