change compose and create todo app
This commit is contained in:
parent
fcc9a8602b
commit
039dcd98f5
2
backend/.gitignore
vendored
2
backend/.gitignore
vendored
@ -2,3 +2,5 @@
|
||||
.env
|
||||
|
||||
**/__pycache__/**
|
||||
|
||||
**/migrations/**
|
||||
@ -1,9 +1,15 @@
|
||||
|
||||
FROM python:3.13-bookworm
|
||||
|
||||
RUN useradd -m django
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt requirements.txt
|
||||
RUN pip install -r requirements.txt
|
||||
EXPOSE 8000
|
||||
COPY . .
|
||||
COPY --chown=django . .
|
||||
|
||||
USER django:django
|
||||
|
||||
CMD ["python", "manage.py", "runserver" , "0.0.0.0:8000"]
|
||||
@ -37,6 +37,8 @@ INSTALLED_APPS = [
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
|
||||
'todolist',
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
||||
@ -15,8 +15,9 @@ Including another URLconf
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import path
|
||||
from django.urls import path, include
|
||||
|
||||
urlpatterns = [
|
||||
path("todolist/", include("todolist.urls")),
|
||||
path('admin/', admin.site.urls),
|
||||
]
|
||||
|
||||
0
backend/todolist/__init__.py
Normal file
0
backend/todolist/__init__.py
Normal file
3
backend/todolist/admin.py
Normal file
3
backend/todolist/admin.py
Normal file
@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
6
backend/todolist/apps.py
Normal file
6
backend/todolist/apps.py
Normal file
@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class TodolistConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'todolist'
|
||||
3
backend/todolist/models.py
Normal file
3
backend/todolist/models.py
Normal file
@ -0,0 +1,3 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
3
backend/todolist/tests.py
Normal file
3
backend/todolist/tests.py
Normal file
@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
7
backend/todolist/urls.py
Normal file
7
backend/todolist/urls.py
Normal file
@ -0,0 +1,7 @@
|
||||
from django.urls import path
|
||||
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
#path("", views.index, name="index"),
|
||||
]
|
||||
3
backend/todolist/views.py
Normal file
3
backend/todolist/views.py
Normal file
@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
11
compose.yaml
11
compose.yaml
@ -19,11 +19,8 @@ services:
|
||||
image: postgres
|
||||
restart: unless-stopped
|
||||
env_file: ./backend/.env
|
||||
expose:
|
||||
- 5432
|
||||
volumes:
|
||||
- db-data:/var/lib/postgresql
|
||||
|
||||
adminer:
|
||||
image: adminer
|
||||
restart: always
|
||||
ports:
|
||||
- 8080:8080
|
||||
volumes:
|
||||
db-data:
|
||||
Loading…
x
Reference in New Issue
Block a user