Skip to content

Commit

Permalink
Merge pull request #801 from erozqba/lingxiaoyang-maintenance/20170717
Browse files Browse the repository at this point in the history
Lingxiaoyang maintenance/20170717
  • Loading branch information
lingxiaoyang committed Aug 25, 2017
2 parents 4550a1a + 6fb93f7 commit 7253b48
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions requirements.txt
Expand Up @@ -11,6 +11,6 @@ django-extra-views>=0.9,<0.9.99
transifex-client>=0.12,<0.12.99
django-template-i18n-lint>=1.2,<1.2.99
pylabels>=1.2,<1.2.99
django-avatar>=3.1,<3.1.99
django-localflavor>=1.4,<1.4.99
django-avatar>=4.0,<4.0.99
django-localflavor>=1.5,<1.5.99
rules>=1.2,<1.2.99
17 changes: 13 additions & 4 deletions src/sous_chef/settings.py
Expand Up @@ -203,7 +203,7 @@
)

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/
# https://docs.djangoproject.com/en/1.11/howto/static-files/
STATIC_ROOT = os.path.join(BASE_DIR, 'static')

STATICFILES_DIRS = (
Expand All @@ -212,10 +212,19 @@
STATIC_URL = '/static/'

# Avatar files
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
AVATAR_STORAGE_DIR = 'avatars/'
if DEBUG:
# When using the development server, serve files directly from /media/
# https://docs.djangoproject.com/en/1.11/howto/static-files/#serving-files-uploaded-by-a-user-during-development
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
else:
# In non development mode, serve files from /static/ using gninx as
# dedicated server
# https://docs.djangoproject.com/en/1.11/howto/static-files/deployment/#serving-static-files-from-a-dedicated-server
MEDIA_ROOT = os.path.join(STATIC_ROOT, 'media')
MEDIA_URL = '/static/media/'
AVATAR_PROVIDERS = (
'avatar.providers.PrimaryAvatarProvider',
'avatar.providers.GravatarAvatarProvider',
'avatar.providers.DefaultAvatarProvider',
)
Expand Down

0 comments on commit 7253b48

Please sign in to comment.