Skip to content

Instantly share code, notes, and snippets.

@taufiqibrahim
Last active August 18, 2019 09:02
Show Gist options
  • Save taufiqibrahim/93efc553ce1c6594259e9113916ddea5 to your computer and use it in GitHub Desktop.
Save taufiqibrahim/93efc553ce1c6594259e9113916ddea5 to your computer and use it in GitHub Desktop.
Containers information stored as Django model
from django.contrib import admin
from dockerman.models import Container
@admin.register(Container)
class ContainerAdmin(admin.ModelAdmin):
pass
DockerAppHost DockerAppPort AppMessage
http://localhost 5001 Welcome to my app! I am running on http://localhost:5001
http://localhost 5002 Welcome to my app! I am running on http://localhost:5002
http://localhost 5003 Welcome to my app! I am running on http://localhost:5003
from django.db import models
class Container(models.Model):
container_host = models.URLField()
container_port = models.PositiveIntegerField()
container_default_message = models.CharField(
max_length=255
)
# ...
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'dockerman',
]
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment