Giter Club home page Giter Club logo

django-flash's People

Contributors

danielfm avatar leah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

django-flash's Issues

AssertionError: The session-based flash storage requires session middleware to be installed.

Hi,

when i try something like http://domain/admin then i get:

Traceback (most recent call last):

File "/usr/lib/python2.5/site-packages/django/core/servers/basehttp.py", line 279, in run
self.result = application(self.environ, self.start_response)

File "/usr/lib/python2.5/site-packages/django/core/servers/basehttp.py", line 651, in call
return self.application(environ, start_response)

File "/usr/lib/python2.5/site-packages/django/core/handlers/wsgi.py", line 245, in call
response = middleware_method(request, response)

File "/usr/lib/python2.5/site-packages/django_flash-1.6.1-py2.5.egg/djangoflash/middleware.py", line 77, in process_response
storage.set(self._get_flash_from_request(request), request, response)

File "/usr/lib/python2.5/site-packages/django_flash-1.6.1-py2.5.egg/djangoflash/storage/session.py", line 33, in set
assert hasattr(request, 'session'), "The session-based flash storage " \

AssertionError: The session-based flash storage requires session middleware to be installed.

Important is that url doesn't have slash at the end, with slash works well.

My settings looks ok, djangoflash.middleware.FlashMiddleware is after session middleware.

bad source tarball for 1.8 release

it looks like the source tarball for the 1.8 release is missing a required ez_setup.py file.

running 'pip install django-flash' results in "ImportError: No module named ez_setup" when running setup.py.

the 1.7 release works fine. this is the difference in the contents of the top level of the two tarballs:

django-flash-1.7:
AUTHORS PKG-INFO doc/ fabfile.py setup.py
LICENSE README ez_setup.py setup.cfg src/

django-flash-1.8:
PKG-INFO setup.cfg setup.py src/

flash.now.add method

Hi,

It would be awesome if the flash.now object had a now method similar to flash.now. I appreciate it may run into problems if you add to the list using both now and "not now" so I haven't created a patch for it just yet. I was just wondering what people thought about this kind of functionality and if it's a non-starter or not.

Many thanks
Chris

FLASH_IGNORE_MEDIA doesn't seem sufficient if you need to have static content served via multiple different apps

I'd love to use django-flash but it looks like I would have troubles in its current form.

I have a django project that has three different apps in it (let's say project1, project2, and project3). Since the same domain will serve all three projects and other non-django applications I need to use urls like /project1/c/styles.css , /project2/j/somejavascript.js , and /project3/i/blank.gif for static js, css, and images. In development mode I'm using django.views.static.serve to get those above urls to point to the static-www/ directory in our source (eg ./static-www/project1/c/styes.css).

From the documentation it looks like this is a problem. In production flash will work fine, but in development static file requests will flush the flash.

I see that you've made FLASH_IGNORE_MEDIA, but it won't suit this case because I have 3 different static url prefixes so checking a single MEDIA_URL won't work.

Maybe and additional setting that is a regular expression? Or an array of several strings?

I might just code this up myself (seems pretty straightforward) but wanted to ask you first just in case I was missing something.

Untitled

I'm new to Django, so I'm not sure if this is the case or not, but I found following the configuration instructions in the documentation overwrote the default Context Processors. So after I'd installed Django Flash a bunch of template variables suddenly disappeared.

I found this was the easiest way to add the django-flash context processor to the defaults:

from django.conf import global_settings
TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
    'djangoflash.context_processors.flash',
)

I'm not sure if this is Django best-practise, but potentially it should also be mentioned in the documentation?

Clearing flashes on redirect

I just spent some time tracking down a bug that ultimately turned out to be me redirecting to a URL without a slash, in effect resulting in two redirects, and the flash never making it to the final page.

This makes we wonder though - it seems wrong that this is happening at all - I would think that those redirects should be just skipped. Now as far as I can tell about how django-flash works, there doesn't seem to be a good way to do this though, since the flash is cleared on an incoming request and obviously, django-flash wouldn't know what the request is actually doing.

Still.. couldn't the flash simply be cleared on access? Not sure if there are other solutions...

Another redirect issue

I'm having an odd issue with a simple redirect scenario using the django builtin redirect shortcut.

I have a flash message set up...
request.flash['message'] = "Test."

Then on the next line I redirect:
return redirect('/teaminfo/'); #implied index

Works just fine. However, the more "correct" method doesn't:

return redirect('teaminfo.views.index')

The flash message disappears before my template file can present it. My url routing (in case it matters) is:

base:

urlpatterns = patterns('',
    (r'^admin/doc/', include('django.contrib.admindocs.urls')),
    (r'^admin/', include(admin.site.urls)),
    (r'^teaminfo/', include('teaminfo.urls')),
    (r'^$',"dashboard.views.index"),
)

application:

urlpatterns = patterns('teaminfo.views',
    (r'^player/(\d+)/edit',"edit_player"),
    (r'^$',"index"),
)

Flash data is dicarded after static file requests when using the development server

When using the development server in django, the static files requests are processed with django.
Therefore the following request after saving a value in the flashscope object is likely to be a static file request (a CSS/ an image file). It seems that the flash data is discarded at that time.

While this should not happen in production, it prevents the application to run with the development server.

Is there a way for django-flash not to remove the data when processing these requests?

Python 2.5 /2.6
Django 1.1 RC
django-flash 1.5.2

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.