Proyecto demo para el evento PyCaribbean
-
Fork the repo with your Github's user
-
Clone your fork
$ git clone --recursive git@github.com:{ your username }/pycarribean.git -
Create the virtual machine
$ cd pycarribean $ vagrant up -
Build the environment inside the virtual machine
$ fab environment:vagrant bootstrap
-
Run the development server
$ fab environment:vagrant runserver
Create new migrations based on the changes detected in the project's model. [+]
# Creating migrations for the whole project
$ fab environment:vagrant makemigrations
# Creating migrations for a specific app
$ fab environment:vagrant makemigrations:some_app
# Passing options to the command
$ fab environment:vagrant makemigrations:some_app,empty=trueSync the database with the current set of models and migrations. [+]
# Syncing the whole project
$ fab environment:vagrant migrate
# Syncing a specific app
$ fab environment:vagrant migrate:some_app
# Syncing a specific app to a specific migration state
$ fab environment:vagrant migrate:some_app,0001
# Passing options to the command
$ fab environment:vagrant migrate:some_app,0001,fake=trueDrop and rebuild a fresh database instance for the project.
$ fab environment:vagrant resetdbInstall the Python dependencies for the project specified in the proper requirements file for the given environment.
# Installing dependencies
$ fab environment:vagrant pip_install
# Install and upgrading dependencies
$fab environment:vagrant pip_install:upgrade=TrueRun the development server inside the virtual machine.
$ fab environment:vagrant runserverPut the previously selected production/staging environment in maintenance mode
(on) or bring it back to serve the application (off).
Note that when the environment is in maintenance mode it will return an HTTP 503 code to all requests and show a temporary placeholder page. This page must
be located at maintenance/index.html and can only reference assets from the
maintenance/assets directory.
# Activate maintenance mode in staging environment
$ fab environment:staging maintenance:on
# Deactivate maintenance mode in staging environment
$ fab environment:staging maintenance:offDeploy the code from the given git reference (a branch or commit) to the previously selected production/staging environment.
# Deploy to staging environment from commit abcdefg
$ fab environment:staging deploy:abcdefg
# Deploy to production environment from master branch
$ fab environment:production deploy:master
# Tell to the deploy task to upgrade the project's requirements during the
# deployment process
$ fab environment:production deploy:master,upgrade=true