https://github.com/MattSegal/django-pytest-github-actions
Minimal example of getting Django + PyTest running on GitHub Actions
https://github.com/MattSegal/django-pytest-github-actions
Last synced: 2 months ago
JSON representation
Minimal example of getting Django + PyTest running on GitHub Actions
- Host: GitHub
- URL: https://github.com/MattSegal/django-pytest-github-actions
- Owner: MattSegal
- Created: 2022-01-05T09:26:04.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-13T07:08:46.000Z (over 3 years ago)
- Last Synced: 2024-10-11T07:12:24.898Z (6 months ago)
- Language: Python
- Size: 6.84 KB
- Stars: 5
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- stars - MattSegal/django-pytest-github-actions - Minimal example of getting Django + PyTest running on GitHub Actions (Python)
- stars - MattSegal/django-pytest-github-actions - Minimal example of getting Django + PyTest running on GitHub Actions (Python)
README
# 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](https://mattsegal.dev/django-with-pytest-on-github-actions.html).## Installation
Follow these instructions to setup this demo out locally.
This requires Python 3 and the pip package manager.```bash
# 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
```bash
# 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
```bash
# 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
```