Fix an issue with hypercorn not finding the application in the docker image; correct the README; fix a co-routine that wasn't being awaited
This commit is contained in:
parent
8a355f59a5
commit
c04b2a4102
@ -6,4 +6,4 @@ RUN pip install -e .
|
||||
RUN pip install hypercorn
|
||||
|
||||
EXPOSE 8000
|
||||
CMD ["hypercorn", "codesmidgen.app"]
|
||||
CMD ["hypercorn", "codesmidgen.app:application"]
|
||||
|
@ -3,4 +3,4 @@ FROM python:3.11
|
||||
RUN pip install --extra-index-url https://git.snyman.info/api/packages/raoul/pypi/simple/ CodeSmidgen hypercorn
|
||||
|
||||
EXPOSE 8000
|
||||
CMD ["hypercorn", "codesmidgen.app"]
|
||||
CMD ["hypercorn", "codesmidgen.app:application"]
|
||||
|
@ -26,7 +26,7 @@ The easiest way to install CodeSmidgen is via Docker and Docker Compose. Here's
|
||||
image: git.snyman.info/raoul/codesmidgen:latest
|
||||
env:
|
||||
- SMIDGEN_SECRET_KEY=yoursecrethere
|
||||
- SQLALCHEMY_DATABASE_URL=postgres://codesmidgen:codesmidgen@postgres/codesmidgen
|
||||
- SQLALCHEMY_DATABASE_URI=postgresql://codesmidgen:codesmidgen@postgres/codesmidgen
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "127.0.0.1:8000:8000"
|
||||
|
@ -101,7 +101,7 @@ async def save() -> Response:
|
||||
session.commit()
|
||||
return redirect('/' + note.url)
|
||||
except Exception as e:
|
||||
flash(str(e), 'danger')
|
||||
await flash(str(e), 'danger')
|
||||
session.rollback()
|
||||
return redirect('/')
|
||||
|
||||
@ -115,7 +115,7 @@ async def view(note_url: str) -> Response | str:
|
||||
"""
|
||||
note = Smidgen.query.filter(Smidgen.url == note_url).first()
|
||||
if not note:
|
||||
flash('That note does not exist', 'danger')
|
||||
await flash('That note does not exist', 'danger')
|
||||
return redirect('/')
|
||||
|
||||
lexer = get_lexer_by_name(note.lexer)
|
||||
@ -133,7 +133,7 @@ async def raw(note_url: str) -> Response | str:
|
||||
"""
|
||||
note = Smidgen.query.filter(Smidgen.url == note_url).scalar()
|
||||
if not note:
|
||||
flash('That note does not exist', 'danger')
|
||||
await flash('That note does not exist', 'danger')
|
||||
return redirect('/')
|
||||
return await render_template('raw.html', source=note.source), 200, {'Content-Type': 'text/plain; charset=utf-8'}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user