Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raq929/wagtail-project-template
A template for a Wagtail project with basic apps and a Webpack setup allowing developers to use React.
https://github.com/raq929/wagtail-project-template
django wagtail
Last synced: about 2 months ago
JSON representation
A template for a Wagtail project with basic apps and a Webpack setup allowing developers to use React.
- Host: GitHub
- URL: https://github.com/raq929/wagtail-project-template
- Owner: raq929
- License: bsd-3-clause
- Created: 2017-08-07T19:31:14.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T23:58:43.000Z (about 2 years ago)
- Last Synced: 2024-10-24T08:28:50.611Z (3 months ago)
- Topics: django, wagtail
- Language: Python
- Homepage:
- Size: 120 KB
- Stars: 14
- Watchers: 6
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Wagtail Project Template
> A template for a Wagtail project with basic apps and a Webpack setup.
## Table of Contents
* [Requirements](#requirements)
* [Create a new repo](#create-a-new-repo)
* [Development](#development)
* [Quick start](#quick-start)
* [Adding requirements](#adding-requirements)
* [Database configuration](#database-configuration)
* [Managment commands](#management-commands)## Requirements
* Python 3
* `virtualenv` or [`virtualenvwrapper`](https://virtualenvwrapper.readthedocs.io/en/latest/install.html)## Create a new repo from this template.
1. Clone this repo
1. Create a new virtualenv for your project and run `pip install django`
1. Create a new project from the template by running `django-admin startproject --template=wagtail-project-template`
1. `cd` into your new project directory and run `git init` to initialize a git repository. Make an initial commit.
1. Open your new project in a text editor and replace all instances of `project_name` with your project name.
1. Change this README to be relevant to your project.
1. Create a database using the instructions below.## Development
### Quick start
1. [Create a virtualenv](https://virtualenvwrapper.readthedocs.io/en/latest/command_ref.html#mkvirtualenv) for this project (using python3)
1. `pip install -r dev-requirements.txt`
1. In a new window `npm install` then `npm start`
1. Start postgresql
1. `createdb `
1. `DATABASE_URL=postgres:///iai ./manage.py migrate`
1. `DATABASE_URL=postgres:///iai ./manage.py createdevdata`
1. `DATABASE_URL=postgres:///iai ./manage.py runserver`### Requirements
Use [`pipenv`](https://docs.pipenv.org/) to manage requirements.1. `pipenv install --three` # Creates a virtualenv with python3 and installs normal dependencies
1. `pipenv install --dev` # Installs dev dependencies
1. `pipenv install ` # Installs the package and automatically updates `Pipfile` and `Pipfile.lock`.### Database configuration
The first time you run, you'll need to run migrations and create a superuser:
```bash
python manage.py migrate # Create/sync the database.
python manage.py createsuperuser # Create an initial user.
`````base.py`` will use sqlite3 by default.
You can use postgres with the ``DATABASE_URL`` environment variable.```bash
createdb project_name
DATABASE_URL=postgres:///project_name python manage.py migrate
```The format for `DATABASE_URL` urls is
`://:@:/`
If no database is specified, the default is a SQLite database.You can now run the server: `DATABASE_URL=postgres:///project_name ./manage.py runserver`
### Management commands
- createdevdata [--delete]
-
This command creates a basic Wagtail site and a superuser. It calls all other management commands related to development data. The delete flag deletes all data before creating new data.
- createhomepage [--delete]
-
This command creates a homepage and Wagtail Site if they do not already exist. If called with the delete flag, deletes all pages except the root and creates a homepage. You will need to restart the server after running this command, as the Wagtail site number will change.
- createblogposts
-
This command creates a blog index page (if it does not already exist) and the specified number of blog posts.
## [LICENSE](LICENSE.md)