Why does django-pipeline's {% compressed_js … %} tag output each script separately?

Issue I’ve configured pipeline as follows: STATICFILES_FINDERS = ( ‘django.contrib.staticfiles.finders.FileSystemFinder’, ‘django.contrib.staticfiles.finders.AppDirectoriesFinder’, ‘pipeline.finders.PipelineFinder’, ) # Static files storage STATICFILES_STORAGE = ‘pipeline.storage.PipelineStorage’ # Pipeline JS compressor PIPELINE_JS_COMPRESSOR = ‘pipeline.compressors.jsmin.JSMinCompressor’ PIPELINE_JS = { ‘website-main’: { ‘source_filenames’: ( ‘shared/jquery/jquery-1.10.2.min.js’, ‘shared/bootstrap/js/bootstrap.min.js’, ‘shared/jquery/jquery.cookie.js’, ), ‘output_filename’: ‘pipeline-compressed/website-main.js’,

Continue reading

django pipeline breaks admin when DEBUG=False

Issue here is the settings for css PIPELINE_CSS = { ‘base’: { ‘source_filenames’: ( ‘scss/core.scss’, ), ‘output_filename’: ‘css/min.css’, }, ‘ie8’: { ‘source_filenames’: ( ‘css/ie-8-overrides.css’, ), ‘output_filename’: ‘css/ie8.css’, }, } Somehow it complains about: ValueError: The file ‘admin/css/base.css’ could not be

Continue reading

Django-pipeline producing empty files

Issue Right now, when running python manage.py collectstatic produces a minified file but it is completely empty. Here are my settings.py (I am on a windows environment): STATICFILES_STORAGE = ‘pipeline.storage.PipelineStorage’ PIPELINE_ENABLED = True PIPELINE_DISABLE_WRAPPER = True PIPELINE_CSS_COMPRESSOR = ‘pipeline.compressors.yui.YUICompressor’ PIPELINE_JS_COMPRESSOR

Continue reading

Overriding Bootstrap in django-pipeline

Issue I have a Django application with which I am using the django-pipeline package and bootstrap.css: PIPELINE_CSS = { ‘myCSS’: { ‘source_filenames’: ( ‘css/bootstrap.css’, ‘css/bootstrapoverride.css’, ), ‘output_filename’: ‘bootmin.css’, ‘variant’: ‘datauri’, }, } As you can see above I have included

Continue reading

Overriding Bootstrap in django-pipeline

Issue I have a Django application with which I am using the django-pipeline package and bootstrap.css: PIPELINE_CSS = { ‘myCSS’: { ‘source_filenames’: ( ‘css/bootstrap.css’, ‘css/bootstrapoverride.css’, ), ‘output_filename’: ‘bootmin.css’, ‘variant’: ‘datauri’, }, } As you can see above I have included

Continue reading

Uncaught ReferenceError: Parent is not defined

Issue I’m using django-pipeline along with browserify based on the documentation here – http://gregblogs.com/how-django-reactjs-and-browserify/ I have it working perfectly fine when loading NPM/Bower packages like so – ‘build_js’: { ‘source_filenames’: ( ‘js/bower_components/jquery/dist/jquery.js’, ‘bootstrap/js/bootstrap.js’, ‘js/bower_components/react/react-with-addons.js’, ‘js/bower_components/react/react-dom.js’, ‘datatables/js/jquery.dataTables.js’, ‘datatables/js/dataTables.bootstrap.js’, ‘js/node_modules/marked/marked.min.js’, ‘js/node_modules/react-router/umd/ReactRouter.js’, ‘js/child.js’,

Continue reading

django-pipeline wipes out my entries in Django Database Cache

