Coder Social home page Coder Social logo

Not working in Django about sweetify-django HOT 20 CLOSED

atrox avatar atrox commented on June 15, 2024
Not working in Django

from sweetify-django.

Comments (20)

Atrox avatar Atrox commented on June 15, 2024

Please take a look at issue #11. Is sweetalert installed correctly?

from sweetify-django.

guilherme-funchal avatar guilherme-funchal commented on June 15, 2024

Hello, thank for you reply.

It includes installation in the generation of the docker container and apparently everything is OK.

from sweetify-django.

Atrox avatar Atrox commented on June 15, 2024

Did you try this #11 (comment)?

from sweetify-django.

guilherme-funchal avatar guilherme-funchal commented on June 15, 2024

I need to install the sweetify2 or just sweetify (pip install sweetify) ?

from sweetify-django.

guilherme-funchal avatar guilherme-funchal commented on June 15, 2024

In my code I inserted:
sweetify.sweetalert(request, 'Title', button=True)

Error :
The view aries_community.views.handle_credential_offer didn't return an HttpResponse object. It returned None instead.

from sweetify-django.

Atrox avatar Atrox commented on June 15, 2024

As stated in the README "Note: This package does not provide the client-side files of SweetAlert. You have to provide them yourself." you have to install the client-side part yourself. So you need to install both sweetify and sweetalert2.

Regarding your error: Did you read the README at all? You still have to redirect at the end.

from sweetify-django.

guilherme-funchal avatar guilherme-funchal commented on June 15, 2024

Take a look

            sweetify.success(request, 'test')
            return redirect('/connections')

Nothing happens...

from sweetify-django.

Atrox avatar Atrox commented on June 15, 2024

Did you try this #11 (comment)?

Did you try this?

from sweetify-django.

guilherme-funchal avatar guilherme-funchal commented on June 15, 2024

The Django is running inside a container, how do I do this?

from sweetify-django.

Atrox avatar Atrox commented on June 15, 2024

This has nothing to do with your container. Open your browser, navigate to your site and execute the line?

from sweetify-django.

guilherme-funchal avatar guilherme-funchal commented on June 15, 2024

VM129:1 Uncaught ReferenceError: Swal is not defined
at :1:1

from sweetify-django.

guilherme-funchal avatar guilherme-funchal commented on June 15, 2024

Sorry, but not is clear to me where I must install the lib sweetalert2.

Should I generate the Django container with the library or load it on the base page of the site?

I try to execute in console of Chrome and I get the error:

Uncaught ReferenceError: Swal is not defined

from sweetify-django.

Atrox avatar Atrox commented on June 15, 2024

Yeah, so you are missing the sweetalert2 library. Include it in your base template to load it.

from sweetify-django.

guilherme-funchal avatar guilherme-funchal commented on June 15, 2024

How I do this ?

from sweetify-django.

Atrox avatar Atrox commented on June 15, 2024

Put <script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script> into your base template

from sweetify-django.

guilherme-funchal avatar guilherme-funchal commented on June 15, 2024

Its works, thanks a lot for your help.

from sweetify-django.

Atrox avatar Atrox commented on June 15, 2024

Glad to hear :)

from sweetify-django.

guilherme-funchal avatar guilherme-funchal commented on June 15, 2024

Why doesn't the image appear?

from sweetify-django.

Atrox avatar Atrox commented on June 15, 2024

I can't help you if you give me no information whatsoever.

from sweetify-django.

guilherme-funchal avatar guilherme-funchal commented on June 15, 2024

Thanks a lot again...Its works...just pass icon='error' for example in thes command.

from sweetify-django.

Related Issues (19)

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.