4 Commits

Author SHA1 Message Date
163e9beb51 Documention für pipenv scripts 2021-12-31 23:42:04 +01:00
6ba225bee3 Version id compliant to PEP 440 2021-12-31 23:34:42 +01:00
a4f80820c9 Hotfix for Migration Error 2021-12-31 23:27:35 +01:00
0f7b799c11 More / Better Scripts for Task Running 2021-12-31 23:27:06 +01:00
5 changed files with 46 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ pandoc = "*"
pylint-django = "*"
setuptools = "*"
django-nose = "*"
invoke = "*"
[packages]
django = "*"
@@ -30,3 +31,7 @@ showmigrations = "django_lostplaces/manage.py showmigrations"
makemigrations = "django_lostplaces/manage.py makemigrations --no-input"
migrate = "django_lostplaces/manage.py migrate"
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"

View File

@@ -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:

View File

@@ -32,7 +32,7 @@ class Migration(migrations.Migration):
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.models.generate_profile_image_filename, verbose_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',

View File

@@ -6,9 +6,11 @@ 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.post1',
description='A django app to manage lost places',
author='Reverend',
author_email='reverend@reverend2048.de',
@@ -33,4 +35,4 @@ setup(
],
include_package_data=True,
license='MIT'
)
)

21
tasks.py Normal file
View File

@@ -0,0 +1,21 @@
from invoke import task
@task
def quickstart(c):
commands = [
'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 migrate',
'pipenv run createsuperuser_prompt'
'pipenv run server'
]
c.run(' && '.join(commands))