GithubHelp home page GithubHelp logo

accordbox / wagtail-tailwind-blog Goto Github PK

View Code? Open in Web Editor NEW
358.0 11.0 85.0 19.33 MB

Wagtail blog based on Tailwind CSS, Stimulus, it supports Markdown, Latex and user comments.

Home Page: https://leanpub.com/buildblogwithwagtailcms

Python 52.25% HTML 25.09% JavaScript 15.93% Dockerfile 3.03% Shell 1.83% SCSS 1.88%
wagtail wagtail-blog wagtail-tutorials wagtail-cms-demo stimulusjs tailwindcss

wagtail-tailwind-blog's Introduction

Introduction

This open source project is for my book Build Blog With Wagtail CMS

You can support my work by purchasing the ebook

Other books written by me

Objective

This book will teach you how to build a modern blog with Wagtail CMS

By the end of this course, you will be able to:

  1. Understand Docker and use Docker Compose to do development
  2. Use python-webpack-boilerplate to jump start frontend project bundled by Webpack.
  3. Install Tailwind CSS as the style solution.
  4. Install Stimulus, understand how it works and write Stimulus controllers.
  5. Learn how Dark Mode works in Tailwind CSS and use Stimulus controller to toggle the dark mode.
  6. Understand the benefit of the healthy Stimulus ecosystem by reusing 3-party Stimulus controller.
  7. Create blog models to work with Wagtail.
  8. Use PDB and Django shell to debug, test code and check data in terminal.
  9. Learn to use RoutablePage and add Date to the post url.
  10. Build Pagination component and correctly handle querystring.
  11. Make the blog supports writing in Markdown and Latex.
  12. Create contact page using Wagtail FormBuilder
  13. Build menu, meta tags, sitemap, robots.txt for better SEO.
  14. Build comment system based on django-contrib-comments which support Generic Relations
  15. Use Tribute.js, Axios to add Mention and Emoji support to the comment form.
  16. Deploy the production app to DigitalOcean

Tech

  • Python 3.10
  • Django 4
  • Wagtail 4
  • Stimulus 3
  • Tailwind CSS 3

How to run on local

$ git clone https://github.com/AccordBox/wagtail-tailwind-blog
$ cd wagtail-tailwind-blog

First, let's build frontend assets, please make sure node is available.

$ node -v

# install dependency packages
$ npm install

# launch webpack dev server and keep it running
$ npm run watch

You need Docker and Docker Compose and you can install it here Get Docker

# build and launch app
$ docker-compose up --build

Now open a new terminal to import data and change password.

$ docker-compose exec web python manage.py load_initial_data
$ docker-compose exec web python manage.py changepassword admin

Now you can check on

Demo

The demo is also online if you want to check.

Screenshot

wagtail-tailwind-blog's People

Contributors

michael-yin avatar tomdyson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wagtail-tailwind-blog's Issues

Python Dependencies Needed

Hi @michael-yin. Thanks for putting these tutorials together -- they've been a big help as I'm new to Django and Wagtail.

When running your blog locally, I ran into Python/pip dependencies that wasn't documented in your README.md.

  1. Had to install wheel in the virtualenv (already present on the system):
git clone https://github.com/michael-yin/wagtail-bootstrap-blog.git
cd wagtail-bootstrap-blog/
python3 -m venv env
source env/bin/activate
pip3 install -r requirements.txt

Produces this output: wagtail-bootstrap-blog-stdout.log

To solve, within virtualenv, I ran pip3 install wheel, then pip3 uninstall -r requirements.txt.

  1. On Ubuntu 19.04, I also needed these packages for Pillow:
sudo apt-get install -y python3-dev python3-setuptools # previously installed
sudo apt-get install -y libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk libharfbuzz-dev libfribidi-dev

Once the dependencies were fixed, pip3 install -r requirements.txt && ./manage.py runserver worked as expected.

Thought they might be good points to document for other users.

'wagtailmd' missing

Hey,

I couldn't find the contents of the app 'wagtailmd'
Could you give me a link to download the contents of the app or show me another way to integrate wagtail markdown?

Thanks.

Waiting for PostgreSQL to become available...

Hello,
I keep getting this message "Waiting for PostgreSQL to become available..." in my terminal after running docker-compose logs -f.
The full terminal output looks like this

