Giter VIP home page Giter VIP logo

phucnguyen81 / django-locallibrary-tutorial Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mdn/django-locallibrary-tutorial

0.0 0.0 0.0 169 KB

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

Contributors

alextugarev avatar chrisdavidmills avatar desagaz avatar f1ashhimself avatar hamishwillee avatar j9peters avatar lmeerwood avatar mozilla-github-standards avatar phucnguyen81 avatar vladyslavhnatchenko avatar

Watchers

 avatar

django-locallibrary-tutorial's Issues

Start using powershell psake as task runner

  • Add initial file psakefile.ps1 for psake
  • Add activate.ps1 to activate the virtual environment
  • Add initial tasks: precondition and runserver

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
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.