Issue I’m working on a Django application which uses django-pipeline for dealing with browsers’ file caching issues (and also for other benefits). STATIC_URL = ‘/static/’ STATICFILES_STORAGE = ‘pipeline.storage.PipelineCachedStorage’ STATICFILES_DIRS = ( os.path.join(PROJECT_ROOT, ‘bower’), ) STATICFILES_FINDERS = ( ‘django.contrib.staticfiles.finders.FileSystemFinder’, ‘django.contrib.staticfiles.finders.AppDirectoriesFinder’, ‘pipeline.finders.PipelineFinder’,

Continue reading

RuntimeError when building CSS from SCSS files of Foundation-sites with Django-pipeline

Issue My issue is in the same context as Django-Bower + Foundation 5 + SASS. I’m trying to compile foundation from scss to css. The problem is that I’m encountering the following RuntimeError: /home/hakim/.gem/ruby/2.4.0/gems/sass-3.4.23/lib/sass/exec/sass_scss.rb:287:in `watch_or_update’: File /home/hakim/github/myquotes/static/quotes/app.css doesn’t exist. (RuntimeError)

Continue reading

django-pipeline FileNotFoundError when i perform manage.py collectstatic

Issue It’s last some lines of traceback : File “C:\PycharmDev\TestVirtualEnv\testEnv1\lib\site-packages\pipeline\compressors\__init__.py”, line 247, in execute_command stdin=subprocess.PIPE, stderr=subprocess.PIPE) File “C:\Python34\Lib\subprocess.py”, line 859, in __init__ restore_signals, start_new_session) File “C:\Python34\Lib\subprocess.py”, line 1112, in _execute_child startupinfo) FileNotFoundError: [WinError 2] … And in settings.py : BASE_DIR

Continue reading

Yuglify compressor can't find binary from package installed through npm

Issue I have a fresh virtualenv environment and have got the latest django-pipleline. The JS compression with Closure works perfect, but CSS compression with Yuglify fails, due a node error: STATICFILES_STORAGE = ‘pipeline.storage.PipelineCachedStorage’ PIPELINE_JS_COMPRESSOR = ‘pipeline.compressors.closure.ClosureCompressor’ PIPELINE_CSS_COMPRESSOR = ‘pipeline.compressors.yuglify.YuglifyCompressor’ When

Continue reading

django-pipeline throwing ValueError: the file could not be found

Issue When running python manage.py collectstatic –noinput I’m getting the following error: Post-processing ‘jquery-ui-dist/jquery-ui.css’ failed! Traceback (most recent call last): File “manage_local.py”, line 10, in <module> execute_from_command_line(sys.argv) File “/Users/michaelbates/GoogleDrive/Development/inl/venv/lib/python3.4/site-packages/django/core/management/__init__.py”, line 367, in execute_from_command_line utility.execute() File “/Users/michaelbates/GoogleDrive/Development/inl/venv/lib/python3.4/site-packages/django/core/management/__init__.py”, line 359, in execute

Continue reading

django pipeline FileNotFoundError when the path is right

Issue I’m trying to add pipeline to my django project. But it’s throwing me winerror 2 (FileNotFoundError) when I’m trying to execute collectstatic settings.py STATIC_URL = ‘static/’ STATICFILES_STORAGE = ‘pipeline.storage.PipelineStorage’ STATIC_ROOT = ‘static’ STATICFILES_FINDERS = ( ‘django.contrib.staticfiles.finders.FileSystemFinder’, ‘django.contrib.staticfiles.finders.AppDirectoriesFinder’, ‘pipeline.finders.PipelineFinder’, )

Continue reading

Images are not being stored?? – Django

Issue These are my following settings: MEDIA_ROOT = ‘/home/webapps/test_project/media/’ MEDIA_URL = ‘http://192.168.0.2:8090/site_media/’ ADMIN_MEDIA_PREFIX = ‘/media/’ These are my model fields: large = models.ImageField(blank=True, null=True, upload_to=”images”) thumb = models.ImageField(blank=True, null=True, upload_to=”images”) What happens is… when I save a model with the

Continue reading

Uploading images from Django view

Issue Models: from django.db import models class Image(models.Model): advertisement = models.ForeignKey(‘Advertisement’) image = ImageWithThumbsField(upload_to=store_path, blank=True) class Advertisement(models.Model): #some code here class AdvertOne(Advertisement): #some code again class AdvertTwo(Advertisement): #and again Forms: from models import Advertisement from django.forms import * class AdvertisementForm(ModelForm):

Continue reading

Why is my image upload failing in django?

Issue I am trying to build a django app and host it on webfaction. My model looks like this: class Post(models.Model): title = models.CharField(max_length=512) image = models.ImageField(upload_to=’blogImages/’) body = models.TextField() visible = models.BooleanField() date_created = models.DateTimeField(auto_now_add=True) date_updated = models.DateTimeField(auto_now=True) tags

Continue reading

File upload form in Django

Issue I’m trying to create a simple upload form for my project in Django 1.5 an Python 2.7. This is my File class: class File(models.Model): middleschool = ‘MS’ highschool = ‘HS’ university = ‘U’ blank = ‘-‘ school_choices = ((middleschool,

Continue reading

Django image upload succeeds with url written to DB but no image shows upload target folder

Issue I have form in Django class BusinessForm(forms.Form): name = forms.CharField( required = True, max_length=MAX_NAME_LENGTH, widget=forms.TextInput(attrs={‘placeholder’: ‘e.g Boston Market’})) image = forms.ImageField() which belongs to this model class Business(models.Model): “”” Describes Bussines data type “”” name = models.CharField(max_length=BUS_NAME_LENGTH) img =

Continue reading

Cannot upload image in django using filefield

Issue I am not able to upload image. here is my models.py class Post(models.Model): author = models.ForeignKey(‘auth.User’) title = models.CharField(max_length=200) text = models.TextField() image = models.FileField(upload_to = ‘post/static/images/’ , null= True, blank= True) created_date = models.DateTimeField(default=timezone.now) published_date = models.DateTimeField(blank=True, null=True)

Continue reading

How do I save the foreign key?

Issue I want to upload multiple images. class IssuePanel(models.Model): issue = models.ForeignKey(ComicIssue, on_delete=models.CASCADE) panel = models.FileField(upload_to=’comic_issues_files/panels/’) date_uploaded = models.DateTimeField(auto_now_add=True) After following the examples on django-multiupload’s repository on github, I have this on forms.py class PanelsForm(forms.ModelForm): class Meta: model = ComicIssue

Continue reading

Django cant upload image

Issue I am trying to add avatar to my model, but uploading dosent work. settings.py MEDIA_ROOT = os.path.join(PROJECT_ROOT, ‘media’) MEDIA_URL = ‘/media/’ models.py class Casting(models.Model): … casting_picture = ImageField(upload_to=’/media/photos’) template casting.html there a lot of fields, so in short: <form

Continue reading

Serialize multiple InMemoryUploadedFile using ListField : Django REST Framework

Issue How can I serialize multiple InMemoryUploadedFile using serializers.ListField() ?? code snippet #views.py @api_view([‘POST’, ‘GET’]) def create_post(request): if request.method == ‘POST’: altered_request_data = request.data.copy() in_memory_upload_files_list = [value for value in request.FILES.values()] altered_request_data[‘files’] = in_memory_upload_files_list serializer = PostSerializer(data=altered_request_data) serializer.is_valid(raise_exception=True) serializer.save() return

Continue reading