Skip to content

MattSegal/django-pytest-github-actions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minimal Django + Pytest + GitHub Actions example

This minimal example shows you how you can runs pytest on your Django app on every commit using GitHub Actions. This is an example project for this blog post.

Installation

Follow these instructions to setup this demo out locally. This requires Python 3 and the pip package manager.

# Create virtual environment
python -m venv env

# Activate virtual environment (Bash for Linux or Mac)
. env/bin/activate

# Activate virtual environment (cmd / PowerShell for Windows)
./env/Scripts/activate

# Install requirements
pip install -r requirements.txt

Running tests

# Activate virtual environment (Bash for Linux or Mac)
. env/bin/activate

# Go into the Django application folder
cd app

# Run pytest
pytest -vv

Running the server

# Activate virtual environment (Bash for Linux or Mac)
. env/bin/activate


# Go into the Django application folder
cd app

# Setup database.
./manage.py migrate

# Run the development server.
./manage.py runserver

# Now you can view the project at http://localhost:8000

About

Minimal example of getting Django + PyTest running on GitHub Actions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages