Skip to content

Latest commit

 

History

87 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-react-boilerplate.png

python-react-boilerplate2.png

python-react-boilerplate

(08-Apr-2022) An MVC Python Django (5.2 LTS) boilerplate with React 19 Redux SPA.

Using Postman?

Get Postman HTTP client.

Postman API Collection for Python React Boilerplate.

Postman API Environment for Python React Boilerplate.

Requirements

Installation

# Make sure to set DEBUG to True. This is required for running the React app locally.
cp .env.example .env

python -m venv env
source env/bin/activate

pip install -r requirements.txt

python manage.py makemigrations
python manage.py migrate
python manage.py seed

cd frontend
cp .env.example .env
yarn
yarn build
# In root .env, set DEBUG=True
yarn start

Database Seeding

# Seed database with demo user (Jane Doe) and 30 fake users (default)
python manage.py seed

# Seed a specific number of fake users
python manage.py seed --users 50

# Seed with a custom password (default: secret)
python manage.py seed --password custompass

# Undo/clean seeded users from the database
python manage.py seed --undo

Usage

python manage.py runserver
# http://localhost:8000

Using Docker?

alias compose='docker-compose -f local.yml'
compose build
compose up
# http://localhost:8000

Existing Admin User When Using Docker

The admin user details are set in ./compose/local/django/start.

export DJANGO_SUPERUSER_PASSWORD="${DJANGO_SUPERUSER_PASSWORD:-secret}"

python manage.py createsuperuser \
  --no-input \
  --username admin_user \
  --email admin@django-app.com

Using Docker's Mail Server

docker-mailhog.png

Mail environment credentials are at .env.

The Mailhog Docker mail client runs at http://localhost:8025. This is running in the above image that is receiving emails from your Django app.

iPython Django Shell

python manage.py shell -i ipython

API

python manage.py show_urls

Cache View Templates

This includes the React app build files.

python manage.py collectstatic

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

BSD

About

(08-Apr-2022) An MVC Python Django (5.2 LTS) boilerplate with React 19 Redux SPA.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages