Compare commits
17 Commits
78efe9bebb
...
update/dja
Author | SHA1 | Date | |
---|---|---|---|
|
9c50e5891f | ||
|
72094494eb | ||
|
c483c3511d | ||
14effd33e2 | |||
19300614bc | |||
830120a929 | |||
ddd0f8c903 | |||
f078afcdcd | |||
d5f6a00219 | |||
f376951ff9 | |||
163e9beb51 | |||
6ba225bee3 | |||
a4f80820c9 | |||
0f7b799c11 | |||
b23dc8a627 | |||
3e2ab1e12d | |||
1bc283bd8d |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -79,7 +79,6 @@ Pipfile.lock
|
||||
__pypackages__/
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
@@ -95,3 +94,6 @@ venv.bak/
|
||||
|
||||
# Django Migrations for Development branches
|
||||
django_lostplaces/lostplaces/migrations/*
|
||||
|
||||
# Django Static files
|
||||
django_lostplaces/static/*
|
6
Pipfile
6
Pipfile
@@ -14,6 +14,7 @@ pandoc = "*"
|
||||
pylint-django = "*"
|
||||
setuptools = "*"
|
||||
django-nose = "*"
|
||||
invoke = "*"
|
||||
|
||||
[packages]
|
||||
django = "*"
|
||||
@@ -29,4 +30,9 @@ dbshell = "django_lostplaces/manage.py dbshell"
|
||||
showmigrations = "django_lostplaces/manage.py showmigrations"
|
||||
makemigrations = "django_lostplaces/manage.py makemigrations --no-input"
|
||||
migrate = "django_lostplaces/manage.py migrate"
|
||||
collectstatic = "django_lostplaces/manage.py collectstatic"
|
||||
build = "django_lostplaces/setup.py bdist_wheel --universal"
|
||||
createsuperuser = "django_lostplaces/manage.py createsuperuser --noinput --username admin --email admin@example.org"
|
||||
createsuperuser_prompt = "django_lostplaces/manage.py createsuperuser"
|
||||
quickstart = "invoke quickstart"
|
||||
security = "pipenv check"
|
17
Readme.md
17
Readme.md
@@ -35,7 +35,7 @@ Right now it depends on the following non-core Python 3 libraries. These can be
|
||||
|
||||
# Installing a development instance
|
||||
## Clone the repository
|
||||
`git clone https://git.mowoe.com/reverend/lostplaces-backend.git`
|
||||
`git clone https://git.commander1024.de/Commander1024/lostplaces-backend`
|
||||
## 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](https://docs.pipenv.org/) virtual environment. The repo provides a Pipfile for easy dependency management that does not mess with your system.
|
||||
@@ -65,6 +65,21 @@ Visit: [admin](http://localhost:8000/admin) for administrative backend or
|
||||
|
||||
Happy developing ;-)
|
||||
|
||||
# Pipenv Scripts
|
||||
This project comes with a bunch of convinient scripts, like:
|
||||
|Script|Description|
|
||||
|---|---|
|
||||
|test|Runs the tests|
|
||||
|server|Starts a **development** server|
|
||||
|dbshell|Opens a shell session in the database|
|
||||
|showmigrations|Lists all Migrations|
|
||||
|makemigrations|Creates a migration|
|
||||
|migrate|Applies unapplied migrations|
|
||||
|build|Builds this project into a wheel file|
|
||||
|createsuperuser|Creates a superuser with the username **admin** and the password **develop**. This is for development and demo instances only!
|
||||
|quickstart|Runs *migrate*, *createsuperuser* and *server*|
|
||||
|
||||
|
||||
# Installing a productive instance
|
||||
|
||||
Currently there are two ways to deploy the lostplaces project:
|
||||
|
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'
|
||||
|
||||
# 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
|
||||
@@ -145,15 +145,16 @@ LANGUAGES = [
|
||||
# https://docs.djangoproject.com/en/3.1/howto/static-files/
|
||||
|
||||
STATIC_URL = '/static/'
|
||||
STATIC_ROOT = os.path.join(BASE_DIR, 'static_files')
|
||||
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
||||
|
||||
# Upload directory
|
||||
MEDIA_URL = '/uploads/'
|
||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'uploads')
|
||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'uploads/')
|
||||
|
||||
# Thumbnails
|
||||
THUMBNAIL_MEDIA_ROOT = os.path.join(MEDIA_ROOT, 'thumbs/')
|
||||
THUMBNAIL_MEDIA_URL = os.path.join(MEDIA_URL, 'thumbs/')
|
||||
RELATIVE_THUMBNAIL_PATH = 'images/'
|
||||
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
|
||||
|
||||
# Templates to use for authentication
|
||||
|
@@ -19,8 +19,9 @@ Including another URLconf
|
||||
|
||||
from django.contrib import admin
|
||||
from django.conf import settings
|
||||
from django.views.static import serve
|
||||
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 lostplaces.views import SignUpView
|
||||
@@ -30,4 +31,6 @@ urlpatterns = [
|
||||
path('signup/', SignUpView.as_view(), name='signup'),
|
||||
path('explorer/', include('django.contrib.auth.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.contrib.auth.forms import UserCreationForm, UserChangeForm
|
||||
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.models import Place, PlaceImage, Voucher, Explorer
|
||||
|
@@ -1,118 +0,0 @@
|
||||
# Generated by Django 3.1.4 on 2020-12-25 16:02
|
||||
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import easy_thumbnails.fields
|
||||
from lostplaces.models.models import generate_profile_image_filename
|
||||
from lostplaces.models.place import generate_place_image_filename
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('lostplaces', '0003_voucher'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='explorer',
|
||||
name='bio',
|
||||
field=models.TextField(blank=True, help_text='Describe yourself, your preferences, etc. in a few sentences.', null=True, verbose_name='Biography / Description'),
|
||||
),
|
||||
# migrations.AddField(
|
||||
# model_name='explorer',
|
||||
# name='favorite_places',
|
||||
# field=models.ManyToManyField(blank=True, related_name='explorer_favorites', to='lostplaces.Place', verbose_name='Explorers favorite places'),
|
||||
# ),
|
||||
migrations.AddField(
|
||||
model_name='explorer',
|
||||
name='profile_image',
|
||||
field=easy_thumbnails.fields.ThumbnailerImageField(blank=True, help_text='Optional profile image for display in Explorer profile', null=True, upload_to=generate_profile_image_filename, verbose_name='Profile image'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='photoalbum',
|
||||
name='label',
|
||||
field=models.CharField(max_length=100, verbose_name='link text'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='photoalbum',
|
||||
name='submitted_by',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='photoalbums', to='lostplaces.explorer', verbose_name='Submitter'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='photoalbum',
|
||||
name='submitted_when',
|
||||
field=models.DateTimeField(auto_now_add=True, null=True, verbose_name='Submission date'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='photoalbum',
|
||||
name='url',
|
||||
field=models.URLField(verbose_name='URL'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='place',
|
||||
name='description',
|
||||
field=models.TextField(help_text="Description of the place: e.g. how to get there, where to be careful, the place's history...", verbose_name='Description'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='place',
|
||||
name='latitude',
|
||||
field=models.FloatField(help_text='Latitude in decimal format: e. g. 41.40338', validators=[django.core.validators.MinValueValidator(-90), django.core.validators.MaxValueValidator(90)], verbose_name='Latitude'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='place',
|
||||
name='location',
|
||||
field=models.CharField(max_length=50, verbose_name='Location'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='place',
|
||||
name='longitude',
|
||||
field=models.FloatField(help_text='Longitude in decimal format: e. g. 2.17403', validators=[django.core.validators.MinValueValidator(-180), django.core.validators.MaxValueValidator(180)], verbose_name='Longitude'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='place',
|
||||
name='name',
|
||||
field=models.CharField(max_length=50, verbose_name='Name'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='place',
|
||||
name='submitted_by',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='places', to='lostplaces.explorer', verbose_name='Submitter'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='place',
|
||||
name='submitted_when',
|
||||
field=models.DateTimeField(auto_now_add=True, null=True, verbose_name='Submission date'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='placeimage',
|
||||
name='description',
|
||||
field=models.TextField(blank=True, verbose_name='Description'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='placeimage',
|
||||
name='filename',
|
||||
field=easy_thumbnails.fields.ThumbnailerImageField(help_text='Optional: One or more images to upload', upload_to=generate_place_image_filename, verbose_name='Filename(s)'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='placeimage',
|
||||
name='submitted_by',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='placeimages', to='lostplaces.explorer', verbose_name='Submitter'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='placeimage',
|
||||
name='submitted_when',
|
||||
field=models.DateTimeField(auto_now_add=True, null=True, verbose_name='Submission date'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='voucher',
|
||||
name='created_when',
|
||||
field=models.DateTimeField(auto_now_add=True, verbose_name='Creation date'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='voucher',
|
||||
name='expires_when',
|
||||
field=models.DateTimeField(verbose_name='Expiration date'),
|
||||
),
|
||||
]
|
@@ -1,18 +0,0 @@
|
||||
# Generated by Django 3.1.4 on 2020-12-25 18:14
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('lostplaces', '0004_gory_fix'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='explorer',
|
||||
name='visited_places',
|
||||
field=models.ManyToManyField(blank=True, related_name='explorer_visits', to='lostplaces.Place', verbose_name='Explorers visited places'),
|
||||
),
|
||||
]
|
@@ -0,0 +1,85 @@
|
||||
# Generated by Django 3.2.10 on 2021-12-31 17:20
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import easy_thumbnails.fields
|
||||
import lostplaces.models.models
|
||||
import lostplaces.models.place
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('lostplaces', '0004_release_0_1_3'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='explorer',
|
||||
name='bio',
|
||||
field=models.TextField(blank=True, help_text='Describe yourself, your preferences, etc. in a few sentences.', null=True, verbose_name='Biography / Description'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='explorer',
|
||||
name='favorite_places',
|
||||
field=models.ManyToManyField(blank=True, related_name='explorer_favorites', to='lostplaces.Place', verbose_name='Explorers favorite places'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='explorer',
|
||||
name='level',
|
||||
field=models.IntegerField(choices=[(1, 'Newbie'), (2, 'Scout'), (3, 'Explorer'), (4, 'Journalist'), (5, 'Housekeeper')], default=1),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='explorer',
|
||||
name='profile_image',
|
||||
field=easy_thumbnails.fields.ThumbnailerImageField(blank=True, help_text='Optional profile image for display in Explorer profile', null=True, upload_to=lostplaces.models.generate_profile_image_filename, verbose_name='Profile image'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='explorer',
|
||||
name='visited_places',
|
||||
field=models.ManyToManyField(blank=True, related_name='explorer_visits', to='lostplaces.Place', verbose_name='Explorers visited places'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='place',
|
||||
name='hero',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='place_heros', to='lostplaces.placeimage'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='place',
|
||||
name='level',
|
||||
field=models.IntegerField(choices=[(1, 'Ruin'), (2, 'Vandalized'), (3, 'Natures Treasure'), (4, 'Lost in History'), (5, 'Time Capsule')], default=5),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='placeimage',
|
||||
name='filename',
|
||||
field=easy_thumbnails.fields.ThumbnailerImageField(help_text='Optional: One or more images to upload', upload_to=lostplaces.models.place.generate_place_image_filename, verbose_name='Images'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='PlaceVoting',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('submitted_when', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Submission date')),
|
||||
('created_when', models.DateTimeField(auto_now_add=True, verbose_name='Creation date')),
|
||||
('expires_when', models.DateTimeField(verbose_name='Expiration date')),
|
||||
('vote', models.IntegerField(choices=[(1, 'Ruin'), (2, 'Vandalized'), (3, 'Natures Treasure'), (4, 'Lost in History'), (5, 'Time Capsule')])),
|
||||
('place', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='placevotings', to='lostplaces.place')),
|
||||
('submitted_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='placevotings', to='lostplaces.explorer', verbose_name='Submitter')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='DummyAsset',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('submitted_when', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Submission date')),
|
||||
('name', models.CharField(max_length=50)),
|
||||
('place', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='dummyassets', to='lostplaces.place')),
|
||||
('submitted_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='dummyassets', to='lostplaces.explorer', verbose_name='Submitter')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
]
|
@@ -1,14 +0,0 @@
|
||||
# Generated by Django 3.2.5 on 2021-07-16 11:15
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('lostplaces', '0004_release_0_1_3'),
|
||||
('lostplaces', '0005_add_visited_places'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
]
|
@@ -1,7 +1,7 @@
|
||||
|
||||
from django.utils import timezone
|
||||
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 taggit.managers import TaggableManager
|
||||
|
@@ -1,5 +1,5 @@
|
||||
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
|
||||
|
||||
|
@@ -13,7 +13,7 @@ from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
from django.db.models.signals import post_save, pre_save
|
||||
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.place import Place
|
||||
|
@@ -5,7 +5,8 @@ from django.db import models
|
||||
from django.urls import reverse
|
||||
from django.dispatch import receiver
|
||||
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.conf import settings
|
||||
|
||||
from lostplaces.models.abstract_models import Submittable, Taggable, Mapable, Expireable
|
||||
|
||||
@@ -120,7 +121,7 @@ def generate_place_image_filename(instance, filename):
|
||||
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):
|
||||
return generate_place_image_filename(instance, filename)
|
||||
|
@@ -89,7 +89,7 @@
|
||||
</div>
|
||||
|
||||
{% block footer %}
|
||||
{% partial 'nav/footer' %}
|
||||
{% include 'partials/nav/footer.html' %}
|
||||
{% endblock footer %}
|
||||
|
||||
</body>
|
||||
|
@@ -12,13 +12,10 @@
|
||||
|
||||
{% block maincontent %}
|
||||
|
||||
{% partial 'welcome' %}
|
||||
{% include 'partials/welcome.html' %}
|
||||
<article class="LP-TextSection">
|
||||
</article>
|
||||
{% partial 'osm_map' %}
|
||||
{% set config mapping_config %}
|
||||
{% set modifier 'wide' %}
|
||||
{% endpartial %}
|
||||
{% include 'partials/osm_map.html' with config=mapping_config modifier='wide' %}
|
||||
<div class="LP-PlaceGrid">
|
||||
<h1 class="LP-Headline LP-Headline">{% translate 'Explore the latest places' %}</h1>
|
||||
<ul class="LP-PlaceGrid__Grid">
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
{% block maincontent %}
|
||||
|
||||
{% partial 'welcome' %}
|
||||
{% include 'partials/welcome.html' %}
|
||||
<article class="LP-TextSection">
|
||||
<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 %}
|
||||
@@ -25,9 +25,7 @@
|
||||
<a href="{% url 'place_detail' pk=place.pk %}" class="LP-Link">
|
||||
<article class="LP-PlaceTeaser">
|
||||
<div class="LP-PlaceTeaser__Image">
|
||||
{% partial 'image' %}
|
||||
{% set source_url place.placeimages.first.filename.thumbnail.url %}
|
||||
{% endpartial %}
|
||||
{% include 'partials/image.html' with source_url=place.placeimages.first.filename.thumbnail.url %}
|
||||
</div>
|
||||
<div class="LP-PlaceTeaser__Meta">
|
||||
<div class="LP-PlaceTeaser__Info">
|
||||
|
@@ -26,12 +26,7 @@
|
||||
<h1 class="LP-Headline">{{ place.name }} {% include 'partials/icons/place_favorite.html' %} {% include 'partials/icons/place_visited.html' %}</h1>
|
||||
{% if place.get_hero_image %}
|
||||
<div class="LP-PlaceDetail__Image">
|
||||
{% partial image %}
|
||||
{% set source_url place.get_hero_image.filename.hero.url %}
|
||||
{% set link_url %}
|
||||
{{"#image"|addstr:place.get_hero_index_in_queryset}}
|
||||
{% endset %}
|
||||
{% endpartial %}
|
||||
{% include '../partials/image.html' with source_url=place.get_hero_image.filename.hero.url link_url="#image"|addstr:place.get_hero_index_in_queryset %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</header>
|
||||
@@ -43,23 +38,18 @@
|
||||
<div class="LP-Quickinfo">
|
||||
<section class="LP-Section">
|
||||
{% url 'place_tag_submit' place_id=place.id as tag_submit_url %}
|
||||
{% partial tagging %}
|
||||
{% set config=tagging_config %}
|
||||
{% endpartial %}
|
||||
{% include '../partials/tagging.html' with config=tagging_config %}
|
||||
</section>
|
||||
|
||||
{{votingplace.vote}}
|
||||
<section class="LP-Section">
|
||||
{% partial voting %}
|
||||
{% set place=place %}
|
||||
{% set voting=placevoting %}
|
||||
{% endpartial %}
|
||||
{% include '../partials/voting.html' with voting=placevoting %}
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<section class="LP-Section">
|
||||
<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">
|
||||
<li class="LP-LinkList__Item">
|
||||
<a target="_blank" href="https://www.google.com/maps?q={{place.latitude|safe}},{{place.longitude|safe}}" class="LP-Link">
|
||||
@@ -137,7 +127,7 @@
|
||||
|
||||
<section class="LP-Section">
|
||||
{% translate 'Images' as headline %}
|
||||
{% partial "placeImageGrid" image_list=place.placeimages.all %}
|
||||
{% include '../partials/placeImageGrid.html' with image_list=place.placeimages.all %}
|
||||
</section>
|
||||
|
||||
</article>
|
||||
|
@@ -9,7 +9,7 @@ from django.urls import reverse
|
||||
from django.contrib.auth.models import User
|
||||
from django.utils import timezone
|
||||
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
|
||||
|
@@ -12,7 +12,7 @@ from django.contrib.messages.views import SuccessMessageMixin
|
||||
|
||||
from django.shortcuts import redirect, get_object_or_404
|
||||
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.common import redirect_referer_or
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
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.urls import reverse_lazy
|
||||
|
@@ -1,6 +1,6 @@
|
||||
from django.views import View
|
||||
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.models import PlaceImage, Place
|
||||
|
@@ -10,7 +10,7 @@ from django.views.generic.detail import SingleObjectMixin
|
||||
|
||||
from django.contrib import messages
|
||||
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.shortcuts import render, redirect, get_object_or_404
|
||||
|
@@ -9,7 +9,7 @@ from django.contrib import messages
|
||||
from django.urls import reverse_lazy, reverse
|
||||
from django.shortcuts import render, redirect, get_object_or_404
|
||||
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.models import Place, PhotoAlbum
|
||||
|
@@ -6,13 +6,15 @@ from setuptools import setup, find_packages
|
||||
with open('Readme.md') as f:
|
||||
readme = f.read()
|
||||
|
||||
# Keep PEP 440 for version identification in mind
|
||||
# https://www.python.org/dev/peps/pep-0440/#post-releases
|
||||
setup(
|
||||
name='django-lostplaces',
|
||||
version='0.1.3',
|
||||
version='0.1.4.post2',
|
||||
description='A django app to manage lost places',
|
||||
author='Reverend',
|
||||
author_email='reverend@reverend2048.de',
|
||||
url='https://git.mowoe.com/reverend/lostplaces-backend',
|
||||
author='Reverend, Commander1024',
|
||||
author_email='reverend@reverend2048.de, commander@commander1024.de',
|
||||
url='https://git.commander1024.de/Commander1024/lostplaces-backend',
|
||||
packages=find_packages(exclude=['django_lostplaces']),
|
||||
long_description=readme,
|
||||
long_description_content_type='text/markdown',
|
||||
@@ -33,4 +35,4 @@ setup(
|
||||
],
|
||||
include_package_data=True,
|
||||
license='MIT'
|
||||
)
|
||||
)
|
23
tasks.py
Normal file
23
tasks.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from invoke import task
|
||||
|
||||
@task
|
||||
def quickstart(c):
|
||||
commands = [
|
||||
'pipenv run collectstatic',
|
||||
'pipenv run migrate',
|
||||
'pipenv run createsuperuser',
|
||||
'pipenv run server'
|
||||
]
|
||||
c.run(' && '.join(commands))
|
||||
|
||||
@task
|
||||
def live(c):
|
||||
commands = [
|
||||
'pipenv check',
|
||||
'pipenv run test',
|
||||
'pipenv run collectstatic',
|
||||
'pipenv run migrate',
|
||||
'pipenv run createsuperuser_prompt'
|
||||
'pipenv run server'
|
||||
]
|
||||
c.run(' && '.join(commands))
|
Reference in New Issue
Block a user