From: Guillaume Pellerin Date: Sun, 29 Jul 2018 20:23:33 +0000 (+0200) Subject: Merge branch 'dev' X-Git-Tag: 1.7.0~2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=315c7ef1fde90ec21edf215019ed7d1c5546a6b4;p=telemeta.git Merge branch 'dev' --- 315c7ef1fde90ec21edf215019ed7d1c5546a6b4 diff --cc app/bin/app.sh index 00000000,37568a03..bb9fbecf mode 000000,100755..100755 --- a/app/bin/app.sh +++ b/app/bin/app.sh @@@ -1,0 -1,65 +1,66 @@@ + #!/bin/bash + + # paths + app='/srv/app' + manage=$app'/manage.py' + wsgi=$app'/wsgi.py' + static='/srv/static/' + media='/srv/media/' + lib='/srv/lib/' + log='/var/log/uwsgi/app.log' + + # uwsgi params + port=8000 -processes=8 -threads=8 ++processes=2 ++threads=2 + uid='www-data' + gid='www-data' + + # stating apps + # pip uninstall -y south + # pip install -U django==1.8.18 django-registration-redux djangorestframework==3.6.4 + # pip install django-debug-toolbar==1.6 + # pip install -e git+https://github.com/Parisson/django-jqchat.git@dj1.8#egg=django-jqchat -# pip install -e git+https://github.com/Parisson/saved_searches.git@dj1.8#egg=saved_searches-2.0.0-beta ++# pip install -e git+https://github.com/Parisson/saved_searches.git@dj1.8#egg=saved_searches-2.0.0-beta>>>>>>> dev:app/bin/app.sh + + # waiting for other network services + sh $app/bin/wait.sh + python $manage wait-for-db + + if [ ! -f .init ]; then + python $manage migrate --noinput + python $manage bower_install -- --allow-root ++ python $manage collectstatic --noinput + touch .init + fi + + # telemeta setup + python $manage telemeta-create-admin-user + python $manage telemeta-create-boilerplate + python $manage telemeta-setup-enumerations + + + # Delete Timeside database if it exists + cat /srv/lib/telemeta/bin/sql/drop_timeside.sql | python $manage dbshell + + if [ $REINDEX = "True" ]; then + python $manage rebuild_index --noinput + fi + + # choose dev or prod mode + if [ "$1" = "--runserver" ]; then + python $manage runserver 0.0.0.0:8000 + else + # static files auto update + # watchmedo shell-command --patterns="$patterns" --recursive \ + # --command='python '$manage' collectstatic --noinput' $lib & + python $manage collectstatic --noinput + + # fix media access rights + find $media -maxdepth 1 -path ${media}import -prune -o -type d -not -user www-data -exec chown www-data:www-data {} \; + + # app start + uwsgi --socket :$port --wsgi-file $wsgi --chdir $app --master \ + --processes $processes --threads $threads \ + --uid $uid --gid $gid --logto $log --touch-reload $wsgi + fi diff --cc app/settings.py index 0bb4058c,1c474d9e..828a7819 --- a/app/settings.py +++ b/app/settings.py @@@ -11,10 -12,9 +12,8 @@@ env = environ.Env(DEBUG=(bool, False) ) # Django settings for server project. - DEBUG = env('DEBUG') # False if not in os.environ - DEBUG=True - TEMPLATE_DEBUG = DEBUG + DEBUG = env('DEBUG') # False if not in os.environ - sys.dont_write_bytecode = True ALLOWED_HOSTS = ['*'] diff --cc lib/TimeSide index 86f699cd,86f699cd..506b3517 --- a/lib/TimeSide +++ b/lib/TimeSide @@@ -1,1 -1,1 +1,1 @@@ --Subproject commit 86f699cd61db2c0dc7fed61c4bb9f44ca3d8868f ++Subproject commit 506b3517fbd981c66372f4b7efce2d333cd2b8d0 diff --cc telemeta/forms/language.py index 5c7cbeb1,5f43062a..99ad81e6 --- a/telemeta/forms/language.py +++ b/telemeta/forms/language.py @@@ -22,9 -22,7 +22,9 @@@ from django.forms import ModelForm from telemeta.models import * + class LanguageForm(ModelForm): + class Meta: model = Language - fields = ('__all__') + fields = '__all__' diff --cc telemeta/forms/system.py index b1ae8e47,ec0e3eb0..e8b5e3ac --- a/telemeta/forms/system.py +++ b/telemeta/forms/system.py @@@ -24,7 -24,6 +24,7 @@@ from telemeta.models import class UserProfileForm(ModelForm): + class Meta: model = UserProfile - fields = ('__all__') + fields = '__all__' diff --cc telemeta/models/location.py index a7318612,f675c95c..cfcfd3ca --- a/telemeta/models/location.py +++ b/telemeta/models/location.py @@@ -189,10 -189,9 +189,10 @@@ class LocationRelation(ModelCore) class LocationForm(ModelForm): + class Meta: model = Location - fields = ('__all__') + fields = '__all__' def __init__(self, *args, **kwds): super(LocationForm, self).__init__(*args, **kwds)