Skip to content

Commit

Permalink
Merge pull request #34 from sheepman4267/0.2.0
Browse files Browse the repository at this point in the history
Merge 0.2.0 for release
  • Loading branch information
sheepman4267 authored Nov 18, 2024
2 parents 7b6c9a2 + b9e406b commit ea58c73
Show file tree
Hide file tree
Showing 108 changed files with 3,290 additions and 805 deletions.
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
**.sqlite3
**/static-root
**/media-root
**/media
**/media-root
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
OpenShow/media/*
*/static-root/
*/media-root/
*/static-root/
.ipython/profile_default/history.sqlite
*db.sqlite3
2 changes: 2 additions & 0 deletions .ipython/profile_default/ipython_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
c.InteractiveShellApp.extensions = ["autoreload"]
c.InteractiveShellApp.exec_lines = ["%autoreload 2"]
11 changes: 11 additions & 0 deletions .ipython/profile_default/startup/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This is the IPython startup directory

.py and .ipy files in this directory will be run *prior* to any code or files specified
via the exec_lines or exec_files configurables whenever you load this profile.

Files will be run in lexicographical order, so you can control the execution order of files
with a prefix, e.g.::

00-first.py
50-middle.py
99-last.ipy
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ RUN pip install -r requirements.txt

COPY OpenShow .

RUN apk add ffmpeg

ARG OPENSHOW_DEBUG='False'
ARG OPENSHOW_STATIC_ROOT='/static-root'
ARG OPENSHOW_MEDIA_ROOT='/media-root'
Expand All @@ -28,4 +30,4 @@ EXPOSE 8000/
ENTRYPOINT echo Migrating... \
&& python manage.py migrate --no-input \
&& python manage.py collectstatic --no-input \
&& python -m uvicorn --host 0.0.0.0 --port 8000 OpenShow.asgi:application
&& honcho start
5 changes: 5 additions & 0 deletions OpenShow/OpenShow/api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from ninja import NinjaAPI

api = NinjaAPI()

api.add_router("/slides/", "slides.api.router")
13 changes: 1 addition & 12 deletions OpenShow/OpenShow/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,7 @@
import os
import django
from django.core.asgi import get_asgi_application
from django.urls import path, re_path
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.auth import AuthMiddlewareStack
import django_eventstream

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "server.settings")

application = ProtocolTypeRouter({
'http': URLRouter([
path('events', AuthMiddlewareStack(
URLRouter(django_eventstream.routing.urlpatterns)
), { 'channels': ['test'] }),
re_path(r'', get_asgi_application()),
]),
})
application = get_asgi_application()
25 changes: 23 additions & 2 deletions OpenShow/OpenShow/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# Application definition

INSTALLED_APPS = [
'daphne',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
Expand All @@ -28,13 +29,15 @@
'django.contrib.staticfiles',
'slides',
'slides.editor',
'channels',
'django_eventstream',
'uubloomington_api_connector',
'django_feather',
'pjlink_integration',
'core',
'deck_from_images',
'django_srcdoc',
'neapolitan',
'django_extensions',
'django_q',
]

MIDDLEWARE = [
Expand Down Expand Up @@ -107,3 +110,21 @@

# Remove restriction on number of files uploaded for "deck from images" functionality
DATA_UPLOAD_MAX_NUMBER_FILES = None

# The example from https://django-q2.readthedocs.io/en/master/configure.html#orm-configuration
# We are currently only using django-q2 for managing media transcodes; the ORM broker should be fine.
# If this is ever used for more intensive parts of the system (scheduled slides, auto advance, etc.), it might be
# a good idea to look at a Redis (Valkey) setup instead. For now, simplicity is king.
Q_CLUSTER = {
'name': 'DjangORM',
'workers': 4,
'timeout': None,
'retry': 2147483647,
'queue_limit': 50,
'bulk': 10,
'orm': 'default'
}

SHELL_PLUS_IMPORTS = [
'from slides.editor.tasks import transcode_video'
]
2 changes: 1 addition & 1 deletion OpenShow/OpenShow/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@

STATIC_URL = 'static/'

MEDIA_ROOT = f'{BASE_DIR}/media/'
MEDIA_ROOT = f'{BASE_DIR}/media-root/'
MEDIA_URL = '/media/'
5 changes: 4 additions & 1 deletion OpenShow/OpenShow/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
import django_eventstream
from .api import api

urlpatterns = [
path('', include('core.urls')),
path('admin/', admin.site.urls),
path('api/', api.urls),
path('slides/', include('slides.urls')),
path('uubloomington/', include('uubloomington_api_connector.urls')),
path('pjlink/', include('pjlink_integration.urls')),
path('deck_from_images/', include('deck_from_images.urls')),
path("events/", include(django_eventstream.urls), {"channels": ["test"]}),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

2 changes: 2 additions & 0 deletions OpenShow/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
web: python -m uvicorn --host 0.0.0.0 --port 8000 OpenShow.asgi:application
worker: python manage.py qcluster
2 changes: 2 additions & 0 deletions OpenShow/Procfile.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
web: PYTHONUNBUFFERED=1 python manage.py runserver 8030
worker: PYTHONUNBUFFERED=1 python manage.py qcluster
File renamed without changes.
46 changes: 46 additions & 0 deletions OpenShow/core/static/core/extras.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
body > header {
display: grid;
grid-template-columns: 5rem 1fr 5rem;
text-align: center;
height: 6rem;
padding: 0;
margin-bottom: 1rem;
}

.header-right-button svg,
.header-back-button svg {
height: 100%;
width: 2rem;
margin: auto;
}

.header-back-button a {
margin: 0;
}

.sidebar-layout.double {
grid-template-columns: 18rem 2fr 1fr;
height: calc(100dvh - 7rem);
}

h2 {
margin: 0;
}

.hidden {
display: none;
}

@media screen and (max-width: 50rem) {
.sidebar-layout.double {
display: flex;
flex-direction: column;
max-height: calc(100dvh - 7rem);
}
}

@media screen and (min-width: 1420px) {
.sidebar-layout.double {
grid-template-columns: 18rem 2fr 25rem;
}
}
1 change: 1 addition & 0 deletions OpenShow/core/static/css/missing.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions OpenShow/core/static/js/htmx.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions OpenShow/core/static/js/hyperscript.js

Large diffs are not rendered by default.

Loading

0 comments on commit ea58c73

Please sign in to comment.