Fixes on deployment

This commit is contained in:
Marc Aymerich 2015-10-01 20:14:32 +00:00
parent 8bb8c10930
commit 3f47a996b6
5 changed files with 16 additions and 32 deletions

22
TODO.md
View File

@ -390,18 +390,12 @@ Case
deploy --dev
deploy.sh and deploy-dev.sh autoupgrade
orchestra home autocomplete skeleton
short URLS: https://github.com/rsvp/gitio
link backend help text variables to settings/#var_name
$ sudo python manage.py startservices
Traceback (most recent call last):
File "manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
make python3 default python on the fucking docker container
autocomplete; on the form header and type="search"
To latest developers to post on this thread: I implemented the workaround I described in comment #14 nearly three months ago, and it has worked perfectly since then. While we would all prefer that "autocomplete=off" function properly at all times, it still functions properly if you include in your form an input element with any other autocomplete value.
@ -419,17 +413,3 @@ http://makandracards.com/makandra/24933-chrome-34+-firefox-38+-ie11+-ignore-auto
mkhomedir_helper or create ssh homes with bash.rc and such
$ sudo python3 manage.py setupnginx --user orchestra
/usr/lib/python3.4/importlib/_bootstrap.py:321: RemovedInDjango19Warning: django.utils.importlib will be removed in Django 1.9.
return f(*args, **kwds)
/usr/local/lib/python3.4/dist-packages/django/contrib/contenttypes/models.py:159: RemovedInDjango19Warning: Model class django.contrib.contenttypes.models.ContentType doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class ContentType(models.Model):
/usr/lib/python3.4/importlib/_bootstrap.py:321: RemovedInDjango19Warning: The django.forms.util module has been renamed. Use django.forms.utils instead.
return f(*args, **kwds)
/usr/lib/python3.4/importlib/_bootstrap.py:321: RemovedInDjango19Warning: The utilities in django.db.models.loading are deprecated in favor of the new application loading system.
return f(*args, **kwds)

View File

@ -124,7 +124,7 @@ function install_requirements () {
libcrack2-dev"
# cracklib and lxml are excluded on the requirements.txt because they need unconvinient system dependencies
PIP="$(wget https://raw.githubusercontent.com/glic3rinu/django-orchestra/master/requirements.txt -q -O - | tr '\n' ' ') \
PIP="$(curl https://raw.githubusercontent.com/glic3rinu/django-orchestra/master/requirements.txt | tr '\n' ' ') \
cracklib \
lxml==3.3.5"
@ -147,9 +147,11 @@ function install_requirements () {
fi
# Install a more recent version of wkhtmltopdf (0.12.2) (PDF page number support)
wkhtmltox=$(mktemp)
wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-jessie-amd64.deb -O ${wkhtmltox}
dpkg -i ${wkhtmltox} || { echo "Installing missing dependencies for wkhtmltox..." && apt-get -f -y install; }
if [[ $(dpkg --list | grep wkhtmltox | awk {'print $3'}) != "0.12.2.1" ]]; then
wkhtmltox=$(mktemp)
wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-jessie-amd64.deb -O ${wkhtmltox}
dpkg -i ${wkhtmltox} || { echo "Installing missing dependencies for wkhtmltox..." && apt-get -f -y install; }
fi
# Make sure locales are in place before installing postgres
if [[ $({ perl --help > /dev/null; } 2>&1|grep 'locale failed') ]]; then

View File

@ -1,11 +1,13 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import sys
if __name__ == "__main__":
if sys.version_info < (3, 4):
cmd = ' '.join(sys.argv)
sys.stderr.write("Sorry, you need at least Python 3.4, try with:\n$ python3 %s\n" % cmd)
sys.exit(1)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)

View File

@ -60,8 +60,8 @@ class Command(BaseCommand):
sed -i "s/'NAME':[^#]*/'NAME': '%(db_name)s',/" %(settings)s
sed -i "s/'USER':[^#]*/'USER': '%(db_user)s',/" %(settings)s
sed -i "s/'PASSWORD':[^#]*/'PASSWORD': '%(db_password)s',/" %(settings)s
sed -i "s/'HOST': [^#]*/'HOST': '%(db_host)s',/" %(settings)s
sed -i "s/'PORT': [^#]*/'PORT': '%(db_port)s',/" %(settings)s\
sed -i "s/'HOST':[^#]*/'HOST': '%(db_host)s',/" %(settings)s
sed -i "s/'PORT':[^#]*/'PORT': '%(db_port)s',/" %(settings)s\
""") % context
)
else:

View File

@ -79,7 +79,7 @@ function main () {
run python3 -W ignore manage.py collectstatic --noinput
run sudo apt-get install nginx-full uwsgi uwsgi-plugin-python3
run sudo python3 -W ignore manage.py setupnginx --user $USER
run sudo python3 -W ignore manage.py startservices
run sudo python3 -W ignore manage.py restartservices
run python3 -W ignore manage.py check --deploy
}