Closed brylie closed 1 year ago
Hi @brylie. There are a number of issues I'd be happy to take on such as this one.
However, I'm having trouble getting Docker running properly. I get the containers setup but I think it's hanging in the bootup process. Is this a known issue? - apologies if this question to Discussion or elsewhere?
Can you post the specific error you get when running ‘docker compose up’ from within the ‘app/‘ directory?
I get this warning upon first running the command but believe it should cause any issues:
time="2023-04-05T21:44:38+09:30" level=warning msg="The \"PWD\" variable is not set. Defaulting to a blank string."
then it continues to boot until it seems to hang after printing this:
wf_postgres | 2023-04-05 12:19:39.367 UTC [27] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.013 s, sync=0.003 s, total=0.043 s; sync files=2, longest=0.002 s, average=0.002 s; distance=0 kB, estimate=0 kB
I left it over night and it had not changed this morning. Am I mis understanding something?
I think you're good to go at that point. Try opening another terminal and continuing the developer steps, such as running migrations.
I had tried that too but didn't mention it after getting this error:
ModuleNotFoundError: No module named 'dj_database_url'
EDIT: with renewed confidence I tried again and realised I hadn't started up the shell in the new terminal. However, ran into this error:
django.db.utils.OperationalError: connection to server at "localhost" (::1), port 5432 failed: FATAL: password authentication failed for user "postgres"
I've tried connecting to the database using the psql command line tool (i.e. 'docker exec -it wf_postgres psql -U postgres'). it worked for wf_postres, but not for wf_pgadmin printing:
H: unknown
I’m not sure what could be going wrong. Can you record a short video showing the following steps in your terminal?
Those steps work correctly on all of the computers I’ve tried.
Here you are @brylie:
Do you have any other Postgres containers or services running on port 5432? What error do you get when running ‘python manage.py migrate’ without first running ‘docker compose up’? I’m guessing there is a leftover Postgres instance running.
You solved it. Got it running after stopping the rogue Postgres instance. Thanks.
If you want to assign this issue to me I'll give it a go.
@werberger, any status updates or difficulties with this task?
I think the only difficulty is the content migration. I thought that would happen as part of the set up, but seems not to have - Wagtail has nothing but Pages, and pgAdmin has all the tables but no data that I can see.
I looked at the CONTENT_MIGRATION.md but it seems rather complex to me and I haven't had the time to look into it.
Should I simply ignore the migration and manually create enough data to demonstrate the breadcrumbs or am I missing something?
In this case, you can run the management command scaffold_initial_content
to give a site scaffolding that will include the magazine index page with a child deep archive page.
python manage.py scaffold_initial_content
The only necessary change is to add a page URL link before the following line
Use the page.get_parent
helper to get the parent page of the deep archive page
https://docs.wagtail.org/en/stable/reference/pages/model_reference.html#wagtail.models.Page.get_parent
Use the pageurl
helper to construct the link to the parent page
https://docs.wagtail.org/en/stable/topics/writing_templates.html#pageurl-tag
Hey @brylie . Appreciate this is probably becoming as frustrating for you as it is for me, but hoping that once I get a PR merged on this project I will be able to clear few a reasonable number for you. It will then have been worth your time investment.
Anyway, I've got the code working but whenever I attempt a commit it is throwing this error:
Poetry could not find a pyproject.toml file in C:...\WF-website or its parents
It does not seem to search within the 'app' directory where the pyproject.toml is located. I have tried a lot of things but cannot get around this. Any ideas?
Can you show a screen recording of the steps you take when that error appears?
Also, consider using an IDE like VSCode to assist with the whole development process and committing, if you aren’t using one already 🙂
I can do a recording but is this sufficient?
The same error occurs in the parent directory and without the virtual environment. I have also tried with GIT in Pycharm with the same error.
The pyproject.toml file is within the 'app' directory. wondering if the fact it is not looking in this directory is the issue...
Aha! I found the issue was related to the autohooks
package, which runs some hooks on every git commit. I've replaced autohooks
with pre-commit
and updated the contributing guide.
https://github.com/WesternFriend/WF-website/blob/main/docs/CONTRIBUTING.md#install
Sorry for the difficulty here.
Please save your code and try again in a new branch from the latest main
branch.
I've updated my local branch and run the new installation command, seemingly successfully. And although it still cannot find pyproject.toml, it progresses further than before. However, the commit is still not completed.
Try running pre-commit install -f
to use only the pre-commit
hooks and remove the old autohooks
.
Thanks Brylie. I had done that multiple times but seems I needed to clone it to an entirely new directory.
Hopefully, after all that it's what you're after. But of course happy to alter as required.
Cheers 🥳
Closing this since it was merged.
Consider making it easy for people to get back to the magazine page by adding breadcrumbs to the deep archive page.