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-14 13:38:54
Message-ID: CABUevEy4V1oNfnAL74sdk3tNpGu5cz+e855PKdU-Mm+cAz+9kg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

On Tue, Jun 14, 2022 at 2:43 PM Sahil Harpal <sahilharpal1234(at)gmail(dot)com>
wrote:

> Hello,
> I have following queries related to staticfiles:
>
> - Why do we have /media-archives/... URL for CSS files? [
> https://github.com/postgres/pgarchives/blob/master/django/archives/mailarchives/templates/base.html#L18]
> Such folder is not present in the project. We have a folder named *media
> *which contains all static files. Can I change all /media-archives/ to
> /media/ ? Also the css_map that dynamic_css
> <https://github.com/postgres/pgarchives/blob/master/django/archives/mailarchives/views.py#L845>()
> method
> <https://github.com/postgres/pgarchives/blob/master/django/archives/mailarchives/views.py#L845> is
> using and in the css files for specifying path to images
> <https://github.com/postgres/pgweb/blob/master/media/css/main.css#L193>,
> contain /media/ and not /media-archives/.
>
>
Because it runs on the same hostname as www.postgresql.org, and otherwise
there would be a potential conflict. The folder /media/ is in the
filesystem, and should be served up as /media-static/ on http.

>
> - What is the use case of that dynamic_css() method?
>
>
It is to reduce the number of files in a quick and hacky way. We had too
many different CSS files and this is one way to serve them up under a
single URL to make things faster.

>
> - CSS and images will reflect on the HTML pages when I set STATIC_URL
> = "/media/" and change all media-archives to media. Also I need to add
> 'django.contrib.staticfiles' in the INSTALLED_APPS.
>
>
We don't use staticfiles.

> - In the main.css also many things are missing.
> I have attached the main.css present in the GitHub and main.css that
> actual pgarchives is using. Why do we have such differences in the code?
>
>
What do you mean "present in the github" and the one that's in pgarchives?
Where is it on github and where do you see it in pgarchives?

--
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-14 16:02:44 Re: Queries regarding staticfiles | pgarchives
Previous Message Sahil Harpal 2022-06-14 12:43:03 Queries regarding staticfiles | pgarchives