Re: Queries regarding staticfiles | pgarchives

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Sahil Harpal <sahilharpal1234(at)gmail(dot)com>
Cc: PostgreSQL WWW <pgsql-www(at)postgresql(dot)org>
Subject: Re: Queries regarding staticfiles | pgarchives
Date: 2022-06-15 17:13:25
Message-ID: CABUevEyc6ixWpzjUZcrabov6w+Hh8Qzj+P=y-1u_cdn+aVe+-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

On Wed, Jun 15, 2022 at 5:38 AM Sahil Harpal <sahilharpal1234(at)gmail(dot)com>
wrote:

> On Wed, 15 Jun 2022 at 02:52, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
>
>> As I said, you need to make the folder /media/ be served up as
>> /media-static/. This is configuration in your webserver.
>>
>
> Could you please help me to do this? Like where and what I need to change.
>

That depends on what webserver you're using. For example, in uwsgi you'd
add something like:
static-map=/media-archives=/some/where/pgarchives/django/media

For nginx, it'd be something like:
location /media-archives/ {
alias /some/where/pgarchives/django/media/;
}

> Um. There is no reference from https://www.postgresql.org/list/ to
>> main.css in media-archives that I can see?
>>
>
> Yeah, with the help of /dyncss/ the base.css = (main.css+normalize.css) of
> pgweb gets loaded after visiting /list/.
> Now I am just confused about what exactly happens when someone opens
> https://www.postgresql.org/list/ in the browser? How is HTML loading? If
> it is using CSS files of pgweb then why do we have CSS files in the
> /media/css/ of pgarchives :(
>

Oh. Yes, anything outside of /list/ is loaded from pgweb. The dyncss is one
of them. And yes, this is kind of a hacky and terrible way, but that's how
it is right now. Certain parts of them have to be kept in sync.

We need them separately because the same pgarchives code is also run
standalone, for our private archives. And in that scenario, there is no
pgweb involved.

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

In response to

Responses

Browse pgsql-www by date

  From Date Subject
Next Message Sahil Harpal 2022-06-16 14:05:12 Re: Queries regarding staticfiles | pgarchives
Previous Message Sahil Harpal 2022-06-15 03:38:05 Re: Queries regarding staticfiles | pgarchives