Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"dev": "vite --host --port 4321",
"build": "tsc && vite build",
"prod": "npm run build && rm -rf ../django/dist && mv -f dist ../django/static",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"prod": "npm run build && rm -rf ../django/dist && mv -f dist ../django/static",
"prod": "npm run build && rm -rf ../django/static && mv -f dist ../django/static",

"preview": "vite preview"
},
"dependencies": {
Expand Down
3 changes: 2 additions & 1 deletion src/django/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
django==4.2
djangorestframework==3.14.0
djangorestframework-gis==1.0
psycopg2==2.9.6
psycopg2==2.9.6
whitenoise==6.4.0
1 change: 1 addition & 0 deletions src/django/thirdplaces/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
Expand Down
8 changes: 7 additions & 1 deletion src/django/thirdplaces/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import include, path
from django.urls import include, path, re_path
from django.shortcuts import render

def render_react(request):
return render(request, "index.html")

urlpatterns = [
path("api/", include("api.urls")),
path("admin/", admin.site.urls),
re_path(r"^$", render_react),
re_path(r"^(?:.*)/?$", render_react),
]