Giter VIP home page Giter VIP logo

Comments (2)

marctc avatar marctc commented on May 23, 2024

Hi Felipe,

The link that you provide me it's a Wagtail tool to generate image URLs in the image preview on the image edit page (good to know that exist this, BTW) but it has nothing to do with the issue that you have.

It seems that you didn't configured properly the staticfiles/medias urls in your main urls.py. The official Wagtail documentation provides an example of how to do that:

http://docs.wagtail.io/en/v1.1/advanced_topics/settings.html#urls-py

Try this and tell me if putting this fixs your problem.

Maybe I would have to update Puput's documentation to tell people who are setting up Puput as standalone app that have to put this urls in his project.

from puput.

arruda avatar arruda commented on May 23, 2024

Hi @marctc, thanks, for the fast reply.
What you said made it work, I've completely forgot about MEDIA_ROOT/URL settings, so after adding both of them and making django serve them in dev, everything started working 😄

I agree, that it would be a great idea to put this info in the documentation. Both the changes in the urls.py:

if settings.DEBUG:
    from django.contrib.staticfiles.urls import staticfiles_urlpatterns

    urlpatterns += staticfiles_urlpatterns()  # tell gunicorn where static files are in dev mode
    urlpatterns += static(settings.MEDIA_URL + 'images/', document_root=os.path.join(settings.MEDIA_ROOT, 'images'))
    urlpatterns += patterns(
        '',
        (r'^favicon\.ico$', RedirectView.as_view(url=settings.STATIC_URL + 'blog/images/favicon.ico'))
    )

And the setting of MEDIA_ROOT and MEDIA_URL, that by default are not been added to the settings.py by django's start_project anymore.

from puput.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.