Fixes on deployment

This commit is contained in:
Marc Aymerich 2015-10-03 13:08:41 +00:00
parent f620feae08
commit 440153e42e
4 changed files with 12 additions and 13 deletions

View File

@ -21,7 +21,7 @@ If you are planing to do some development you may want to consider doing it unde
3. Deploy django-orchestra development environment
```bash
bash <( curl -L https://git.io/deploy-orchestra ) --dev
bash <( curl -L http://git.io/orchestra-deploy ) --dev
```
3. Nginx should be serving on port 80, but Django's development server can be used as well:
@ -33,5 +33,5 @@ If you are planing to do some development you may want to consider doing it unde
5. To upgrade to current master just re-run the deploy script
```bash
bash <( curl -L https://git.io/deploy-orchestra ) --dev
bash <( curl -L http://git.io/orchestra-deploy ) --dev
```

View File

@ -9,6 +9,7 @@ from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse, NoReverseMatch
from django.db import models
from django.shortcuts import redirect
from django.utils import timezone
from django.utils.html import escape
from django.utils.safestring import mark_safe
@ -141,16 +142,15 @@ def admin_colored(*args, **kwargs):
@admin_field
def admin_date(*args, **kwargs):
instance = args[-1]
value = get_field_value(instance, kwargs['field'])
if not value:
date = get_field_value(instance, kwargs['field'])
if not date:
return kwargs.get('default', '')
if isinstance(value, datetime.datetime):
natural = humanize.naturaldatetime(value)
if isinstance(date, datetime.datetime):
natural = humanize.naturaldatetime(date)
else:
natural = humanize.naturaldate(value)
return '<span title="{0}">{1}</span>'.format(
escape(str(value)), escape(natural),
)
natural = humanize.naturaldate(date)
local = timezone.localtime(date).strftime("%Y-%m-%d %H:%M:%S %Z")
return '<span title="{0}">{1}</span>'.format(local, escape(natural))
def get_object_from_url(modeladmin, request):

View File

@ -82,6 +82,7 @@ def naturaldatetime(date, show_seconds=False):
).format(hours=hours, ago=ago)
if delta_midnight.days == 0:
date = timezone.localtime(date)
return _("yesterday at {time}").format(time=date.strftime('%H:%M'))
count = 0

View File

@ -1,9 +1,7 @@
django==1.8.2
django-celery-email==1.0.4
django-fluent-dashboard==0.5.3
django-admin-tools==0.6.0
django-extensions==1.5.2
django-transaction-signals==1.0.0
django-celery==3.1.16
celery==3.1.16
kombu==3.0.23
@ -15,7 +13,7 @@ Pygments==1.6
django-filter==0.7
jsonfield==0.9.22
python-dateutil==2.2
https://github.com/glic3rinu/passlib/archive/master.zip
passlib==1.6.2
django-iban==0.3.0
requests
phonenumbers