$ docker-compose logs -f
Attaching to wagtail-bootstrap-blog_web_1, wagtail-bootstrap-blog_db_1
db_1   | 2021-03-10 21:31:50.754 UTC [1] LOG:  starting PostgreSQL 12.0 on x86_64-pc-linux-musl, compiled by gcc (Alpine 8.3.0) 8.3.0, 64-bit
db_1   | 2021-03-10 21:31:50.755 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_1   | 2021-03-10 21:31:50.755 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db_1   | 2021-03-10 21:31:50.940 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1   | 2021-03-10 21:31:51.158 UTC [19] LOG:  database system was shut down at 2021-03-10 21:31:45 UTC
db_1   | 2021-03-10 21:31:51.193 UTC [1] LOG:  database system is ready to accept connections
db_1   | 2021-03-10 21:48:40.891 UTC [1] LOG:  received smart shutdown request
db_1   | 2021-03-10 21:48:40.944 UTC [1] LOG:  background worker "logical replication launcher" (PID 25) exited with exit code 1
db_1   | 2021-03-10 21:48:40.944 UTC [20] LOG:  shutting down
db_1   | 2021-03-10 21:48:41.106 UTC [1] LOG:  database system is shut down
db_1   | 2021-03-10 21:55:57.355 UTC [1] LOG:  starting PostgreSQL 12.0 on x86_64-pc-linux-musl, compiled by gcc (Alpine 8.3.0) 8.3.0, 64-bit
db_1   | 2021-03-10 21:55:57.355 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_1   | 2021-03-10 21:55:57.355 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db_1   | 2021-03-10 21:55:57.480 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1   | 2021-03-10 21:55:57.723 UTC [20] LOG:  database system was shut down at 2021-03-10 21:48:41 UTC
db_1   | 2021-03-10 21:55:57.850 UTC [1] LOG:  database system is ready to accept connections
web_1  | Waiting for PostgreSQL to become available...
web_1  | Waiting for PostgreSQL to become available...
web_1  | Waiting for PostgreSQL to become available...

Not sure why I am getting this. I don't have any real experience with Docker but I'm up for anything. Any input would be great,
Thanks!

requirement installation fails

Collecting wagtail==2.0
  Using cached wagtail-2.0-py3-none-any.whl (10.8 MB)
Collecting Django==2.0
  Using cached Django-2.0-py3-none-any.whl (7.1 MB)
Requirement already satisfied: django-taggit==0.22.2 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 3)) (0.22.2)
Collecting django-el-pagination==3.1.0
  Using cached django-el-pagination-3.1.0.tar.gz (359 kB)
Collecting Markdown==2.6.2
  Using cached Markdown-2.6.2-py2.py3-none-any.whl (157 kB)
Collecting Pygments
  Using cached Pygments-2.6.1-py3-none-any.whl (914 kB)
Collecting wagtailmenus
  Using cached wagtailmenus-3.0.2-py3-none-any.whl (181 kB)
Collecting django-widget-tweaks==1.4.2
  Using cached django_widget_tweaks-1.4.2-py2.py3-none-any.whl (13 kB)
Collecting django_compressor==2.2
  Using cached django_compressor-2.2-py2.py3-none-any.whl (118 kB)
Collecting django-libsass==0.7
  Using cached django-libsass-0.7.tar.gz (4.9 kB)
Collecting django-environ==0.4.5
  Using cached django_environ-0.4.5-py2.py3-none-any.whl (21 kB)
Collecting flake8==3.6.0
  Using cached flake8-3.6.0-py2.py3-none-any.whl (68 kB)
Collecting isort==4.3.4
  Using cached isort-4.3.4-py3-none-any.whl (45 kB)
Collecting pycodestyle==2.4.0
  Using cached pycodestyle-2.4.0-py2.py3-none-any.whl (62 kB)
Collecting autopep8==1.4.3
  Using cached autopep8-1.4.3.tar.gz (113 kB)
Collecting html5lib<1,>=0.999
  Using cached html5lib-0.999999999-py2.py3-none-any.whl (112 kB)
Collecting Unidecode<1.0,>=0.04.14
  Using cached Unidecode-0.04.21-py2.py3-none-any.whl (228 kB)
Collecting Pillow<5.0,>=2.6.1
  Using cached Pillow-4.3.0.tar.gz (13.9 MB)
Collecting djangorestframework<4.0,>=3.1.3
  Using cached djangorestframework-3.11.1-py3-none-any.whl (911 kB)
Requirement already satisfied: beautifulsoup4<5.0,>=4.5.1 in ./venv/lib/python3.8/site-packages (from wagtail==2.0->-r requirements.txt (line 1)) (4.9.1)
Requirement already satisfied: requests<3.0,>=2.11.1 in ./venv/lib/python3.8/site-packages (from wagtail==2.0->-r requirements.txt (line 1)) (2.24.0)
Requirement already satisfied: django-modelcluster<5.0,>=4.0 in ./venv/lib/python3.8/site-packages (from wagtail==2.0->-r requirements.txt (line 1)) (4.4.1)
Processing /root/.cache/pip/wheels/76/63/57/ba77f284b71e8aa5afd08c85f1968bcfdc8106f12837ce32eb/django_treebeard-4.3.1-py2.py3-none-any.whl
Collecting draftjs-exporter<2.1,>=2.0
  Using cached draftjs_exporter-2.0.0.tar.gz (28 kB)
Collecting Willow<1.2,>=1.1
  Using cached Willow-1.1-py2.py3-none-any.whl (105 kB)
Requirement already satisfied: pytz in ./venv/lib/python3.8/site-packages (from Django==2.0->-r requirements.txt (line 2)) (2020.1)
Collecting django-cogwheels==0.3
  Using cached django_cogwheels-0.3-py3-none-any.whl (35 kB)
Collecting django-appconf>=1.0
  Using cached django_appconf-1.0.4-py2.py3-none-any.whl (6.3 kB)
Collecting rcssmin==1.0.6
  Using cached rcssmin-1.0.6.tar.gz (582 kB)
Collecting rjsmin==1.0.12
  Using cached rjsmin-1.0.12.tar.gz (446 kB)
Collecting libsass>=0.7.0
  Using cached libsass-0.20.1-cp36-abi3-manylinux1_x86_64.whl (9.4 MB)
Collecting mccabe<0.7.0,>=0.6.0
  Using cached mccabe-0.6.1-py2.py3-none-any.whl (8.6 kB)
Requirement already satisfied: setuptools>=30 in ./venv/lib/python3.8/site-packages (from flake8==3.6.0->-r requirements.txt (line 14)) (44.0.0)
Collecting pyflakes<2.1.0,>=2.0.0
  Using cached pyflakes-2.0.0-py2.py3-none-any.whl (53 kB)
Collecting webencodings
  Using cached webencodings-0.5.1-py2.py3-none-any.whl (11 kB)
Collecting six
  Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
Requirement already satisfied: olefile in ./venv/lib/python3.8/site-packages (from Pillow<5.0,>=2.6.1->wagtail==2.0->-r requirements.txt (line 1)) (0.46)
Requirement already satisfied: soupsieve>1.2 in ./venv/lib/python3.8/site-packages (from beautifulsoup4<5.0,>=4.5.1->wagtail==2.0->-r requirements.txt (line 1)) (2.0.1)
Requirement already satisfied: chardet<4,>=3.0.2 in ./venv/lib/python3.8/site-packages (from requests<3.0,>=2.11.1->wagtail==2.0->-r requirements.txt (line 1)) (3.0.4)
Requirement already satisfied: idna<3,>=2.5 in ./venv/lib/python3.8/site-packages (from requests<3.0,>=2.11.1->wagtail==2.0->-r requirements.txt (line 1)) (2.10)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in ./venv/lib/python3.8/site-packages (from requests<3.0,>=2.11.1->wagtail==2.0->-r requirements.txt (line 1)) (1.25.10)
Requirement already satisfied: certifi>=2017.4.17 in ./venv/lib/python3.8/site-packages (from requests<3.0,>=2.11.1->wagtail==2.0->-r requirements.txt (line 1)) (2020.6.20)
Building wheels for collected packages: django-el-pagination, django-libsass, autopep8, Pillow, draftjs-exporter, rcssmin, rjsmin
  Building wheel for django-el-pagination (setup.py): started
  Building wheel for django-el-pagination (setup.py): finished with status 'error'
  Running setup.py clean for django-el-pagination
  Building wheel for django-libsass (setup.py): started
  Building wheel for django-libsass (setup.py): finished with status 'error'
  Running setup.py clean for django-libsass
  Building wheel for autopep8 (setup.py): started
  Building wheel for autopep8 (setup.py): finished with status 'error'
  Running setup.py clean for autopep8
  Building wheel for Pillow (setup.py): started
  Building wheel for Pillow (setup.py): finished with status 'error'
  Running setup.py clean for Pillow
  Building wheel for draftjs-exporter (setup.py): started
  Building wheel for draftjs-exporter (setup.py): finished with status 'error'
  Running setup.py clean for draftjs-exporter
  Building wheel for rcssmin (setup.py): started
  Building wheel for rcssmin (setup.py): finished with status 'error'
  Running setup.py clean for rcssmin
  Building wheel for rjsmin (setup.py): started
  Building wheel for rjsmin (setup.py): finished with status 'error'
  Running setup.py clean for rjsmin
Failed to build django-el-pagination django-libsass autopep8 Pillow draftjs-exporter rcssmin rjsmin
Installing collected packages: Django, webencodings, six, html5lib, Unidecode, Pillow, djangorestframework, django-treebeard, draftjs-exporter, Willow, wagtail, django-el-pagination, Markdown, Pygments, django-cogwheels, wagtailmenus, django-widget-tweaks, django-appconf, rcssmin, rjsmin, django-compressor, libsass, django-libsass, django-environ, mccabe, pyflakes, pycodestyle, flake8, isort, autopep8
    Running setup.py install for Pillow: started
    Running setup.py install for Pillow: finished with status 'error'

License missing

Hello,
it is my understanding that without a valid license file, this project is copyrighted work that nobody can use.
Could you please add a license file ? MIT like most of wagtail related projects would be awesome :).
Best regards,
Frรฉdรฉric

el-pagination bug

Hi,

Great tutorial - I thought I'd try and help by showing you this that I found. It stopped me from doing the pagination piece.

System check identified no issues (0 silenced).
February 07, 2020 - 14:18:37
Django version 3.0.3, using settings 'weedoms_tut.settings.dev'

I ran manage.py 0.0.0.0:8000 and got this error:

File "/usr/local/lib/python3.7/site-packages/el_pagination/models.py", line 8, in <module>
    from django.utils.encoding import iri_to_uri, python_2_unicode_compatible, force_text
ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding' (/usr/local/lib/python3.7/site-packages/django/utils/encoding.py)
^Croot@835235c3d807:/app/weedoms_tut# pip install python_2_unicode_compatible
ERROR: Could not find a version that satisfies the requirement python_2_unicode_compatible (from versions: none)
ERROR: No matching distribution found for python_2_unicode_compatible
WARNING: You are using pip version 20.0.1; however, version 20.0.2 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.

I did a LOT of digging around, then found this:

https://github.com/shtalinberg/django-el-pagination/pull/137/commits/b10a2dc89d63b891345de7e0cb3a391e36ffd1ae - it's a known bug.

and downloaded the repo

$ git branch -a --contains b10a2dc89d63b891345de7e0cb3a391e36ffd1ae
* develop
  remotes/origin/HEAD -> origin/develop
  remotes/origin/develop

just thought it might be worth you knowing.

ModuleNotFoundError: No module named 'captcha'

Not having too much luck with resolving this error with the captcha.

db-1 | 2024-01-26 02:42:39.259 UTC [21] LOG: database system was shut down at 2024-01-25 18:51:39 UTC db-1 | 2024-01-26 02:42:39.262 UTC [1] LOG: database system is ready to accept connections web-1 | PostgreSQL is available web-1 | Traceback (most recent call last): web-1 | File "/app/manage.py", line 22, in <module> web-1 | main() web-1 | File "/app/manage.py", line 18, in main web-1 | execute_from_command_line(sys.argv) web-1 | File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line web-1 | utility.execute() web-1 | File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 420, in execute web-1 | django.setup() web-1 | File "/usr/local/lib/python3.10/site-packages/django/__init__.py", line 24, in setup web-1 | apps.populate(settings.INSTALLED_APPS) web-1 | File "/usr/local/lib/python3.10/site-packages/django/apps/registry.py", line 91, in populate web-1 | app_config = AppConfig.create(entry) web-1 | File "/usr/local/lib/python3.10/site-packages/django/apps/config.py", line 193, in create web-1 | import_module(entry) web-1 | File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module web-1 | return _bootstrap._gcd_import(name[level:], package, level) web-1 | File "<frozen importlib._bootstrap>", line 1050, in _gcd_import web-1 | File "<frozen importlib._bootstrap>", line 1027, in _find_and_load web-1 | File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked web-1 | ModuleNotFoundError: No module named 'captcha' web-1 exited with code 1

Does the book omit a needed import?

On page 15 of the book, there is this line of code:
FieldPanel('categories', widget=forms.CheckboxSelectMultiple),
The book does not mention this needed import:
from django import forms
I am following along in the book and editing my live copy of the code. Without that import satement, the code will not run.
If I 'git checkout 070d8de', then the code will run. But that is not mentioned until the end of Chapter 3.

search_term in template is not recognized

I needed to add blog_page before the search_term to make the following to work. blog_page.search_term

{% if blog_page.search_term %}
  <header class="page-header">
      <h1 class="page-title">Search Results for <span>{{ search_type }}: {{ search_term }}</span></h1>
  </header>
{% endif %}

search_query context

Can you provide more information about how to implement full text search with self.posts.search(search_query)? Which file does this line belong to and where is it inserted? Do I need to import a module for the search function to work?

(Learning wagtail/django. Thank you for the tutorials!)

wagtail search backends issue

I'm on chapter 4.9: Set Up the Site, and I was getting an error upon trying to add the BlogPage:
raise InvalidSearchBackendError("Could not find backend '%s': %s" % (wagtail.search.backends.InvalidSearchBackendError: Could not find backend 'wagtail.search.backends.database':

You go over the fix in chapter 11, but I'm getting the error in chapter 4. I found the answer here: https://docs.wagtail.org/en/v2.8.1/reference/contrib/postgres_search.html
I needed to change the WAGTAILSEARCH_BACKENDS value and add 'wagtail.contrib.postgres_search', as an app in INSTALLED_APPS, among other things found on the above link.

I recommend moving the steps in chapter 11.3 to before chapter 4 to avoid this error.

Blog writeup: Add full snippet of STATICFILES_FINDER

The issue is in regards to the blog post "How to use SCSS/SASS in your Django project (Python Way)" here: https://www.accordbox.com/blog/how-use-scss-sass-your-django-project-python-way/.

This is not an issue per se but a suggestion. I followed the tutorial to incorporate SCSS in my Django project locally (not Production). In your writeup, I suggest you include the full snippet of STATICFILES_FINDERS such as

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'compressor.finders.CompressorFinder',
)

instead of just "add compressor.finders.CompressorFinder" to STATICFILES_FINDERS

Probably this could be intuitive to you but not always for the reader. I never had the STATIC_FINDERS in my settings.py. Earlier I only had compressor.finders.CompressorFinder in STATICFILES_FINDER so my collect static did not export any changes in static files in my app. After including all three Finder in STATICFILES_FINDERS , it works fine.

error version django 2.0

error running project in Django version 2.0

(.myvenv) FJN:wagtail-bootstrap-blog lidiane$ ./manage.py runserver
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x103cf4268>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/config.py", line 558, in configure
    handler = self.configure_handler(handlers[name])
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/config.py", line 731, in configure_handler
    result = factory(**kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/handlers.py", line 150, in __init__
    BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/handlers.py", line 57, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/__init__.py", line 1008, in __init__
    StreamHandler.__init__(self, self._open())
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/__init__.py", line 1037, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/lidiane/Developer/wagtail-bootstrap-blog/logs/django.log'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/lidiane/Developer/wagtail-bootstrap-blog/.myvenv/lib/python3.5/site-packages/django/utils/autoreload.py", line 225, in wrapper
    fn(*args, **kwargs)
  File "/Users/lidiane/Developer/wagtail-bootstrap-blog/.myvenv/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 112, in inner_run
    autoreload.raise_last_exception()
  File "/Users/lidiane/Developer/wagtail-bootstrap-blog/.myvenv/lib/python3.5/site-packages/django/utils/autoreload.py", line 248, in raise_last_exception
    raise _exception[1]
  File "/Users/lidiane/Developer/wagtail-bootstrap-blog/.myvenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 327, in execute
    autoreload.check_errors(django.setup)()
  File "/Users/lidiane/Developer/wagtail-bootstrap-blog/.myvenv/lib/python3.5/site-packages/django/utils/autoreload.py", line 225, in wrapper
    fn(*args, **kwargs)
  File "/Users/lidiane/Developer/wagtail-bootstrap-blog/.myvenv/lib/python3.5/site-packages/django/__init__.py", line 19, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "/Users/lidiane/Developer/wagtail-bootstrap-blog/.myvenv/lib/python3.5/site-packages/django/utils/log.py", line 73, in configure_logging
    logging_config_func(logging_settings)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/config.py", line 795, in dictConfig
    dictConfigClass(config).configure()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/config.py", line 566, in configure
    '%r: %s' % (name, e))
ValueError: Unable to configure handler 'file_handler': [Errno 2] No such file or directory: '/Users/lidiane/Developer/wagtail-bootstrap-blog/logs/django.log'

Error in code?

Hi there, great tutorial!

I notice if you are following the online tutorial in this page
https://blog.michaelyin.info/2017/12/25/how-use-streamfield-wagtail/

it states in blocks.py
class Meta:
template = 'blog/blocks/block.html'

I think this should be column.html?
I just checked here and it is indeed column.html!
https://github.com/michael-yin/wagtail-bootstrap-blog/blob/master/blog/blocks.py

But if you are going thru the online tutorial it might be quite confusing. Thanks! Woof woof.

ERROR [5/5] RUN npm install, node-sass cannot download, get's a 404

Hi, I was trying to run wagtail-bootstrap-blog on my local, but I'm getting the following error. Seems to be an issue when downloading node-sass. I checked the request URL and it does indeed 404.

I'm not sure how to fix this. Looking at the available releases for v5, I don't see an arm64 version: https://github.com/sass/node-sass/releases/

Any suggestions?

 => ERROR [5/5] RUN npm install                                                                                                                                        15.0s
------                                                                                                                                                                       
 > [5/5] RUN npm install:                                                                                                                                                    
#9 10.70                                                                                                                                                                     
#9 10.70 > [email protected] install /app/frontend/node_modules/node-sass                                                                                                      
#9 10.70 > node scripts/install.js                                                                                                                                           
#9 10.70                                                                                                                                                                     
#9 10.88 Downloading binary from https://github.com/sass/node-sass/releases/download/v5.0.0/linux-arm64-72_binding.node
#9 13.36 Cannot download "https://github.com/sass/node-sass/releases/download/v5.0.0/linux-arm64-72_binding.node": 
#9 13.36 
#9 13.36 HTTP error 404 Not Found
#9 13.36 
#9 13.36 Hint: If github.com is not accessible in your location
#9 13.36       try setting a proxy via HTTP_PROXY, e.g. 
#9 13.36 
#9 13.36       export HTTP_PROXY=http://example.com:1234
#9 13.36 
#9 13.36 or configure npm proxy via
#9 13.36 
#9 13.36       npm config set proxy http://example.com:8080
#9 13.40 
#9 13.40 > [email protected] postinstall /app/frontend/node_modules/@babel/polyfill/node_modules/core-js
#9 13.40 > node -e "try{require('./postinstall')}catch(e){}"
#9 13.40 
#9 13.43 Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
#9 13.43 
#9 13.43 The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
#9 13.43 > https://opencollective.com/core-js 
#9 13.43 > https://www.patreon.com/zloirock 
#9 13.43 
#9 13.43 Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
#9 13.43 
#9 13.55 
#9 13.55 > [email protected] postinstall /app/frontend/node_modules/core-js
#9 13.55 > node -e "try{require('./postinstall')}catch(e){}"
#9 13.55 
#9 13.58 Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
#9 13.58 
#9 13.58 The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
#9 13.58 > https://opencollective.com/core-js 
#9 13.58 > https://www.patreon.com/zloirock 
#9 13.58 
#9 13.58 Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
#9 13.58 
#9 13.58 
#9 13.58 > [email protected] postinstall /app/frontend/node_modules/node-sass
#9 13.58 > node scripts/build.js
#9 13.58 
#9 13.65 Building: /usr/local/bin/node /app/frontend/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
#9 13.68 gyp info it worked if it ends with ok
#9 13.68 gyp verb cli [
#9 13.68 gyp verb cli   '/usr/local/bin/node',
#9 13.68 gyp verb cli   '/app/frontend/node_modules/node-gyp/bin/node-gyp.js',
#9 13.68 gyp verb cli   'rebuild',
#9 13.68 gyp verb cli   '--verbose',
#9 13.68 gyp verb cli   '--libsass_ext=',
#9 13.68 gyp verb cli   '--libsass_cflags=',
#9 13.68 gyp verb cli   '--libsass_ldflags=',
#9 13.68 gyp verb cli   '--libsass_library='
#9 13.68 gyp verb cli ]
#9 13.68 gyp info using [email protected]
#9 13.68 gyp info using [email protected] | linux | arm64
#9 13.68 gyp verb command rebuild []
#9 13.68 gyp verb command clean []
#9 13.69 gyp verb clean removing "build" directory
#9 13.69 gyp verb command configure []
#9 13.70 gyp verb find Python Python is not set from command line or npm configuration
#9 13.70 gyp verb find Python Python is not set from environment variable PYTHON
#9 13.70 gyp verb find Python checking if "python3" can be used
#9 13.70 gyp verb find Python - executing "python3" to get executable path
#9 13.70 gyp verb find Python - "python3" is not in PATH or produced an error
#9 13.70 gyp verb find Python checking if "python" can be used
#9 13.70 gyp verb find Python - executing "python" to get executable path
#9 13.71 gyp verb find Python - "python" is not in PATH or produced an error
#9 13.71 gyp verb find Python checking if "python2" can be used
#9 13.71 gyp verb find Python - executing "python2" to get executable path
#9 13.71 gyp verb find Python - "python2" is not in PATH or produced an error
#9 13.71 gyp ERR! find Python 
#9 13.71 gyp ERR! find Python Python is not set from command line or npm configuration
#9 13.71 gyp ERR! find Python Python is not set from environment variable PYTHON
#9 13.71 gyp ERR! find Python checking if "python3" can be used
#9 13.71 gyp ERR! find Python - "python3" is not in PATH or produced an error
#9 13.71 gyp ERR! find Python checking if "python" can be used
#9 13.71 gyp ERR! find Python - "python" is not in PATH or produced an error
#9 13.71 gyp ERR! find Python checking if "python2" can be used
#9 13.71 gyp ERR! find Python - "python2" is not in PATH or produced an error
#9 13.71 gyp ERR! find Python 
#9 13.71 gyp ERR! find Python **********************************************************
#9 13.71 gyp ERR! find Python You need to install the latest version of Python.
#9 13.71 gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
#9 13.71 gyp ERR! find Python you can try one of the following options:
#9 13.71 gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
#9 13.71 gyp ERR! find Python   (accepted by both node-gyp and npm)
#9 13.71 gyp ERR! find Python - Set the environment variable PYTHON
#9 13.71 gyp ERR! find Python - Set the npm configuration variable python:
#9 13.71 gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
#9 13.71 gyp ERR! find Python For more information consult the documentation at:
#9 13.71 gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
#9 13.71 gyp ERR! find Python **********************************************************
#9 13.71 gyp ERR! find Python 
#9 13.71 gyp ERR! configure error 
#9 13.71 gyp ERR! stack Error: Could not find any Python installation to use
#9 13.71 gyp ERR! stack     at PythonFinder.fail (/app/frontend/node_modules/node-gyp/lib/find-python.js:302:47)
#9 13.71 gyp ERR! stack     at PythonFinder.runChecks (/app/frontend/node_modules/node-gyp/lib/find-python.js:136:21)
#9 13.71 gyp ERR! stack     at PythonFinder.<anonymous> (/app/frontend/node_modules/node-gyp/lib/find-python.js:179:16)
#9 13.71 gyp ERR! stack     at PythonFinder.execFileCallback (/app/frontend/node_modules/node-gyp/lib/find-python.js:266:16)
#9 13.71 gyp ERR! stack     at exithandler (child_process.js:315:5)
#9 13.71 gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:327:5)
#9 13.71 gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
#9 13.71 gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
#9 13.71 gyp ERR! stack     at onErrorNT (internal/child_process.js:470:16)
#9 13.71 gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:84:21)
#9 13.71 gyp ERR! System Linux 5.10.25-linuxkit
#9 13.71 gyp ERR! command "/usr/local/bin/node" "/app/frontend/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
#9 13.71 gyp ERR! cwd /app/frontend/node_modules/node-sass
#9 13.71 gyp ERR! node -v v12.22.4
#9 13.71 gyp ERR! node-gyp -v v7.1.2
#9 13.71 gyp ERR! not ok 
#9 13.71 Build failed with error code: 1
#9 13.97 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
#9 13.97 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm64"})
#9 13.97 
#9 14.04 npm ERR! code ELIFECYCLE
#9 14.04 npm ERR! errno 1
#9 14.04 npm ERR! [email protected] postinstall: `node scripts/build.js`
#9 14.04 npm ERR! Exit status 1
#9 14.04 npm ERR! 
#9 14.04 npm ERR! Failed at the [email protected] postinstall script.
#9 14.04 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
#9 14.12 
#9 14.12 npm ERR! A complete log of this run can be found in:
#9 14.12 npm ERR!     /root/.npm/_logs/2021-07-31T02_43_41_517Z-debug.log
------
executor failed running [/bin/sh -c npm install]: exit code: 1
ERROR: Service 'frontend' failed to build : Build failed

Project stuck on "website-web-1 | Waiting for PostgreSQL to become available..." on M1 Mac

What happened?

I've followed the steps described on the e-book "Build Blog With Wagtail CMS (4.0.0)" on my M1 Mac and when Dockerizing the project (Chapter 4) I start encountering this issue.

The docker image and container build just fine but when I run the docker-compose logs -f command I encounter this issue

Screenshot 2023-02-02 at 10 43 58 AM

Additional details

I've followed the steps correctly, and the Dockerfile, the entrypoint, the start and the docker-compose.yml all match the book.

With the exact same configuration on my Windows 10 PC I don't encounter any problems at all.

'Page' object has no attribute 'reverse_subpage' Error

Hi there again, so the error I had earlier in the day was this mainly. After trying quite a bit to troubleshoot, I decided to give up and restart by cloning your git and starting with a fresh new virtualenv.

However, I still get this same error.

It traces to anywhere such in the components folder such as sidebar.html, etc

I tried with your version of wagtail in requirements folder such as 1.10.1 as well as the newer version.

Pagination external IP

I'm running this on a ubuntu VPS to check it out but i can't seem to find the correct port change.

The blog pages keep the :8000 port as internal link but the nginx configuration is proxied for 80 so it's not accepting it,

What config part do i need to change?

Kind regards.

wagtail-tailwind-blog-web-1 | Waiting for PostgreSQL to become available.

in the docker the webapp keeps looking for db to get healthy

wagtail-tailwind-blog-db-1   |
wagtail-tailwind-blog-db-1   | PostgreSQL Database directory appears to contain a database; Skipping initialization
wagtail-tailwind-blog-db-1   |
wagtail-tailwind-blog-db-1   | 2023-12-10 19:18:34.098 UTC [1] LOG:  starting PostgreSQL 14.0 on aarch64-unknown-linux-musl, compiled by gcc (Alpine 10.3.1_git20210424) 10.3.1 20210424, 64-bit
wagtail-tailwind-blog-db-1   | 2023-12-10 19:18:34.098 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
wagtail-tailwind-blog-db-1   | 2023-12-10 19:18:34.098 UTC [1] LOG:  listening on IPv6 address "::", port 5432
wagtail-tailwind-blog-db-1   | 2023-12-10 19:18:34.100 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
wagtail-tailwind-blog-db-1   | 2023-12-10 19:18:34.104 UTC [21] LOG:  database system was shut down at 2023-12-10 19:18:05 UTC
wagtail-tailwind-blog-db-1   | 2023-12-10 19:18:34.113 UTC [1] LOG:  database system is ready to accept connections
wagtail-tailwind-blog-web-1  | Waiting for PostgreSQL to become available...
wagtail-tailwind-blog-web-1  | Waiting for PostgreSQL to become available...
wagtail-tailwind-blog-web-1  | Waiting for PostgreSQL to become available...
wagtail-tailwind-blog-web-1  | Waiting for PostgreSQL to become available...
wagtail-tailwind-blog-web-1  | Waiting for PostgreSQL to become available...
wagtail-tailwind-blog-web-1  | Waiting for PostgreSQL to become available...
wagtail-tailwind-blog-web-1  | Waiting for PostgreSQL to become available...
wagtail-tailwind-blog-web-1  | Waiting for PostgreSQL to become available..

ModuleNotFoundError: No module named 'captcha'

Hi I am building the docker containers on an Apple Silicone M2 machine. I managed to do so by forcing to build for linux/amd64. But now I get an error message that there is no module called captcha. But it is in the requirements.txt. Does anyone have an idea how to solve this issue? Thank you

image image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.