Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
:alert: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary-H9 committed Jul 2, 2024
1 parent eb41f41 commit 8805bfc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 26 deletions.
9 changes: 3 additions & 6 deletions ollamate/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.0/ref/settings/
"""

from pathlib import Path

import os
import environ
from pathlib import Path


# Initialize environment variables
env = environ.Env()
Expand Down Expand Up @@ -98,9 +97,7 @@

DB_HOST = os.environ.get("DB_HOST", "127.0.0.1")
ENABLE_DB_SSL = (
str(
os.environ.get("ENABLE_DB_SSL", DB_HOST not in ["127.0.0.1", "localhost"])
).lower()
str(os.environ.get("ENABLE_DB_SSL", DB_HOST not in ["127.0.0.1", "localhost"])).lower()
== "true"
)
DATABASES: dict = {
Expand Down
18 changes: 1 addition & 17 deletions ollamate/urls.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
"""
URL configuration for ollamate project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/5.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.urls import include, path
from streamingapp.views import redirect_to_ollama

urlpatterns = [
Expand Down
1 change: 1 addition & 0 deletions streamingapp/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.urls import path

from . import views

urlpatterns = [
Expand Down
4 changes: 1 addition & 3 deletions streamingapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ def call_ollama(request):
ollama_response = response_data.get("message", {}).get("content", "")
if not ollama_response:
logging.error("Empty response from Ollama API")
return JsonResponse(
{"error": "Empty response from Ollama API"}, status=500
)
return JsonResponse({"error": "Empty response from Ollama API"}, status=500)

return JsonResponse({"response": ollama_response})
except requests.RequestException as e:
Expand Down

0 comments on commit 8805bfc

Please sign in to comment.