Django manages media based on the following definitions:
BASE_DIR = /var/praekelt/telkom-spliceworks/
MEDIA_ROOT = "%s/media/" % BASE_DIR
*.img | |
*.raw |
Da próxima vez que você se encontrar pesquisando alguma nova tecnologia interessante para (re)construir sua arquitetura, peço que você pare e siga UNPHAT:
{ pkgs ? import <nixpkgs> {}}: | |
let | |
lib = pkgs.lib; | |
makeImageFromDebDist = | |
{ name, fullName, size ? 4096, urlPrefix | |
, packagesList ? "", packagesLists ? [packagesList] | |
, packages, extraPackages ? [], postInstall ? "" | |
, extraDebs ? [] | |
, QEMU_OPTS ? "", memSize ? 512 | |
, createRootFS }: |
-- | |
-- ** setting up example tables and data ** | |
-- | |
-- | |
CREATE TABLE task ( | |
id BIGSERIAL , | |
name TEXT, | |
parent_id BIGINT REFERENCES task(id), | |
PRIMARY KEY (id) |
class DatabaseWrapper(BaseDatabaseWrapper): | |
SEARCH_PAGE_SIZE=999 | |
def __init__(self, *args, **kwargs): | |
super(DatabaseWrapper, self).__init__(*args, **kwargs) | |
self.charset = "utf-8" | |
self.creation = DatabaseCreation(self) | |
self.features = DatabaseFeatures(self) | |
if django.VERSION > (1, 4): | |
self.ops = DatabaseOperations(self) |
This guide was written because I don't particularly enjoy deploying Phoenix (or Elixir for that matter) applications. It's not easy. Primarily, I don't have a lot of money to spend on a nice, fancy VPS so compiling my Phoenix apps on my VPS often isn't an option. For that, we have Distillery releases. However, that requires me to either have a separate server for staging to use as a build server, or to keep a particular version of Erlang installed on my VPS, neither of which sound like great options to me and they all have the possibilities of version mismatches with ERTS. In addition to all this, theres a whole lot of configuration which needs to be done to setup a Phoenix app for deployment, and it's hard to remember.
For that reason, I wanted to use Docker so that all of my deployments would be automated and reproducable. In addition, Docker would allow me to have reproducable builds for my releases. I could build my releases on any machine that I wanted in a contai
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
def handle(self, *app_labels, **options): | |
# Generate a migrations manifest with latest migration on each app | |
super(Command, self).handle(*app_labels, **options) | |
loader = MigrationLoader(None, ignore_no_migrations=True) | |
apps = sorted(loader.migrated_apps) | |
graph = loader.graph | |
with open('latest_migrations.manifest', 'w') as f: | |
for app_name in apps: |
Afeganistão - Afegã | |
África do Sul - Sul-africana | |
Albânia - Albanês | |
Alemanha - Alemã | |
Andorra - Andorrana | |
Angola - Angolana | |
Anguilla - Anguilana | |
Antárctida - | |
Antígua e Barbuda - Antiguana | |
Antilhas Holandesas - Antilhana |