Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy Django branch #272

Closed
jpmckinney opened this issue Mar 25, 2020 · 1 comment
Closed

Deploy Django branch #272

jpmckinney opened this issue Mar 25, 2020 · 1 comment

Comments

@jpmckinney
Copy link
Member

jpmckinney commented Mar 25, 2020

https://docs.djangoproject.com/en/3.0/howto/deployment/

Go through checklist, notably:

Set environment variables from Salt:

  • Django variables
  • KINGFISHER_PROCESS_ENV=production
  • KINGFISHER_PROCESS_SECRET_KEY=
  • STATIC_ROOT if needed
  • KINGFISHER_PROCESS_SECURE_HSTS_SECONDS=31536000 (1 year) after testing on smaller values

Miscellaneous:

python manage.py migrate should create:

CREATE TABLE public.django_migrations (
    id integer NOT NULL,
    app character varying(255) NOT NULL,
    name character varying(255) NOT NULL,
    applied timestamp with time zone NOT NULL
);
CREATE SEQUENCE public.django_migrations_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ALTER SEQUENCE public.django_migrations_id_seq OWNED BY public.django_migrations.id;
ALTER TABLE ONLY public.django_migrations ALTER COLUMN id SET DEFAULT nextval('public.django_migrations_id_seq'::regclass);
ALTER TABLE ONLY public.django_migrations
    ADD CONSTRAINT django_migrations_pkey PRIMARY KEY (id);

We can later manually drop:

  • alembic_version
  • transform_upgrade_1_0_to_1_1_status_release
  • transform_upgrade_1_0_to_1_1_status_record

As follow-up to #242, we can also drop:

  • release_check_error
  • record_check_error
@jpmckinney jpmckinney added this to the V2 (Django) milestone Nov 20, 2020
@jpmckinney
Copy link
Member Author

We deployed this to the data registry, and will deploy it to a fresh server for the helpdesk (rather than the more difficult original plan to migrate the deployment to the new version).

  • PostgreSQL uses UTC.
  • Docker is used to monitor workers.
  • The tables listed as being droppable don't exist in the new version.

Follow-up issues: open-contracting/deploy#331

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant