1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-12-22 14:54:22 +00:00

🔧 Reserve static notebook slug

This commit is contained in:
Steffo 2021-10-19 19:46:21 +02:00
parent 5a30fa8548
commit 8e4baf9e6d
2 changed files with 37 additions and 7 deletions

View file

@ -0,0 +1,29 @@
# Generated by Django 3.2.7 on 2021-10-19 17:45
from django.db import migrations, models
import sophon.notebooks.validators
class Migration(migrations.Migration):
dependencies = [
('notebooks', '0010_auto_20211019_1738'),
]
operations = [
migrations.AlterField(
model_name='notebook',
name='container_image',
field=models.CharField(choices=[('steffo45/jupyterlab-docker-sophon', 'Python (Sophonic)')], default='steffo45/jupyterlab-docker-sophon',
help_text='The Docker image to run for this notebook.', max_length=256, verbose_name='Docker image'),
),
migrations.AlterField(
model_name='notebook',
name='slug',
field=models.SlugField(
help_text='Unique alphanumeric string which identifies the project. Changing this once the container has been created <strong>will break Docker</strong>!',
max_length=64, primary_key=True, serialize=False,
validators=[sophon.notebooks.validators.DisallowedValuesValidator(['api', 'static', 'proxy', 'backend', 'frontend', 'src'])],
verbose_name='Slug'),
),
]

View file

@ -46,6 +46,7 @@ class Notebook(SophonGroupModel):
validators=[ validators=[
DisallowedValuesValidator([ DisallowedValuesValidator([
"api", # reserved for docker deployment "api", # reserved for docker deployment
"static", # reserved for production deployment
"proxy", # reserved for future use "proxy", # reserved for future use
"backend", # reserved for future use "backend", # reserved for future use
"frontend", # reserved for future use "frontend", # reserved for future use
@ -75,13 +76,13 @@ class Notebook(SophonGroupModel):
# Remember to make a migration when changing this! # Remember to make a migration when changing this!
IMAGE_CHOICES = ( IMAGE_CHOICES = (
("jupyter/base-notebook", "Base"), # ("jupyter/base-notebook", "Base"),
("jupyter/minimal-notebook", "Python"), # ("jupyter/minimal-notebook", "Python"),
("jupyter/scipy-notebook", "Python (Scientific)"), # ("jupyter/scipy-notebook", "Python (Scientific)"),
("jupyter/tensorflow-notebook", "Python (Tensorflow)"), # ("jupyter/tensorflow-notebook", "Python (Tensorflow)"),
("jupyter/r-notebook", "Python + R"), # ("jupyter/r-notebook", "Python + R"),
("jupyter/pyspark-notebook", "Python (Scientific) + Apache Spark"), # ("jupyter/pyspark-notebook", "Python (Scientific) + Apache Spark"),
("jupyter/all-spark-notebook", "Python (Scientific) + Scala + R + Apache Spark"), # ("jupyter/all-spark-notebook", "Python (Scientific) + Scala + R + Apache Spark"),
("steffo45/jupyterlab-docker-sophon", "Python (Sophonic)"), ("steffo45/jupyterlab-docker-sophon", "Python (Sophonic)"),
) )