View Code? Open in Web Editor
NEW
This project forked from mdn /django-locallibrary-tutorial
Local Library website written in Django; example for the MDN server-side development Django module: https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django.
License: Creative Commons Zero v1.0 Universal
Python 81.43%
CSS 0.11%
HTML 16.11%
PowerShell 2.35%
django-locallibrary-tutorial's People
Watchers
django-locallibrary-tutorial's Issues
Initial psakefile.ps1
Properties {
$requiredDirectories = @ (
' .git' ,
' venv_locallibrary' ,
' manage.py'
)
}
TaskSetup {
Set-Location $PSScriptRoot
}
Task precondition `
- alias pre `
- description ' Required before running other tasks' {
foreach ($dir in $requiredDirectories ) {
Assert $ (Test-Path $dir ) " $dir is missing"
}
}
Task activate `
- alias act `
- depends precondition `
- description ' Activate project virtual environment' {
$activate_script = ' ./venv_locallibrary/Scripts/activate.ps1'
Assert $ (Test-Path $activate_script ) " $activate_script is missing"
Invoke-Expression $activate_script
}
Task runserver `
- alias run `
- depends activate `
- description ' Start django development server' {
python manage.py runserver 8000
}
Task deactivate `
- alias deact `
- depends precondition `
- description ' Deactivate project virtual environment' {
$deactivate_command = (Get-Command deactivate - ErrorAction SilentlyContinue)
$has_deactivate = ($deactivate_command -and $True )
Assert $has_deactivate ' deactivate command not found'
deactivate
}