This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if DEBUG : | |
| #local_static | |
| STATIC_URL = '/static/' | |
| STATICFILES_DIRS=(os.path.join(BASE_DIR, 'static_local'),) | |
| #local_media | |
| MEDIA_ROOT = os.path.join(BASE_DIR, 'uploads') | |
| MEDIA_URL = '/userphoto/media/' | |
| else : | |
| STATICFILES_DIRS=(os.path.join(BASE_DIR, 'static_local'),) | |
| AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| urlpatterns = patterns('', | |
| # Examples: | |
| # url(r'^$', 'DIY_tool.views.home', name='home'), | |
| # url(r'^blog/', include('blog.urls')), | |
| url(r'^admin/', include(admin.site.urls)), | |
| url(r'^user/', include(user_urls)), | |
| url(r'^class/', include(class_urls)), | |
| #url(r'', include('social.apps.django_app.urls', namespace='social')), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django_summernote import models | |
| from django_summernote import fields | |
| class SomeModel(models.Attachment): | |
| text = fields.SummernoteTextField() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class FormFromSomeModel(forms.ModelForm): | |
| class Meta: | |
| model = SomeModel | |
| fields = ('text',) | |
| widgets = { | |
| 'foo': SummernoteWidget(), | |
| 'bar': SummernoteInplaceWidget(), | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh -e | |
| # ============================================ | |
| # celeryd - Starts the Celery worker daemon. | |
| # ============================================ | |
| # | |
| # :Usage: /etc/init.d/celeryd {start|stop|force-reload|restart|try-restart|status} | |
| # :Configuration file: /etc/default/celeryd | |
| # | |
| # See http://docs.celeryq.org/en/latest/cookbook/daemonizing.html#init-script-celeryd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def handle_uploaded_image(i, x, y): | |
| import StringIO | |
| from PIL import Image, ImageOps | |
| import os | |
| from django.core.files.images import ImageFile | |
| from django.core.files.uploadedfile import InMemoryUploadedFile | |
| import uuid | |
| IMAGE_TYPE=i.content_type |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% for image in teach_data.db_images%} | |
| <div> | |
| <img src="data:image/png;base64,{{image}}"/> | |
| <span onclick="deleteImg(this);"></span> | |
| </div> | |
| {% endfor %} | |
| {% for i in teach_data.empty_box %} | |
| <div> |