Hello! I'm currently an Outreachy applicant in the contribution stage. I'm a Django developer excited about Wagtail projects. In this article, I'll show you how to set up Wagtail on your Windows machine, sharing what I've learned so far.
Prerequisites
Before starting, make sure your Windows system has the following installed:
- Git installed.
- Python installed.
- node version 18.0.0 installed.
Windows Subsystem for Linux(WSL) Installation Guide.
On your Windows machine, do the following;
- Open settings > apps> > optional features > more Windows features >.
- Enable WSL and reboot your system.
- Visit the Microsoft store. Install Ubuntu and follow the prompts, take note of the password requested as you will use it quite often.
Wagtail Installation Guide.
Fork the repository by clicking on this link.
-
From your Ubuntu terminal, create a directory and enter into that directory, create a virtual environment and activate it.
mkdir wagtail && cd wagtail python3 -m venv venv source venv/bin/activate
-
Copy the URL of your fork of the repository, just like I did in the picture below.
-
Clone your copy of the repository.
git clone https://github.com/Chidera6/wagtail.git #[YOUR_FORKED_REPO_URL] cd wagtail
-
Install the necessary dependencies.
pip install -e ."[testing,docs]" -U
-
Install the tool chain for building static assets and compile the assets.
npm ci npm run build
-
Run migrations for the test models using the code below.
django-admin makemigrations --settings=wagtail.test.settings
-
Start the server with the code below. You should see this file-
ui_tests.db
in/wagtail/test/
, if everything went well.
export DJANGO_SETTINGS_MODULE=wagtail.test.settings_ui ./wagtail/test/manage.py migrate #Create the tables. ./wagtail/test/manage.py createcachetable #create a cache table ./wagtail/test/manage.py runserver 0:8000 #starts the server
-
In another terminal, and with your virtual environment activated, compile the UI component.
npm run storybook
Now, when you visit the URL http://localhost:8000 in your browser, you should see the output below indicating that the server is running successfully.
Note
The official Wagtail documentation offers different setup guides based on your goals.
If this guide did not capture what you wanted, you could look it up for clarity.
Feedback and Corrections
I aim for accuracy in this guide. If you find any errors or have suggestions for improvement, please get in touch with me at onumajurubenedicta@gmail.com.
Conclusion
Congratulations! You've successfully enabled Wagtail for development on your Windows OS. Happy coding!
References
Wagtail documentation
Wagtail repository
Top comments (0)