diff --git a/lettings/models.py b/lettings/models.py index aac0574..8e76ef0 100644 --- a/lettings/models.py +++ b/lettings/models.py @@ -20,4 +20,3 @@ class Letting(models.Model): def __str__(self): return self.title - diff --git a/lettings/views.py b/lettings/views.py index 5644333..c2dba21 100644 --- a/lettings/views.py +++ b/lettings/views.py @@ -7,10 +7,11 @@ def index(request): context = {'lettings_list': lettings_list} return render(request, 'lettings/index.html', context) + def letting(request, letting_id): letting = Letting.objects.get(id=letting_id) context = { 'title': letting.title, 'address': letting.address, } - return render(request, 'lettings/letting.html', context) \ No newline at end of file + return render(request, 'lettings/letting.html', context) diff --git a/oc-lettings-site.sqlite3 b/oc-lettings-site.sqlite3 index 3d88541..976ca88 100644 Binary files a/oc-lettings-site.sqlite3 and b/oc-lettings-site.sqlite3 differ diff --git a/oc_lettings_site/asgi.py b/oc_lettings_site/asgi.py index 89ba622..1825f9e 100644 --- a/oc_lettings_site/asgi.py +++ b/oc_lettings_site/asgi.py @@ -3,6 +3,6 @@ import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', - 'oc_lettings_site.settings') + 'oc_lettings_site.settings') application = get_asgi_application() diff --git a/oc_lettings_site/settings.py b/oc_lettings_site/settings.py index 78760c2..c1d5301 100644 --- a/oc_lettings_site/settings.py +++ b/oc_lettings_site/settings.py @@ -13,9 +13,9 @@ BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = 'fp$9^593hsriajg$_%=5trot9g!1qa@ew(o-1#@=&4%=hp46(s' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = False -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ["*"] # Application definition @@ -117,4 +117,4 @@ USE_TZ = True STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') STATIC_URL = '/static/' -STATICFILES_DIRS = [BASE_DIR / "static",] +STATICFILES_DIRS = [BASE_DIR / "static"] diff --git a/profiles/models.py b/profiles/models.py index a260c61..84c85c1 100644 --- a/profiles/models.py +++ b/profiles/models.py @@ -8,4 +8,3 @@ class Profile(models.Model): def __str__(self): return self.user.username - diff --git a/profiles/views.py b/profiles/views.py index d5b0495..0846566 100644 --- a/profiles/views.py +++ b/profiles/views.py @@ -7,7 +7,8 @@ def index(request): context = {'profiles_list': profiles_list} return render(request, 'profiles/index.html', context) + def profile(request, username): profile = Profile.objects.get(user__username=username) context = {'profile': profile} - return render(request, 'profiles/profile.html', context) \ No newline at end of file + return render(request, 'profiles/profile.html', context) diff --git a/templates/404.html b/templates/404.html new file mode 100644 index 0000000..ce53e62 --- /dev/null +++ b/templates/404.html @@ -0,0 +1,25 @@ +{% extends "base.html" %} +{% block title %}404 Not Found{% endblock title %} + +{% block content %} + +
An error has occurred
+ + Back Home + +