Skip to content

Commit

Permalink
Update database schema
Browse files Browse the repository at this point in the history
  • Loading branch information
ulisespallares888 committed Aug 10, 2024
2 parents 6bc6a0f + 2e542e4 commit c0976a7
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ logs/

# sql files
*.sql

# django migrations binaries pyc
*.pyc
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ RUN pip install --upgrade pip && pip install -r requirements.txt
# Copy the entire backend directory
COPY backend/ .

# Create a directory for media files
RUN mkdir -p /app/media

# Collect static files
RUN python manage.py collectstatic --noinput

Expand Down
Binary file removed backend/api/__pycache__/tests.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file removed backend/core/__pycache__/tests.cpython-312.pyc
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions backend/server/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@

STATIC_ROOT: str = os.path.join(BASE_DIR, "staticfiles")
STATIC_URL: str = "/static/"

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
# Default primary key field type
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field

Expand Down
2 changes: 2 additions & 0 deletions backend/server/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
]
if settings.DEBUG:
from debug_toolbar.toolbar import debug_toolbar_urls
from django.conf.urls.static import static
from django.contrib import admin

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += [
path(
"",
Expand Down
Binary file removed backend/users/__pycache__/tests.cpython-312.pyc
Binary file not shown.
Binary file removed backend/users/__pycache__/views.cpython-312.pyc
Binary file not shown.
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: "3.8"

services:
web:
build: .
command: gunicorn server.wsgi:application --bind 0.0.0.0:8000
volumes:
- ./backend:/app
- media_volume:/app/media
ports:
- "8000:8000"
env_file:
- .env

volumes:
media_volume:

0 comments on commit c0976a7

Please sign in to comment.