python - Django pipeline doesn't load assets -


I followed a sample project I have the structure of files:

  - Mysite - mysite - __init__.py - settings.py - urls.py - wsgi.py - choice - migration - template - poll.html - static - script.js - style.css - admin.py - models.py - tests Py - urls.py - views.py - manage.py   

Everything works well, however, the problem is using the property to manage I Configured the same as the given code, but this property has to be Does not load.

settings.py

  INSTALLED_APPS = STATIC_URL = '/ static /' STATIC_ROOT = os.path.join (BASE_DIR, 'static_files') PIPELINE_ENABLED = True STITICFILES_STORAGE = 'Pipeline.storage (' 'degego.contrib.staticfiles' ',' pipeline ',' choice ',) .PipelineCachedStorage' PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.cssmin.CSSMinCompressor' PIPELINE_CSSMIN_BINARY = 'cssmin' PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.slimit.SlimItCompressor' PIPELINE_CSS = {'PollsX': {'source_filenames': ('style.css',), 'Output_filename': 'styles1.css', 'variant': 'datauri',}} } PIPELINE_JS = {'PollXX': {'source_filenames': ('script.js',), 'output_filename': 'scripts1 js',}}   

poll.html

  {% load compressed%} {% compressed_css 'pollsX'%} & lt; Div class = 'red-me' & gt; & Lt; H1 & gt; Hello! I am a temple! & Lt; / H1> & Lt; / Div & gt;   

style.css

  .red-me {color: red; }   

generated output for http://127.0.0.1/polls

  & lt; Link href = "/ static / styles1css" rel = "stylesheet" type = "text / css" /> & Lt; Div class = 'red-me' & gt; & Lt; H1 & gt; Hello! I am a temple! & Lt; / H1> & Lt; / Div & gt;   

It can not load the /static/styles1.css file in the browser Even, without any success, I ./ manage Tested .py collectstatic Do I miss something?

Python -3.5 and Django-1.7

Sorry for a long question, but I had to give it a description < / P>

The Django Pipeline gets updated very frequently, so your particular tutorials are already outdated but I I also want to answer the question, because I have spent a few hours trying to fix the same issue with the new pipeline, and want to share my solution and Hope it will be helpful to anyone.

Everything works:

  • Django == 1.9.1
  • django-pipeline == 1.6.4

    settings.py

      INSTALLED_APPS = ('Django.contrib.staticfiles',' pipeline ',' choice ',) STATIC_URL =' / static / 'STATIC_ROOT = os.path.join (BASE_DIR,' static_files ') STATICFILES_FINDERS = (' django.contrib.staticfiles.finders.FileSystemFinder ',' django.contrib.staticfiles.finders.AppDirectoriesFinder ',' pipeline.finders.PipelineFinder ',' Cssmin ',' JS_COMPRESSOR ':' Pipeline compressors.slimit.SlimItCompressor ',' ',' cssmin ',' JS_COMPRESSOR ':' Pipeline compressors.cssmin.CSSMinCompressor ',' CSSMIN_BINARY ':' Pipeline compressors.slimit.SlimItCompressor ',' Stylesheets ': {' PollXX ': {' source_filenames ': (' style.css ',),' output_filename ':' CSS / styles1css ',' variant ':' d ('Script.js',),' output_filename ':' js / scripts1.js',},}}   atauri '}}},' javascriptIP ': {' pollsX ': {' source_filenames' / Pre> 

    poll.html

      {% load pipeline%} {% stylesheet 'pollxX'%} {% javascript 'pollsX'%} & lt ; Div class = 'red-me' & gt; & Lt; H1 & gt; Hello! I am a temple! & Lt; / H1> & Lt; / Div & gt;    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -