- The website supports multiple languages.
- The home page contains three sections: Image Slider, Vision, and News.
- Each section is implemented using Wagtail's
StreamField
and custom blocks.
- A
NewsPage
is implemented to display news articles with images. - News articles are paginated.
- All news content is managed via the Wagtail admin interface.
- The header and footer navigation bars are dynamic.
- You can select any page from the Wagtail admin and assign it a custom title for the header or footer.
Follow these steps to set up the project locally:
Clone the repository from GitHub:
git clone https://github.com/Meirna-kamal/wagtail-project.git
cd wagtail-project
Ensure you have Python 3.9 installed. Then, create a virtual environment:
python -m venv venv
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
Once the virtual environment is activated, install the required dependencies:
pip install -r requirements.txt
Ensure you have Python 3.9 installed. Then, create a virtual environment:
python manage.py makemigrations
python manage.py migrate
Create an admin account for accessing the Wagtail admin panel:
python manage.py createsuperuser
Start the development server:
python manage.py runserver
- Visit http://127.0.0.1:8000/ in your browser to see the site, and access the Wagtail admin interface at http://127.0.0.1:8000/admin/.
To run Ruff linting on your project, execute the following command:
ruff check .
The project uses Ruff for linting with the following configuration:
- Target Python Version: The linting is configured for Python 3.9.
- Line Length: The maximum allowed line length is set to 79 characters.
- Types of Issues Selected:
- Errors (E): Critical issues that need to be fixed.
- Warnings (W): Potential problems that should be addressed.
- Style and Formatting Issues (F): Problems related to code style and formatting.
- Complexity Issues (C): Concerns about the complexity of the code.
Certain files are excluded from linting because they are auto-generated by Django and typically do not require manual linting:
wagtail_project/settings/production.py
wagtail_project/settings/dev.py
wagtail_project/settings/base.py
manage.py
- Access the Wagtail admin interface.
- Navigate to the HomePage and insert the sections:
- Image Slider Section: Allows multiple images.
- Vision Section: Requires an image, title, and text.
- News Section: Requires an image, title, and text.
- Note: Only one type of each section is allowed.
- Add a new
NewsPage
as a child page under the Home Page. - Title the page News Page.
- It will be accessible through the URL path
/news-page/
.
- Go to Settings → Locales.
- Click Add a Locale and select Spanish.
- Click Save to add the Spanish locale.
- After enabling Spanish translation, you will have the option to translate the Home Page.
- Provide the Spanish translation for all content on the Home Page.
- Go to the Snippet section in Wagtail.
- Create Header & Footer menus.
- Add the desired pages to the header and footer menus as needed.