open-contracting / kingfisher-process

Stores and pre-processes OCDS data in a SQL database
https://kingfisher-process.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2 stars 8 forks source link

Deploy Django branch #272

Closed jpmckinney closed 2 years ago

jpmckinney commented 4 years ago

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

Go through checklist, notably:

Set environment variables from Salt:

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:

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

jpmckinney commented 2 years ago

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).

Follow-up issues: https://github.com/open-contracting/deploy/issues/331