from applipizza import views
from django.conf import settings  # new
from django.urls import path, include  # new
from django.conf.urls.static import static  # new

urlpatterns = [
    path('', views.pizzas, name="home"),
    path('pizzas/', views.pizzas),
    path('pizzas/add', views.create_pizza),
    path('pizza/<int:id>', views.pizza),
    path('pizza/<int:id>/addIngredient', views.ajouterIngredientDansPizza),
    path('pizza/<int:pizzaId>/deleteIngredient/<int:compositionId>', views.supprimerIngredientDansPizza),
    path('pizza/<int:id>/update', views.modifierPizza),
    path('pizza/<int:id>/update/post', views.traitementFormulaireModificationPizza),
    path('pizza/<int:id>/delete', views.supprimerPizza),
    path('ingredients/', views.listeIngredients),
    path('ingredients/add', views.formulaireCreationIngredient),
    path('ingredients/add/post', views.creerIngredient),
]

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)  # new