Services Blog Français

Getting started with Elm

| by jpic | elm

This article was created by Thomas Binetruy as he’s into R&D around Elm for YourLabs but maybe it will help you too !

Introduction

In this short tutorial, we create a basic counter application that changes the title color based on the counter value. We first define our state model, its transitions, and finally our view - function of our current application state.

Setup code

Here are the necessary imports:

elm import Browser import Html exposing (Html, button, div, text, h1) import Html.Events exposing (onClick) import Html.Attributes exposing (alt, class, classList, href, src, title, style)

Read More

clilabs 1.1.1 release

| by jpic | django python best-practice

Clilabs now benefit a new command that automates a series of 3 lines that’s I’ve been typing over and over again during 10 years of Django hacking.

$ clilabs help +django:settings Setting up django has failed ! DJANGO_SETTINGS_MODULE env var not set ! Show settings from django.

How many times have you done the following ?

python manage.py shell
from django.conf import settings
settings.DATABASES # or something

Well it’s over now ! Try this instead:

Read More

Quote post

| by jpic | best-practice

jpic, h4x0|2 & founder @ YourLabs

Phase 1: believe the world is waiting for you, Phase 2: realize the world is not waiting for you, Phase 3: stop waiting for the world.

clilabs: the Python CLI to get things done, with Django support

| by jpic

Sometimes I want to execute a python callback with some args on the command line, but i get frustrated that it always requires to wrap my command in a wrapper of some sort. Then, I want to do generic CRUD operations from the command line in my automation tool. Clilabs unfrustrates me.

Get started:

$ pip install clilabs $ clilabs clilabs automates python callables parametered calls.

Things starting with - will arrive in clilabs.context.

Read More

djcli: the new Django automation CLI command

| by jpic | python django devops

djcli is the package , a new CLI under design phase, it is a simple python package, that provides a command with name djcli, to do more with Django on the CLI:

$ pip install djcli

find the content for this variable in your project manage.py

$ export DJANGO_SETTINGS_MODULE=your.settings

you will probably run this from your directory parent to manage.py:

$ djcli create auth.user username=pony is_superuser=1

i just checked and chpasswd command in django supports only interactive

$ djcli chpasswd /path/to/password username=pony

Read More

playlabs: 30 seconds overview

| by jpic | playlabs linux python ansible best-practice

Quick version of the previous article on playlabs

$ playlabs Playlabs: the obscene ansible distribution.

Init your ssh user with your key and secure sshd and passwordless sudo:

playlabs init root@1.2.3.4
# all options are ansible options are proxied
playlabs init @somehost --ask-become-pass

Now your user can install roles:

playlabs install docker,firewall,nginx @somehost

And deploy a project, examples:

playlabs @somehost deploy image=betagouv/mrs:master
playlabs @somehost deploy
    image=betagouv/mrs:master
    plugins=postgres,django,uwsgi
    backup_password=foo
    prefix=ybs
    instance=hack
    env.SECRET_KEY=itsnotasecret
playlabs @somehost deploy
    prefix=testenv
    instance=$CI_BRANCH
    image=$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA

If you have that work, creating an inventory is the way to move on, wether you want to version configuration, add a deploy user for your CI, configure a secret backup password, add ssh-keys …:

Read More
Previous Page 9 of 33 Next Page

They trust us

Contact

logo