Skip to content

add devmode to serve gutenberg/ and pics/ from static#194

Merged
eshellman merged 7 commits intomasterfrom
devmode
Sep 9, 2025
Merged

add devmode to serve gutenberg/ and pics/ from static#194
eshellman merged 7 commits intomasterfrom
devmode

Conversation

@eshellman
Copy link
Contributor

@eshellman eshellman commented Aug 31, 2025

based on #186, but not using submodules
this now works. docs to come.

all you need is to add devmode: True to your ~/.autocat3 file

the thumb_base_path parameter is added so we can use a prod server to supply cover images

@eshellman eshellman changed the title 1st try at local install [WIP] add devmode to serve gutenberg/ and pics/ from static Sep 1, 2025
@Thenlie
Copy link
Contributor

Thenlie commented Sep 2, 2025

I haven't had time to pull this down locally to test, but just looking at the code I think there is a meaningful difference in this approach vs the submodule approach. (not a deal breaker, just something to point out)

With this approach, the dev will be required to clone gutenbergsite, pull recent changes, and then copy those files into the autocat repo. This was one of the main things I was trying to fix.

This is still a big improvement, and we can ease the friction of manually copying files via some sort of script.

@eshellman
Copy link
Contributor Author

understood, but I just couldn't get that to work without major changes in my environment. and ++ to having a script to automate.

@Thenlie
Copy link
Contributor

Thenlie commented Sep 3, 2025

Had some time to try and get this working. Here are a few notes:

  1. I might be missing this in the docs somewhere, but I do not see any information on setting up the ~/.autocat3 file. It would be nice to have this outlined in the README, and also provide an example.
  2. The postgres user was not updated here as far as I can tell. If I set pguser in the root autocat3 file, it does not change anything.
  3. Most importantly, I could not get this to work. After copying the css files to gutenberg and images to pics, the files were still not found. It seems like the directories are not actually being statically loaded. I needed to add the following code to the CherryPy.conf to get this working:
[/gutenberg]
tools.staticdir.on: True
tools.staticdir.dir: CherryPyApp.install_dir + '/gutenberg'

[/pics]
tools.staticdir.on: True
tools.staticdir.dir: CherryPyApp.install_dir + '/pics'

In case my ~/.autocat3 file is the problem, here it is:

 [DEFAULT]
 devmode = true
 pguser = leithen

@eshellman
Copy link
Contributor Author

did you miss configuring.txt?

@eshellman
Copy link
Contributor Author

the ~/,autocat3 uses the same format as the .conf file
should start with [global]
pguser is set in the CherryPy.conf file. You should be able to change it in the .autocat3 file if it's in the [global] block
if you set static directories in the CherryPy.conf file, I don't think you can turn them off. (didn't work for me)

@Thenlie
Copy link
Contributor

Thenlie commented Sep 4, 2025

did you miss configuring.txt?

Ah, I did miss this section https://github.com/gutenbergtools/autocat3/blob/dev/configuring.txt#L84. So that explains the pguser part. Everything was under default, not global.

With regard to the static files, does that mean we won't be able to commit that code to the repo and need to add it locally, or am I also missing a setup step for that?

@eshellman
Copy link
Contributor Author

the idea is you turn on devmode in .autocat3, copy in the pics and gutenberg dirs, and it should just work, with any branch

@eshellman
Copy link
Contributor Author

obviously we need to also reference configuring.txt in readme

@Thenlie
Copy link
Contributor

Thenlie commented Sep 5, 2025

Okay after some more tinkering I got this working. Largely just a lack of experience with this setup from my site, though also worth improving some docs as you mentioned.

My issue was initially using [DEFAULT] and then [GLOBAL] as the .autocat3 header. Only [global] works.

[global]
devmode: True
pguser: 'leithen'

Thanks for the help here @eshellman

I did still have an issue with the DEV_BASE_PATH. It did not take a value from either .autocat3 or the env file. I needed to add the value directly to CherryPyApp.py to get it working.

@eshellman
Copy link
Contributor Author

Thanks - I'll fix that and clean up documentation

@Thenlie
Copy link
Contributor

Thenlie commented Sep 6, 2025

For documentation, I might suggest converting configuring.txt to .md. Obviously just a personal preference, but I found the text file a bit harder to read.

Thanks for all the work here Eric!

@eshellman eshellman merged commit f3ce766 into master Sep 9, 2025
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

Successfully merging this pull request may close these issues.

2 participants