Compare commits
16 Commits
master
...
c9d83dfc2c
Author | SHA1 | Date | |
---|---|---|---|
|
c9d83dfc2c | ||
|
49301afe51 | ||
|
624878624f | ||
|
a2ee323fa4 | ||
|
86c9de3213 | ||
|
8597e53599 | ||
|
d213b51a59 | ||
|
9c50e5891f | ||
|
72094494eb | ||
|
c483c3511d | ||
14effd33e2 | |||
19300614bc | |||
830120a929 | |||
ddd0f8c903 | |||
d5f6a00219 | |||
f376951ff9 |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -91,3 +91,9 @@ venv.bak/
|
|||||||
|
|
||||||
# twine / pypi
|
# twine / pypi
|
||||||
.pypirc
|
.pypirc
|
||||||
|
|
||||||
|
# Django Migrations for Development branches
|
||||||
|
django_lostplaces/lostplaces/migrations/*
|
||||||
|
|
||||||
|
# Django Static files
|
||||||
|
django_lostplaces/static/*
|
1
Pipfile
1
Pipfile
@@ -30,6 +30,7 @@ dbshell = "django_lostplaces/manage.py dbshell"
|
|||||||
showmigrations = "django_lostplaces/manage.py showmigrations"
|
showmigrations = "django_lostplaces/manage.py showmigrations"
|
||||||
makemigrations = "django_lostplaces/manage.py makemigrations --no-input"
|
makemigrations = "django_lostplaces/manage.py makemigrations --no-input"
|
||||||
migrate = "django_lostplaces/manage.py migrate"
|
migrate = "django_lostplaces/manage.py migrate"
|
||||||
|
collectstatic = "django_lostplaces/manage.py collectstatic"
|
||||||
build = "django_lostplaces/setup.py bdist_wheel --universal"
|
build = "django_lostplaces/setup.py bdist_wheel --universal"
|
||||||
createsuperuser = "django_lostplaces/manage.py createsuperuser --noinput --username admin --email admin@example.org"
|
createsuperuser = "django_lostplaces/manage.py createsuperuser --noinput --username admin --email admin@example.org"
|
||||||
createsuperuser_prompt = "django_lostplaces/manage.py createsuperuser"
|
createsuperuser_prompt = "django_lostplaces/manage.py createsuperuser"
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
# lostplaces-backend
|
# 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.
|
lostplaces-backend is a django (4.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, datamodel(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.
|
The software is currently in early development status, neither scope, datamodel(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.
|
||||||
|
|
||||||
|
BIN
django_lostplaces/db.sqlite3.develop
Normal file
BIN
django_lostplaces/db.sqlite3.develop
Normal file
Binary file not shown.
@@ -32,9 +32,9 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|||||||
SECRET_KEY = 'n$(bx8(^)*wz1ygn@-ekt7rl^1km*!_c+fwwjiua8m@-x_rpl0'
|
SECRET_KEY = 'n$(bx8(^)*wz1ygn@-ekt7rl^1km*!_c+fwwjiua8m@-x_rpl0'
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = True
|
DEBUG = False
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['localhost']
|
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]']
|
||||||
|
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
@@ -145,15 +145,16 @@ LANGUAGES = [
|
|||||||
# https://docs.djangoproject.com/en/3.1/howto/static-files/
|
# https://docs.djangoproject.com/en/3.1/howto/static-files/
|
||||||
|
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/static/'
|
||||||
STATIC_ROOT = os.path.join(BASE_DIR, 'static_files')
|
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
||||||
|
|
||||||
# Upload directory
|
# Upload directory
|
||||||
MEDIA_URL = '/uploads/'
|
MEDIA_URL = '/uploads/'
|
||||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'uploads')
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'uploads/')
|
||||||
|
|
||||||
# Thumbnails
|
# Thumbnails
|
||||||
THUMBNAIL_MEDIA_ROOT = os.path.join(MEDIA_ROOT, 'thumbs/')
|
RELATIVE_THUMBNAIL_PATH = 'images/'
|
||||||
THUMBNAIL_MEDIA_URL = os.path.join(MEDIA_URL, 'thumbs/')
|
THUMBNAIL_MEDIA_ROOT = os.path.join(MEDIA_ROOT, RELATIVE_THUMBNAIL_PATH)
|
||||||
|
THUMBNAIL_MEDIA_URL = os.path.join(MEDIA_URL, RELATIVE_THUMBNAIL_PATH)
|
||||||
THUMBNAIL_QUALITY = 75
|
THUMBNAIL_QUALITY = 75
|
||||||
|
|
||||||
# Templates to use for authentication
|
# Templates to use for authentication
|
||||||
|
@@ -19,8 +19,9 @@ Including another URLconf
|
|||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.views.static import serve
|
||||||
from django.conf.urls.static import static
|
from django.conf.urls.static import static
|
||||||
from django.urls import path, include
|
from django.urls import path, include, re_path
|
||||||
from django.views.generic.base import TemplateView
|
from django.views.generic.base import TemplateView
|
||||||
|
|
||||||
from lostplaces.views import SignUpView
|
from lostplaces.views import SignUpView
|
||||||
@@ -30,4 +31,6 @@ urlpatterns = [
|
|||||||
path('signup/', SignUpView.as_view(), name='signup'),
|
path('signup/', SignUpView.as_view(), name='signup'),
|
||||||
path('explorer/', include('django.contrib.auth.urls')),
|
path('explorer/', include('django.contrib.auth.urls')),
|
||||||
path('', include('lostplaces.urls')),
|
path('', include('lostplaces.urls')),
|
||||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
re_path(r'^static/(?P<path>.*)$', serve,{'document_root': settings.STATIC_ROOT}),
|
||||||
|
re_path(r'^uploads/(?P<path>.*)$', serve,{'document_root': settings.MEDIA_ROOT})
|
||||||
|
]
|
||||||
|
@@ -7,7 +7,7 @@ from django import forms
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
|
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext as _
|
||||||
|
|
||||||
from lostplaces import widgets
|
from lostplaces import widgets
|
||||||
from lostplaces.models import Place, PlaceImage, Voucher, Explorer
|
from lostplaces.models import Place, PlaceImage, Voucher, Explorer
|
||||||
@@ -69,7 +69,7 @@ class PlaceForm(forms.ModelForm):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = Place
|
model = Place
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
exclude = ['submitted_by', 'level']
|
exclude = ['submitted_by', 'level', 'mode']
|
||||||
widgets = {
|
widgets = {
|
||||||
'hero': widgets.SelectContent()
|
'hero': widgets.SelectContent()
|
||||||
}
|
}
|
||||||
@@ -88,6 +88,11 @@ class PlaceForm(forms.ModelForm):
|
|||||||
widget=forms.NumberInput(attrs={'min':-180,'max': 180,'type': 'number', 'step': 'any'})
|
widget=forms.NumberInput(attrs={'min':-180,'max': 180,'type': 'number', 'step': 'any'})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
draft = forms.BooleanField(
|
||||||
|
label=_('Save Place as draft'),
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
|
||||||
class PlaceImageForm(forms.ModelForm):
|
class PlaceImageForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = PlaceImage
|
model = PlaceImage
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext as _
|
||||||
from django.core.validators import MaxValueValidator, MinValueValidator
|
from django.core.validators import MaxValueValidator, MinValueValidator
|
||||||
|
|
||||||
from taggit.managers import TaggableManager
|
from taggit.managers import TaggableManager
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext as _
|
||||||
|
|
||||||
from lostplaces.models.place import PlaceAsset
|
from lostplaces.models.place import PlaceAsset
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ from django.db import models
|
|||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.db.models.signals import post_save, pre_save
|
from django.db.models.signals import post_save, pre_save
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext as _
|
||||||
|
|
||||||
from lostplaces.models.abstract_models import Expireable
|
from lostplaces.models.abstract_models import Expireable
|
||||||
from lostplaces.models.place import Place
|
from lostplaces.models.place import Place
|
||||||
@@ -82,9 +82,25 @@ class Explorer(models.Model):
|
|||||||
choices=EXPLORER_LEVELS
|
choices=EXPLORER_LEVELS
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def get_place_list_to_display(self):
|
||||||
|
'''
|
||||||
|
Gets the list of places to show on the homepage
|
||||||
|
and the list views
|
||||||
|
'''
|
||||||
|
if self.user.is_superuser:
|
||||||
|
return Place.objects.filter(mode='live')
|
||||||
|
|
||||||
|
return Place.objects.filter(
|
||||||
|
level__lte=self.level,
|
||||||
|
mode='live'
|
||||||
|
) | Place.objects.filter(
|
||||||
|
submitted_by=self,
|
||||||
|
mode='live'
|
||||||
|
)
|
||||||
|
|
||||||
def get_places_eligible_to_see(self):
|
def get_places_eligible_to_see(self):
|
||||||
if self.user.is_superuser:
|
if self.user.is_superuser:
|
||||||
return Place.objects.all()
|
return Place.objects.filter(mode='live')
|
||||||
return Place.objects.all().filter(level__lte=self.level) | self.places.all()
|
return Place.objects.all().filter(level__lte=self.level) | self.places.all()
|
||||||
|
|
||||||
def is_eligible_to_see(self, place):
|
def is_eligible_to_see(self, place):
|
||||||
|
@@ -1,11 +1,14 @@
|
|||||||
import os
|
import os
|
||||||
from math import floor
|
import datetime
|
||||||
|
from math import ceil
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
from django.db.models.signals import post_delete, pre_save
|
from django.db.models.signals import post_delete, pre_save
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext as _
|
||||||
|
from django.utils import timezone
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
from lostplaces.models.abstract_models import Submittable, Taggable, Mapable, Expireable
|
from lostplaces.models.abstract_models import Submittable, Taggable, Mapable, Expireable
|
||||||
|
|
||||||
@@ -20,6 +23,13 @@ PLACE_LEVELS = (
|
|||||||
(5, 'Time Capsule')
|
(5, 'Time Capsule')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
PLACE_MODES = (
|
||||||
|
('live', 'live'),
|
||||||
|
('draft', 'draft'),
|
||||||
|
('review', 'review'),
|
||||||
|
('archive', 'archive')
|
||||||
|
)
|
||||||
|
|
||||||
class Place(Submittable, Taggable, Mapable):
|
class Place(Submittable, Taggable, Mapable):
|
||||||
"""
|
"""
|
||||||
Place defines a lost place (location, name, description etc.).
|
Place defines a lost place (location, name, description etc.).
|
||||||
@@ -47,6 +57,12 @@ class Place(Submittable, Taggable, Mapable):
|
|||||||
choices=PLACE_LEVELS
|
choices=PLACE_LEVELS
|
||||||
)
|
)
|
||||||
|
|
||||||
|
mode = models.TextField(
|
||||||
|
default='live',
|
||||||
|
choices=PLACE_MODES,
|
||||||
|
verbose_name=_('Mode of Place Editing')
|
||||||
|
)
|
||||||
|
|
||||||
def get_hero_image(self):
|
def get_hero_image(self):
|
||||||
if self.hero:
|
if self.hero:
|
||||||
return self.hero
|
return self.hero
|
||||||
@@ -75,24 +91,22 @@ class Place(Submittable, Taggable, Mapable):
|
|||||||
# Get center position of LP-geocoordinates.
|
# Get center position of LP-geocoordinates.
|
||||||
def average_latlon(cls, place_list):
|
def average_latlon(cls, place_list):
|
||||||
amount = len(place_list)
|
amount = len(place_list)
|
||||||
# Init fill values to prevent None
|
|
||||||
# China Corner in Münster
|
|
||||||
# Where I almost always eat lunch
|
|
||||||
# (Does'nt help losing wheight, tho)
|
|
||||||
longitude = 7.6295628132604385
|
|
||||||
latitude = 51.961922091398904
|
|
||||||
|
|
||||||
if amount > 0:
|
if amount > 0:
|
||||||
|
latitude = 0
|
||||||
|
longitude = 0
|
||||||
|
|
||||||
for place in place_list:
|
for place in place_list:
|
||||||
longitude += place.longitude
|
longitude += place.longitude
|
||||||
latitude += place.latitude
|
latitude += place.latitude
|
||||||
return {'latitude':latitude / amount, 'longitude': longitude / amount}
|
return {'latitude': latitude / amount, 'longitude': longitude / amount}
|
||||||
|
else:
|
||||||
return {'latitude': latitude, 'longitude': longitude}
|
# Location of China Corner in Münster
|
||||||
|
# Where I almost always eat lunch
|
||||||
|
# (Does'nt help losing wheight, tho)
|
||||||
|
return {'latitude': 51.961922091398904, 'longitude': 7.6295628132604385}
|
||||||
|
|
||||||
def calculate_place_level(self):
|
def calculate_place_level(self):
|
||||||
self.remove_expired_votes()
|
|
||||||
|
|
||||||
if self.placevotings.count() == 0:
|
if self.placevotings.count() == 0:
|
||||||
self.level = 5
|
self.level = 5
|
||||||
self.save()
|
self.save()
|
||||||
@@ -103,13 +117,22 @@ class Place(Submittable, Taggable, Mapable):
|
|||||||
for vote in self.placevotings.all():
|
for vote in self.placevotings.all():
|
||||||
level += vote.vote
|
level += vote.vote
|
||||||
|
|
||||||
self.level = floor(level / self.placevotings.count())
|
self.level = round(level / self.placevotings.count())
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
def remove_expired_votes(self):
|
def calculate_voting_accuracy(self):
|
||||||
|
place_age = timezone.now() - self.submitted_when;
|
||||||
|
accuaries = [];
|
||||||
|
|
||||||
for vote in self.placevotings.all():
|
for vote in self.placevotings.all():
|
||||||
if vote.is_expired:
|
vote_age = timezone.now() - vote.submitted_when;
|
||||||
vote.delete()
|
accuracy = 100 - (100 / (place_age / vote_age))
|
||||||
|
accuaries.append(accuracy)
|
||||||
|
|
||||||
|
if len(accuaries) > 0:
|
||||||
|
return ceil(sum(accuaries) / len(accuaries))
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
@@ -120,7 +143,7 @@ def generate_place_image_filename(instance, filename):
|
|||||||
Returns filename as: place_pk-placename{-number}.jpg
|
Returns filename as: place_pk-placename{-number}.jpg
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return 'places/' + str(instance.place.pk) + '-' + str(instance.place.name) + '.' + filename.split('.')[-1]
|
return settings.RELATIVE_THUMBNAIL_PATH + str(instance.place.pk) + '-' + str(instance.place.name) + '.' + filename.split('.')[-1]
|
||||||
|
|
||||||
def generate_image_upload_path(instance, filename):
|
def generate_image_upload_path(instance, filename):
|
||||||
return generate_place_image_filename(instance, filename)
|
return generate_place_image_filename(instance, filename)
|
||||||
@@ -209,7 +232,7 @@ def auto_delete_file_on_change(sender, instance, **kwargs):
|
|||||||
old_file.delete(save=False)
|
old_file.delete(save=False)
|
||||||
|
|
||||||
|
|
||||||
class PlaceVoting(PlaceAsset, Expireable):
|
class PlaceVoting(PlaceAsset):
|
||||||
vote = models.IntegerField(choices=PLACE_LEVELS)
|
vote = models.IntegerField(choices=PLACE_LEVELS)
|
||||||
|
|
||||||
def get_human_readable_level(self):
|
def get_human_readable_level(self):
|
||||||
|
@@ -89,7 +89,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% block footer %}
|
{% block footer %}
|
||||||
{% partial 'nav/footer' %}
|
{% include 'partials/nav/footer.html' %}
|
||||||
{% endblock footer %}
|
{% endblock footer %}
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
@@ -12,13 +12,10 @@
|
|||||||
|
|
||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
|
|
||||||
{% partial 'welcome' %}
|
{% include 'partials/welcome.html' %}
|
||||||
<article class="LP-TextSection">
|
<article class="LP-TextSection">
|
||||||
</article>
|
</article>
|
||||||
{% partial 'osm_map' %}
|
{% include 'partials/osm_map.html' with config=mapping_config modifier='wide' %}
|
||||||
{% set config mapping_config %}
|
|
||||||
{% set modifier 'wide' %}
|
|
||||||
{% endpartial %}
|
|
||||||
<div class="LP-PlaceGrid">
|
<div class="LP-PlaceGrid">
|
||||||
<h1 class="LP-Headline LP-Headline">{% translate 'Explore the latest places' %}</h1>
|
<h1 class="LP-Headline LP-Headline">{% translate 'Explore the latest places' %}</h1>
|
||||||
<ul class="LP-PlaceGrid__Grid">
|
<ul class="LP-PlaceGrid__Grid">
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
|
|
||||||
{% partial 'welcome' %}
|
{% include 'partials/welcome.html' %}
|
||||||
<article class="LP-TextSection">
|
<article class="LP-TextSection">
|
||||||
<p class="LP-Paragraph">
|
<p class="LP-Paragraph">
|
||||||
{% blocktranslate %}You can create, view and share your lost places with other members of this site. You can upload photos, place links to your web galleries and contribute your knowledge by tagging other places or commenting on them. You will find detailed information on where these locations are, how to get there and what to expect from them. This might even include detailed information on the surroundings or the history of a lost place.{% endblocktranslate %}
|
{% blocktranslate %}You can create, view and share your lost places with other members of this site. You can upload photos, place links to your web galleries and contribute your knowledge by tagging other places or commenting on them. You will find detailed information on where these locations are, how to get there and what to expect from them. This might even include detailed information on the surroundings or the history of a lost place.{% endblocktranslate %}
|
||||||
@@ -25,9 +25,7 @@
|
|||||||
<a href="{% url 'place_detail' pk=place.pk %}" class="LP-Link">
|
<a href="{% url 'place_detail' pk=place.pk %}" class="LP-Link">
|
||||||
<article class="LP-PlaceTeaser">
|
<article class="LP-PlaceTeaser">
|
||||||
<div class="LP-PlaceTeaser__Image">
|
<div class="LP-PlaceTeaser__Image">
|
||||||
{% partial 'image' %}
|
{% include 'partials/image.html' with source_url=place.placeimages.first.filename.thumbnail.url %}
|
||||||
{% set source_url place.placeimages.first.filename.thumbnail.url %}
|
|
||||||
{% endpartial %}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="LP-PlaceTeaser__Meta">
|
<div class="LP-PlaceTeaser__Meta">
|
||||||
<div class="LP-PlaceTeaser__Info">
|
<div class="LP-PlaceTeaser__Info">
|
||||||
|
@@ -28,12 +28,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="LP-Voting__Expiration">
|
<div class="LP-Voting__Expiration">
|
||||||
<span class="LP-Voting__InfoLabel">Your vote expires on</span>
|
The accuracy of the voting is {{voting.accuracy}}%
|
||||||
<span class="LP-Voting__Date">
|
|
||||||
<time datetime="{{voting.expires_when|date:'Y-m-d'}}">
|
|
||||||
{{voting.users_vote.expires_when|date:'d.m.Y'}}
|
|
||||||
</time>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -39,8 +39,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{% translate 'Create' as action %}
|
{% translate 'Create' as action %}
|
||||||
<div class="LP-Form__Composition LP-Form__Composition--buttons">
|
<div class="LP-Form__Composition LP-Form__Composition--buttons">
|
||||||
|
{% include 'partials/form/inputField.html' with field=place_form.draft %}
|
||||||
{% include 'partials/form/submit.html' with referrer=request.META.HTTP_REFERER action=action %}
|
{% include 'partials/form/submit.html' with referrer=request.META.HTTP_REFERER action=action %}
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
@@ -23,15 +23,18 @@
|
|||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
<article class="LP-PlaceDetail">
|
<article class="LP-PlaceDetail">
|
||||||
<header class="LP-PlaceDetail__Header">
|
<header class="LP-PlaceDetail__Header">
|
||||||
<h1 class="LP-Headline">{{ place.name }} {% include 'partials/icons/place_favorite.html' %} {% include 'partials/icons/place_visited.html' %}</h1>
|
<h1 class="LP-Headline">
|
||||||
|
{{ place.name }}
|
||||||
|
{% include 'partials/icons/place_favorite.html' %}
|
||||||
|
{% include 'partials/icons/place_visited.html' %}
|
||||||
|
|
||||||
|
{% if user.is_superuser %}
|
||||||
|
<a class="LP-Link" href="{{'/admin/lostplaces/place/'|addstr:place.id }}" target="_blank"><span class="LP-Link__Text">{% translate 'view place in admin panel' %}</span></a>
|
||||||
|
{% endif %}
|
||||||
|
</h1>
|
||||||
{% if place.get_hero_image %}
|
{% if place.get_hero_image %}
|
||||||
<div class="LP-PlaceDetail__Image">
|
<div class="LP-PlaceDetail__Image">
|
||||||
{% partial image %}
|
{% include '../partials/image.html' with source_url=place.get_hero_image.filename.hero.url link_url="#image"|addstr:place.get_hero_index_in_queryset %}
|
||||||
{% set source_url place.get_hero_image.filename.hero.url %}
|
|
||||||
{% set link_url %}
|
|
||||||
{{"#image"|addstr:place.get_hero_index_in_queryset}}
|
|
||||||
{% endset %}
|
|
||||||
{% endpartial %}
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</header>
|
</header>
|
||||||
@@ -43,23 +46,18 @@
|
|||||||
<div class="LP-Quickinfo">
|
<div class="LP-Quickinfo">
|
||||||
<section class="LP-Section">
|
<section class="LP-Section">
|
||||||
{% url 'place_tag_submit' place_id=place.id as tag_submit_url %}
|
{% url 'place_tag_submit' place_id=place.id as tag_submit_url %}
|
||||||
{% partial tagging %}
|
{% include '../partials/tagging.html' with config=tagging_config %}
|
||||||
{% set config=tagging_config %}
|
|
||||||
{% endpartial %}
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{{votingplace.vote}}
|
{{votingplace.vote}}
|
||||||
<section class="LP-Section">
|
<section class="LP-Section">
|
||||||
{% partial voting %}
|
{% include '../partials/voting.html' with voting=placevoting %}
|
||||||
{% set place=place %}
|
|
||||||
{% set voting=placevoting %}
|
|
||||||
{% endpartial %}
|
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<section class="LP-Section">
|
<section class="LP-Section">
|
||||||
<h1 class="LP-Headline">{% translate 'Map links' %}</h1>
|
<h1 class="LP-Headline">{% translate 'Map links' %}</h1>
|
||||||
{% partial osm_map config=mapping_config %}
|
{% include '../partials/osm_map.html' with config=mapping_config %}
|
||||||
<ul class="LP-LinkList">
|
<ul class="LP-LinkList">
|
||||||
<li class="LP-LinkList__Item">
|
<li class="LP-LinkList__Item">
|
||||||
<a target="_blank" href="https://www.google.com/maps?q={{place.latitude|safe}},{{place.longitude|safe}}" class="LP-Link">
|
<a target="_blank" href="https://www.google.com/maps?q={{place.latitude|safe}},{{place.longitude|safe}}" class="LP-Link">
|
||||||
@@ -137,7 +135,7 @@
|
|||||||
|
|
||||||
<section class="LP-Section">
|
<section class="LP-Section">
|
||||||
{% translate 'Images' as headline %}
|
{% translate 'Images' as headline %}
|
||||||
{% partial "placeImageGrid" image_list=place.placeimages.all %}
|
{% include '../partials/placeImageGrid.html' with image_list=place.placeimages.all %}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="LP-Form__Composition LP-Form__Composition--buttons">
|
<div class="LP-Form__Composition LP-Form__Composition--buttons">
|
||||||
{% include 'partials/form/submit.html' with referrer=request.META.HTTP_REFERER %}
|
{% include 'partials/form/submit.html' with referer=request.META.HTTP_REFERER %}
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
@@ -1,13 +1,14 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import datetime
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from lostplaces.models import Place
|
from lostplaces.models import Place, PlaceVoting
|
||||||
from lostplaces.tests.models import ModelTestCase
|
from lostplaces.tests.models import ModelTestCase
|
||||||
|
|
||||||
class PlaceTestCase(ModelTestCase):
|
class PlaceTestCase(ModelTestCase):
|
||||||
@@ -106,12 +107,12 @@ class PlaceTestCase(ModelTestCase):
|
|||||||
an empty list
|
an empty list
|
||||||
'''
|
'''
|
||||||
avg_latlon = Place.average_latlon([])
|
avg_latlon = Place.average_latlon([])
|
||||||
self.assertEqual(avg_latlon['latitude'], 0,
|
self.assertEqual(avg_latlon['latitude'], 51.961922091398904,
|
||||||
msg='%s: (no places) average latitude missmatch' % (
|
msg='%s: (no places) average latitude missmatch' % (
|
||||||
self.model.__name__
|
self.model.__name__
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
self.assertEqual(avg_latlon['longitude'], 0,
|
self.assertEqual(avg_latlon['longitude'], 7.6295628132604385,
|
||||||
msg='%s: (no places) average longitude missmatch' % (
|
msg='%s: (no places) average longitude missmatch' % (
|
||||||
self.model.__name__
|
self.model.__name__
|
||||||
)
|
)
|
||||||
@@ -124,3 +125,169 @@ class PlaceTestCase(ModelTestCase):
|
|||||||
self.model.__name__
|
self.model.__name__
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_level_calculation(self):
|
||||||
|
explorer = self.place.submitted_by
|
||||||
|
|
||||||
|
PlaceVoting.objects.create(
|
||||||
|
submitted_by=explorer,
|
||||||
|
place=self.place,
|
||||||
|
vote=5
|
||||||
|
)
|
||||||
|
PlaceVoting.objects.create(
|
||||||
|
submitted_by=explorer,
|
||||||
|
place=self.place,
|
||||||
|
vote=2
|
||||||
|
)
|
||||||
|
PlaceVoting.objects.create(
|
||||||
|
submitted_by=explorer,
|
||||||
|
place=self.place,
|
||||||
|
vote=4
|
||||||
|
)
|
||||||
|
|
||||||
|
self.place.calculate_place_level()
|
||||||
|
|
||||||
|
self.assertEqual(
|
||||||
|
4,
|
||||||
|
self.place.level,
|
||||||
|
msg='Expecting the place level to be 4'
|
||||||
|
)
|
||||||
|
|
||||||
|
def test_level_calculation_no_votes(self):
|
||||||
|
self.place.calculate_place_level()
|
||||||
|
self.assertEqual(
|
||||||
|
5,
|
||||||
|
self.place.level,
|
||||||
|
msg='Expecting the default place level to be 5'
|
||||||
|
)
|
||||||
|
|
||||||
|
def test_level_mid_accuracy(self):
|
||||||
|
explorer = self.place.submitted_by
|
||||||
|
six_month_ago = datetime.timedelta(days=180)
|
||||||
|
self.place.submitted_when = timezone.now() - six_month_ago
|
||||||
|
|
||||||
|
votings = [
|
||||||
|
{
|
||||||
|
'date': timezone.now() - datetime.timedelta(days=170),
|
||||||
|
'vote': 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'date': timezone.now() - datetime.timedelta(days=23),
|
||||||
|
'vote': 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'date': timezone.now() - datetime.timedelta(days=1),
|
||||||
|
'vote': 4
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
for vote in votings:
|
||||||
|
voting = PlaceVoting.objects.create(
|
||||||
|
submitted_by=explorer,
|
||||||
|
place=self.place,
|
||||||
|
vote= vote['vote']
|
||||||
|
)
|
||||||
|
voting.submitted_when = vote['date']
|
||||||
|
voting.save()
|
||||||
|
|
||||||
|
self.assertEqual(
|
||||||
|
65,
|
||||||
|
self.place.calculate_voting_accuracy()
|
||||||
|
)
|
||||||
|
|
||||||
|
def test_level_high_accuracy(self):
|
||||||
|
explorer = self.place.submitted_by
|
||||||
|
six_month_ago = datetime.timedelta(days=180)
|
||||||
|
self.place.submitted_when = timezone.now() - six_month_ago
|
||||||
|
|
||||||
|
votings = [
|
||||||
|
{
|
||||||
|
'date': timezone.now() - datetime.timedelta(days=9),
|
||||||
|
'vote': 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'date': timezone.now() - datetime.timedelta(days=14),
|
||||||
|
'vote': 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'date': timezone.now() - datetime.timedelta(days=0),
|
||||||
|
'vote': 4
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
for vote in votings:
|
||||||
|
voting = PlaceVoting.objects.create(
|
||||||
|
submitted_by=explorer,
|
||||||
|
place=self.place,
|
||||||
|
vote= vote['vote']
|
||||||
|
)
|
||||||
|
voting.submitted_when = vote['date']
|
||||||
|
voting.save()
|
||||||
|
|
||||||
|
self.assertEqual(
|
||||||
|
96,
|
||||||
|
self.place.calculate_voting_accuracy()
|
||||||
|
)
|
||||||
|
|
||||||
|
def test_level_low_accuracy(self):
|
||||||
|
explorer = self.place.submitted_by
|
||||||
|
six_month_ago = datetime.timedelta(days=180)
|
||||||
|
self.place.submitted_when = timezone.now() - six_month_ago
|
||||||
|
|
||||||
|
votings = [
|
||||||
|
{
|
||||||
|
'date': timezone.now() - datetime.timedelta(days=177),
|
||||||
|
'vote': 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'date': timezone.now() - datetime.timedelta(days=150),
|
||||||
|
'vote': 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'date': timezone.now() - datetime.timedelta(days=100),
|
||||||
|
'vote': 4
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
for vote in votings:
|
||||||
|
voting = PlaceVoting.objects.create(
|
||||||
|
submitted_by=explorer,
|
||||||
|
place=self.place,
|
||||||
|
vote= vote['vote']
|
||||||
|
)
|
||||||
|
voting.submitted_when = vote['date']
|
||||||
|
voting.save()
|
||||||
|
|
||||||
|
self.assertEqual(
|
||||||
|
21,
|
||||||
|
self.place.calculate_voting_accuracy()
|
||||||
|
)
|
||||||
|
|
||||||
|
def test_level_accuracy_zero_timedelta(self):
|
||||||
|
explorer = self.place.submitted_by
|
||||||
|
six_month_ago = datetime.timedelta(days=180)
|
||||||
|
self.place.submitted_when = timezone.now() - six_month_ago
|
||||||
|
|
||||||
|
votings = [
|
||||||
|
{
|
||||||
|
'date': timezone.now() - datetime.timedelta(days=0),
|
||||||
|
'vote': 4
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
for vote in votings:
|
||||||
|
voting = PlaceVoting.objects.create(
|
||||||
|
submitted_by=explorer,
|
||||||
|
place=self.place,
|
||||||
|
vote= vote['vote']
|
||||||
|
)
|
||||||
|
voting.submitted_when = vote['date']
|
||||||
|
voting.save()
|
||||||
|
|
||||||
|
self.assertEqual(
|
||||||
|
100,
|
||||||
|
self.place.calculate_voting_accuracy(),
|
||||||
|
msg='Expecting the accurcy to be 100% when the vote is 0 time units old'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -9,10 +9,11 @@ from django.urls import reverse
|
|||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext as _
|
||||||
|
|
||||||
|
|
||||||
from lostplaces.models import Place
|
from lostplaces.models import Place
|
||||||
|
from lostplaces.models import PLACE_MODES
|
||||||
from lostplaces.views import (
|
from lostplaces.views import (
|
||||||
PlaceCreateView,
|
PlaceCreateView,
|
||||||
PlaceListView,
|
PlaceListView,
|
||||||
@@ -155,6 +156,38 @@ class TestPlaceListView(GlobalTemplateTestCaseMixin, ViewTestCase):
|
|||||||
msg='Expecting the user to see places where their level is high enough'
|
msg='Expecting the user to see places where their level is high enough'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_place_mode_filter(self):
|
||||||
|
explorer = User.objects.get(username='testpeter').explorer
|
||||||
|
Place.objects.all().delete()
|
||||||
|
|
||||||
|
for mode in PLACE_MODES:
|
||||||
|
place = Place.objects.create(
|
||||||
|
name='Im a place in mode %s' % mode[0],
|
||||||
|
submitted_when=timezone.now(),
|
||||||
|
submitted_by=explorer,
|
||||||
|
location='Test town',
|
||||||
|
latitude=50.5,
|
||||||
|
longitude=7.0,
|
||||||
|
description='This is just a test, do not worry %s' % mode[0],
|
||||||
|
level=3,
|
||||||
|
mode=mode[0]
|
||||||
|
)
|
||||||
|
|
||||||
|
self.client.login(username='testpeter', password='Develop123')
|
||||||
|
response = self.client.get(reverse('place_list'))
|
||||||
|
|
||||||
|
for mode in PLACE_MODES:
|
||||||
|
if ('Im a place in mode %s' % mode[0]) in response.content.decode():
|
||||||
|
self.assertTrue(
|
||||||
|
mode[0] == 'live',
|
||||||
|
msg='Expecting only places in mode \'live\' to be listed, saw a place in mode %s' % mode[0]
|
||||||
|
)
|
||||||
|
elif mode[0] == 'live':
|
||||||
|
self.fail(
|
||||||
|
msg='Expecting at least one place in mode \'live\' to be listed'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class TestPlaceCreateView(ViewTestCase):
|
class TestPlaceCreateView(ViewTestCase):
|
||||||
view = PlaceCreateView
|
view = PlaceCreateView
|
||||||
|
|
||||||
|
@@ -12,7 +12,7 @@ from django.contrib.messages.views import SuccessMessageMixin
|
|||||||
|
|
||||||
from django.shortcuts import redirect, get_object_or_404
|
from django.shortcuts import redirect, get_object_or_404
|
||||||
from django.urls import reverse_lazy, reverse
|
from django.urls import reverse_lazy, reverse
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext as _
|
||||||
|
|
||||||
from lostplaces.models import Place
|
from lostplaces.models import Place
|
||||||
from lostplaces.common import redirect_referer_or
|
from lostplaces.common import redirect_referer_or
|
||||||
@@ -138,4 +138,10 @@ class LevelCapPlaceListView(ListView):
|
|||||||
model = Place
|
model = Place
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
return self.request.user.explorer.get_places_eligible_to_see()
|
return self.request.user.explorer.get_place_list_to_display()
|
||||||
|
|
||||||
|
def get_context_data(self, **kwargs):
|
||||||
|
context = super().get_context_data(**kwargs)
|
||||||
|
context['place_list'] = context.pop('object_list')
|
||||||
|
return context
|
||||||
|
|
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from django.views import View
|
from django.views import View
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext as _
|
||||||
|
|
||||||
from django.shortcuts import render, redirect, get_object_or_404
|
from django.shortcuts import render, redirect, get_object_or_404
|
||||||
from django.urls import reverse_lazy
|
from django.urls import reverse_lazy
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
from django.views import View
|
from django.views import View
|
||||||
from django.shortcuts import get_object_or_404, redirect
|
from django.shortcuts import get_object_or_404, redirect
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext as _
|
||||||
|
|
||||||
from lostplaces.views.base_views import PlaceAssetCreateView, PlaceAssetDeleteView
|
from lostplaces.views.base_views import PlaceAssetCreateView, PlaceAssetDeleteView
|
||||||
from lostplaces.models import PlaceImage, Place
|
from lostplaces.models import PlaceImage, Place
|
||||||
|
@@ -10,7 +10,7 @@ from django.views.generic.detail import SingleObjectMixin
|
|||||||
|
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.contrib.messages.views import SuccessMessageMixin
|
from django.contrib.messages.views import SuccessMessageMixin
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext as _
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from django.shortcuts import render, redirect, get_object_or_404
|
from django.shortcuts import render, redirect, get_object_or_404
|
||||||
@@ -74,7 +74,8 @@ class PlaceDetailView(IsAuthenticatedMixin, IsEligibleToSeePlaceMixin, View):
|
|||||||
},
|
},
|
||||||
'placevoting': {
|
'placevoting': {
|
||||||
'users_vote': PlaceVoting.objects.filter(place=place, submitted_by=explorer).first(),
|
'users_vote': PlaceVoting.objects.filter(place=place, submitted_by=explorer).first(),
|
||||||
'all_choices': reversed(PLACE_LEVELS)
|
'all_choices': reversed(PLACE_LEVELS),
|
||||||
|
'accuracy': place.calculate_voting_accuracy()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return render(request, 'place/place_detail.html', context)
|
return render(request, 'place/place_detail.html', context)
|
||||||
@@ -204,8 +205,11 @@ class PlaceVisitDeleteView(IsAuthenticatedMixin, View):
|
|||||||
class PlaceVoteView(IsEligibleToSeePlaceMixin, View):
|
class PlaceVoteView(IsEligibleToSeePlaceMixin, View):
|
||||||
delta = timedelta(weeks=24)
|
delta = timedelta(weeks=24)
|
||||||
|
|
||||||
|
def get_place(self):
|
||||||
|
return get_object_or_404(Place, pk=self.kwargs['place_id'])
|
||||||
|
|
||||||
def get(self, request, place_id, vote):
|
def get(self, request, place_id, vote):
|
||||||
place = get_object_or_404(Place, id=place_id)
|
place = self.get_place()
|
||||||
explorer = request.user.explorer
|
explorer = request.user.explorer
|
||||||
|
|
||||||
voting = PlaceVoting.objects.filter(
|
voting = PlaceVoting.objects.filter(
|
||||||
@@ -217,12 +221,11 @@ class PlaceVoteView(IsEligibleToSeePlaceMixin, View):
|
|||||||
voting = PlaceVoting.objects.create(
|
voting = PlaceVoting.objects.create(
|
||||||
submitted_by=explorer,
|
submitted_by=explorer,
|
||||||
place=place,
|
place=place,
|
||||||
vote=vote,
|
vote=vote
|
||||||
expires_when=timezone.now()+self.delta
|
|
||||||
)
|
)
|
||||||
messages.success(self.request, _('Vote submitted'))
|
messages.success(self.request, _('Vote submitted'))
|
||||||
else:
|
else:
|
||||||
voting.expires_when=timezone.now()+self.delta
|
voting.submitted_when = timezone.now()
|
||||||
voting.vote = vote
|
voting.vote = vote
|
||||||
messages.success(self.request, _('Your vote has been update'))
|
messages.success(self.request, _('Your vote has been update'))
|
||||||
|
|
||||||
|
@@ -9,11 +9,11 @@ from django.contrib import messages
|
|||||||
from django.urls import reverse_lazy, reverse
|
from django.urls import reverse_lazy, reverse
|
||||||
from django.shortcuts import render, redirect, get_object_or_404
|
from django.shortcuts import render, redirect, get_object_or_404
|
||||||
from django.http import HttpResponseForbidden
|
from django.http import HttpResponseForbidden
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext as _
|
||||||
|
|
||||||
from lostplaces.forms import SignupVoucherForm, TagSubmitForm
|
from lostplaces.forms import SignupVoucherForm, TagSubmitForm
|
||||||
from lostplaces.models import Place, PhotoAlbum
|
from lostplaces.models import Place, PhotoAlbum
|
||||||
from lostplaces.views.base_views import IsAuthenticatedMixin
|
from lostplaces.views.base_views import IsAuthenticatedMixin, LevelCapPlaceListView
|
||||||
from lostplaces.common import redirect_referer_or
|
from lostplaces.common import redirect_referer_or
|
||||||
|
|
||||||
from lostplaces.views.base_views import (
|
from lostplaces.views.base_views import (
|
||||||
@@ -29,17 +29,19 @@ class SignUpView(SuccessMessageMixin, CreateView):
|
|||||||
template_name = 'signup.html'
|
template_name = 'signup.html'
|
||||||
success_message = _('User created')
|
success_message = _('User created')
|
||||||
|
|
||||||
class HomeView(IsAuthenticatedMixin, View):
|
class HomeView(IsAuthenticatedMixin, LevelCapPlaceListView, View):
|
||||||
def get(self, request, *args, **kwargs):
|
template_name = 'home.html'
|
||||||
place_list = request.user.explorer.get_places_eligible_to_see()
|
|
||||||
context = {
|
def get_context_data(self, **kwargs):
|
||||||
'place_list': place_list,
|
context = super().get_context_data(**kwargs)
|
||||||
'mapping_config': {
|
place_list = context['place_list']
|
||||||
|
|
||||||
|
context['mapping_config'] = {
|
||||||
'all_points': place_list,
|
'all_points': place_list,
|
||||||
'map_center': Place.average_latlon(place_list)
|
'map_center': Place.average_latlon(place_list)
|
||||||
}
|
}
|
||||||
}
|
return context
|
||||||
return render(request, 'home.html', context)
|
|
||||||
|
|
||||||
def handle_no_permission(self):
|
def handle_no_permission(self):
|
||||||
place_list = Place.objects.filter(level=1)[:5]
|
place_list = Place.objects.filter(level=1)[:5]
|
||||||
|
@@ -10,11 +10,11 @@ with open('Readme.md') as f:
|
|||||||
# https://www.python.org/dev/peps/pep-0440/#post-releases
|
# https://www.python.org/dev/peps/pep-0440/#post-releases
|
||||||
setup(
|
setup(
|
||||||
name='django-lostplaces',
|
name='django-lostplaces',
|
||||||
version='0.1.4.post1',
|
version='0.1.4.post2',
|
||||||
description='A django app to manage lost places',
|
description='A django app to manage lost places',
|
||||||
author='Reverend',
|
author='Reverend, Commander1024',
|
||||||
author_email='reverend@reverend2048.de',
|
author_email='reverend@reverend2048.de, commander@commander1024.de',
|
||||||
url='https://git.mowoe.com/reverend/lostplaces-backend',
|
url='https://git.commander1024.de/Commander1024/lostplaces-backend',
|
||||||
packages=find_packages(exclude=['django_lostplaces']),
|
packages=find_packages(exclude=['django_lostplaces']),
|
||||||
long_description=readme,
|
long_description=readme,
|
||||||
long_description_content_type='text/markdown',
|
long_description_content_type='text/markdown',
|
||||||
|
2
tasks.py
2
tasks.py
@@ -3,6 +3,7 @@ from invoke import task
|
|||||||
@task
|
@task
|
||||||
def quickstart(c):
|
def quickstart(c):
|
||||||
commands = [
|
commands = [
|
||||||
|
'pipenv run collectstatic',
|
||||||
'pipenv run migrate',
|
'pipenv run migrate',
|
||||||
'pipenv run createsuperuser',
|
'pipenv run createsuperuser',
|
||||||
'pipenv run server'
|
'pipenv run server'
|
||||||
@@ -14,6 +15,7 @@ def live(c):
|
|||||||
commands = [
|
commands = [
|
||||||
'pipenv check',
|
'pipenv check',
|
||||||
'pipenv run test',
|
'pipenv run test',
|
||||||
|
'pipenv run collectstatic',
|
||||||
'pipenv run migrate',
|
'pipenv run migrate',
|
||||||
'pipenv run createsuperuser_prompt'
|
'pipenv run createsuperuser_prompt'
|
||||||
'pipenv run server'
|
'pipenv run server'
|
||||||
|
Reference in New Issue
Block a user