lostplaces-backend is a Django based Webproject. It once wants to become a software which allows a group of urban explorers to manage, document and share the locations of lost places while not exposing too much / any information to the public.
Go to file
2020-09-03 20:24:20 +02:00
lostplaces Commenting tests 2020-09-03 20:24:20 +02:00
.gitignore Added migrations directory to .gitignore. 2020-08-17 12:36:27 +02:00
LICENSE Added MIT license and rudimentary Readme.md. 2020-07-27 09:56:55 +02:00
Pipfile Tests for the place model 2020-09-03 20:06:06 +02:00
Readme.md Added documentation, links, missing information. 2020-09-01 22:35:39 +02:00

lostplaces-backend

lostplaces-backend is a django (3.x) based webproject. It once wants to become a software which allows a group of urban explorers to manage, document and share the locations of lost places while not exposing too much / any information to the public.

The software is currently in early development status, neither scope, datalmodel(s) nor features are finalized yet. Therefore we would not recommend to download or install this piece of software anywhere - except your local django dev server.

Dependencies

Right now it depends on the following non-core Python 3 libraries. These can be installed using the package manager of your distribution or into the venv locally.

  • django django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • easy-thumbnails A powerful, yet easy to implement thumbnailing application for Django 1.11+
  • image Image cropping for django
  • django-widget-tweaks Tweak the form field rendering in templates, not in python-level form definitions.
  • django-taggit A simpler approach to tagging with Django.

Development

Setting up a (pipenv) virtual environment for development

After having obtained the repository contents (either via .zip download or git clone), you can easily setup a pipenv virtual environment. The repo provides a Pipfile for easy dependency management that does not mess with your system.

$ cd lostplaces-backend
$ pipenv install 
$ pipenv shell
(lostplaces-backend) $ lostplaces/manage.py makemigrations
(lostplaces-backend) $ lostplaces/manage.py migrate
(lostplaces-backend) $ lostplaces/manage.py createsuperuser
(lostplaces-backend) $ lostplaces/manage.py runserver --ipv6

Returning to the venv

$ cd lostplaces-backend
$ pipenv shell
(lostplaces-backend) $ pipenv update # If dependencies changed, or updates available
(lostplaces-backend) $ lostplaces/manage.py makemigrations # If datamodels changed
(lostplaces-backend) $ lostplaces/manage.py migrate # If datamodels changed
(lostplaces-backend) $ lostplaces/manage.py runserver --ipv6

Visit: admin for administrative backend or frontend

Installing lostplaces

Install dependencies

Python3, Django3, easy-thumbnails, image, django-widget-tweaks, django-taggit

pip install --user django easy-thumbnails image django-widget-tweaks django-taggit

Or, if you use pipenv

pipenv install / update

Add 'lostplaces_app' to your INSTALLED_APPS setting like this

INSTALLED_APPS = [
	...
	'lostplaces_app',
	'easy_thumbnails',
	'widget_tweaks',
	'django_taggit'
]

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 ./manage.py migrate to create the lost places models.

Start the development server and visit http://localhost:8000/admin/

Visit http://localhost:8000/lostplaces/ to CRUD lost places.

Happy developing ;-)