From a5839c2c36d40356c2ee66b3d96eceb64144e6f2 Mon Sep 17 00:00:00 2001 From: reverend Date: Tue, 18 Aug 2020 14:22:33 +0200 Subject: [PATCH] Added installation instructions --- Readme.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/Readme.md b/Readme.md index 43cdcc0..d3bc45f 100644 --- a/Readme.md +++ b/Readme.md @@ -33,4 +33,65 @@ $ pipenv shell Visit: [admin](http://localhost:8000/admin) for administrative backend or [frontend](http://localhost:8000/) +## Installing lostplaces + +### Install dependencies + Python3, Django3, easy-thumbnails, image, django-widget-tweaks + ``` + pip install django easy-thumbnails image django-widget-tweaks + ``` + Or, if you use pipenv + ``` + pipenv install + ``` + + +### Add 'lostplaces_app' to your INSTALLED_APPS setting like this + + ``` + INSTALLED_APPS = [ + ... + 'lostplaces_app', + 'easy_thumbnails', + 'widget_tweaks', + ] + ``` + +### Add this configuration to your settings.py + + ``` + from django.urls import reverse_lazy + ... + AUTH_USER_MODEL = 'lostplaces_app.Explorer' + + LOGIN_URL = reverse_lazy('login') + + THUMBNAIL_ALIASES = { + '': { + 'thumbnail': {'size': (300, 300), 'crop': False}, + 'hero': {'size': (700, 700), 'crop': False}, + 'large': {'size': (1920, 1920), 'crop': False}, + }, + } + ``` + + +### Include the lostplaces URLconf in your project urls.py like this + + ``` + from django.urls import path, include + ... + urlpatterns = [ + ... + path('lostplaces/', include('lostplaces_app.urls')), + ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + ``` + +Run ``python manage.py migrate`` to create the lost places models. + +Start the development server and visit http://127.0.0.1:8000/admin/ + +Visit http://127.0.0.1:8000/lostplaces/ to CRUD lost places. + + Happy developing ;-)