GithubHelp home page GithubHelp logo

fierroformo / luke Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ggonz/luke

0.0 1.0 0.0 314 KB

Simple scripts and templates for scaffolding a basic Django project

License: Apache License 2.0

Shell 36.84% Python 63.16%

luke's Introduction

Luke

Simple scripts and templates for scaffolding a basic Django project

Prerequisites

Usage

  1. Download the repository's tarball and extract it to your project's directory

    $ mkdir myproject
    $ cd myproject
    $ wget https://github.com/vinco/luke/archive/master.tar.gz -O - | tar -xz --strip 1
  2. Set your project's name in evironments.json, fabfile.py and provision/provision.sh

    # myproject/environments.json
    {
        "vagrant": {
            "django_settings": "myproject.settings.devel",
        }
    }
    # myproject/fabfile.py
    ...
    # urun('createdb luke -l en_US.UTF-8 -E UTF8 -T template0')
    urun('createdb myproject -l en_US.UTF-8 -E UTF8 -T template0')
    ... 
    # urun('dropdb luke')
    urun('dropdb myproject')
    ...
    # myproject/provision/provision.sh
    ...
    # PROJECT_NAME=luke
    PROJECT_NAME=myproject
    ...
  3. Create the virtual machine

    $ vagrant up
  4. Redirect the required domains to your localhost

    # /etc/hosts
    192.168.33.2  http://luke.local/
  5. Build the environment inside the virtual machine

    $ fab environment:vagrant bootstrap
  6. Run the development server

    $ fab environment:vagrant runserver
  7. Init your repository

    $ git init

Testing

  1. Set your project's name in tox.ini.

    # change name
    application-import-names = myproject
    
    DJANGO_SETTINGS_MODULE = myproject.settings.testing
    
    norecursedirs =
        .*
        src/requirements
        src/myproject/settings
  2. Open vagrant environment from ssh:

    $ vagrant ssh
  3. Change directory to /vagrant:

    $ cd /vagrant
  4. Install tox inside the virtual machine:

    $ pip install tox
  5. Run the proper command with tox:

# Run the full test suite including the PEP8 linter.
$ tox

# Run only the PEP8 linter.
$ tox -e py27-flake8

# Run only the test suite.
$ tox -e py27-django

# Pass -r flag to recreate the virtual environment when requirements changes.
$ tox -r

# Run the test suite to a specific file.
$ tox -e py27-django src/luke/core/api/tests/test_serializers.py

luke's People

Contributors

jualjiman avatar paula-em-lafon avatar

Watchers

Alejandro Betancourt avatar

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.