Code Monkey home page Code Monkey logo

developer-portfolio's Introduction

๐Ÿš€ Wagtail startup website

This project has been created using the amazing Wagtail CMS.

This project is meant to be a minimalistic Wagtail site demo, which can be referenced to build a more extensive Wagtail site. This differs from the wagtail start mysite mysite site as it contains some of the basics I find I almost always need, such as frontend tooling, CI, pre-commit linting, hosting configuration (e.g. Fly.io), etc.

For this stack, I'm aiming to keep the dependencies light so that this website can be cheaply (if not freely) hosted using minimal resources.

Also worth checking out the Wagtail Bakery demo site which uses a different stack. The main difference being that this uses SQLite instead of postgres.

Document contents

Installation

We use Docker to set up a local build for development.

Dependencies

To build the container:

git clone https://github.com/victoriachan/wagtail-startup-site.git
cd wagtail-startup-site
docker-compose build

To start the container and gunicorn, run:

docker-compose up -d

The local site will now be accessible at http://localhost:8000/ and the Wagtail admin interface at http://localhost:8000/admin/.

To run bash on the container:

docker-compose exec web bash

You can then run the usual Wagtail commands:

./manage.py collectstatic
./manage.py migrate
./manage.py createsuperuser

Backup and restore

Database

This site uses SQLite database. To backup / restore the database, simply copy and replace the data/db.sqlite3 file. On local builds, this file is mounted as a bind mount, and will persist between docker builds unless explicitly deleted.

Media files (images and docs)

Similarly, the data/media (Wagtail Image and Document files) directory is mounted as a bind mount, and will persist between docker builds unless explicitly deleted. Likewise, it can be backed up and restored by simply copying and replacing the directory.

To stop the container:

docker-compose stop

Debugging

To tail the logs from the Docker containers in realtime, run:

docker-compose logs -f

Backend development

Updating backend dependencies

We use pip-tools to manage these.

To update pip packages, edit requirements.in, and then run:

pip-compile --allow-unsafe --generate-hashes
pip install -r requirements.txt

Frontend development

Frontend css and js src files are in static_src/ directory, and are compiled into static_compiled/. By default if not changing any frontend files, the CSS and JS should already be compiled on a fresh docker build.

For working with frontend files, see documentation about Frontend tooling.

developer-portfolio's People

Contributors

victoriachan avatar

Watchers

 avatar

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.