Hello, my name is Matias. I’m completely new to Django (and web development in general) and I wanted to make a website for a friend. I managed to deploy the website with GoDaddy and cPanel, but whenever I try to go to the suburls, it shows the message in the image above. I tried changing the urly.py so it showed another view, and it works. The only problem seems to be that Google can’t find the other urls? I’m completely lost here.
urls.py from main project
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('AppMatriz.urls')),
]
# Images thing
urlpatterns+= static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urls.py from AppMatriz (I added it to the settings.py)
from django.urls import path
from AppMatriz import views
urlpatterns = [
path('', views.inicio, name="Inicio"),
path('/nosotros', views.nosotros, name="Nosotros"),
path('refuerzo_up/', views.refuerzo_up, name="RefuerzoUP"),
path('refuerzo_up/nive-matematica', views.nive_mate, name="NiveMate"),
path('refuerzo_up/matematicas1', views.mate1, name="Mate1"),
path('refuerzo_up/matematicas2', views.mate2, name="Mate2"),
path('refuerzo_up/matematicas-negocios', views.mate_nego, name="MateNego"),
path('refuerzo_up/matematicas3', views.mate3, name="Mate3"),
path('refuerzo_up/estadistica1', views.r_esta1, name="Esta1"),
path('refuerzo_up/estadistica2', views.r_esta2, name="Esta2"),
path('refuerzo_up/amn', views.amn, name="AMN"),
path('refuerzo_up/nive-informatica', views.nive_info, name="NiveInfo"),
path('refuerzo_up/analis-negocios', views.analisis, name="Analisis"),
path('refuerzo_up/economia1', views.eco1, name="Eco1"),
path('refuerzo_up/economia2', views.eco2, name="Eco2"),
path('refuerzo_up/fundamentos-finanzas', views.funda_finanzas, name="FundaFinanzas"),
path('refuerzo_up/nive-lenguaje', views.nive_lengua, name="NiveLengua"),
path('refuerzo_up/lenguaje1', views.lengua1, name="Lengua1"),
path('refuerzo_up/lenguaje2', views.lengua2, name="Lengua2"),
path('refuerzo_pre/', views.refuerzo_pre, name="RefuerzoPre"),
path('admision/', views.adm_up, name="AdmisionUP"),
path('admision/regular', views.adm_regular, name="AdmisionRegular"),
path('admision/selectiva', views.adm_selectiva, name="AdmisionSelectiva"),
path('nivelacion/', views.nivelacion, name="Nivelacion"),
path('adelanto/', views.adelanto, name="Adelanto"),
]
views.py from AppMatriz
from django.shortcuts import render, get_object_or_404
from .models import *
def inicio(request):
return render(request, "inicio.html")
def refuerzo_pre(request):
return render(request, "refuerzo_pre.html")
def adm_up(request):
return render(request, "adm_up.html")
def adm_regular(request):
return render(request, "adm_regular.html")
def adm_selectiva(request):
return render(request, "adm_selectiva.html")
def adelanto(request):
return render(request, "adelanto.html")
def nivelacion(request):
return render(request, "nivelacion.html")
def nosotros(request):
return render(request, "nosotros.html")
def refuerzo_up(request):
return render(request, "refuerzo_up.html")
"""
===============================
CURSOS REFUERZO UNIVERSITARIO
===============================
"""
def nive_mate(request):
horarios = Horario.objects.filter(imagen__icontains='nive_mate')
return render(request, "r_nive_mate.html", {"horarios":horarios})
def mate1(request):
horarios = Horario.objects.filter(imagen__icontains='mate1')
return render(request, "r_mate1.html", {"horarios":horarios})
def mate2(request):
horarios = Horario.objects.filter(imagen__icontains='mate2')
return render(request, "r_mate2.html", {"horarios":horarios})
def mate_nego(request):
horarios = Horario.objects.filter(imagen__icontains='mate_nego')
return render(request, "r_mate_nego.html", {"horarios":horarios})
def mate3(request):
horarios = Horario.objects.filter(imagen__icontains='mate3')
return render(request, "r_mate3.html", {"horarios":horarios})
def r_esta1(request):
horarios = Horario.objects.filter(imagen__icontains='esta1')
return render(request, "r_esta1.html", {"horarios":horarios})
def r_esta2(request):
horarios = Horario.objects.filter(imagen__icontains='esta2')
return render(request, "r_esta2.html", {"horarios":horarios})
def amn(request):
horarios = Horario.objects.filter(imagen__icontains='amn')
return render(request, "r_amn.html", {"horarios":horarios})
def nive_info(request):
horarios = Horario.objects.filter(imagen__icontains='nive_info')
return render(request, "r_nive_info.html", {"horarios":horarios})
def analisis(request):
horarios = Horario.objects.filter(imagen__icontains='analisis')
return render(request, "r_analisis.html", {"horarios":horarios})
def eco1(request):
horarios = Horario.objects.filter(imagen__icontains='eco1')
return render(request, "r_eco1.html", {"horarios":horarios})
def eco2(request):
horarios = Horario.objects.filter(imagen__icontains='eco2')
return render(request, "r_eco2.html", {"horarios":horarios})
def funda_finanzas(request):
horarios = Horario.objects.filter(imagen__icontains='funda_finanzas')
return render(request, "r_funda_finanzas.html", {"horarios":horarios})
def nive_lengua(request):
horarios = Horario.objects.filter(imagen__icontains='nive_lengua')
return render(request, "r_nive_lengua.html", {"horarios":horarios})
def lengua1(request):
horarios = Horario.objects.filter(imagen__icontains='lengua1')
return render(request, "r_lengua1.html", {"horarios":horarios})
def lengua2(request):
horarios = Horario.objects.filter(imagen__icontains='lengua2')
return render(request, "r_lengua2.html", {"horarios":horarios})
I’d really appreciate someone helping me out, if more code or information is needed I’ll provide it as soon as possible.
Thank you for reading this.