Search Results

Search found 1300 results on 52 pages for 'middleware'.

Page 41/52 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • Putting a django login form on every page

    - by asciitaxi
    I'd like the login form (AuthenticationForm from django.contrib.auth) to appear on every page in my site if the user is not logged in. When the user logs in, they will be redirected to the same page. If there is an error, the error will be shown on the same page with the form. I suppose you'd need a context processor to provide the form to every template. But, then you'd also need every view to handle the posted form? Does this mean you need to create some middleware? I'm a bit lost. Is there an accepted way of doing this?

    Read the article

  • Prevent wsgi from modifying 401 responses.

    - by Gary van der Merwe
    If I have the following pylons controller: def challange(self): response.status = '401 Unauthorized' return 'You are not logged in.' I would expect to see 'You are not logged in.' But I see : Unauthorized This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required. WSGI Server I have disabled the pylons error middleware. But the wsig server seems to be modifying the response. How do I stop this?

    Read the article

  • Getting error while invoking java weblogic.WLST from C drive

    - by user3718817
    I am getting an error message when I try to invoke java weblogic.WLST monitor.py weblogic weblogic1 t3://localhost:7001 from below mentioned path. C:\Users\satish>java weblogic.WLST monitor.py weblogic weblogic1 t3://127.0.0.1:7001 error Error: Could not find or load main class weblogic.WLST But when I invoke the same command from weblogic home I am not getting any issues. Requesting you to help regarding this. Please find the below class path: C:\Oracle\Middleware\wlserver_10.3\server\bin>setWLSEnv.cmd Error: Could not find or load main class weblogic.WLST Note: I already set class path. Kindly advise where I am getting wrong. Or is there any way that I can invoke my Python script from anywhere?

    Read the article

  • Pylons 1.0 AttributeError: 'module' object has no attribute 'metadata'

    - by shiki
    Python noob trying to learn Pylons. I'm using the QuickWiki tutorial (http://pylonshq.com/docs/en/1.0/tutorials/quickwiki_tutorial/) from the 1.0 documentation, but this alleged "1.0" doc seems to just be "0.9.7"; I suspect that this has something to do with the error I'm getting. When I execute "paster setup-app development.ini", I get this: (mydevenv)lucid@lucid-laptop:~/QuickWiki$ paster setup-app development.ini Traceback (most recent call last): ... edited for brevity... File "/home/lucid/mydevenv/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1954, in load File "/home/lucid/QuickWiki/quickwiki/config/middleware.py", line 11, in <module> from quickwiki.config.environment import load_environment File "/home/lucid/QuickWiki/quickwiki/config/environment.py", line 12, in <module> from quickwiki.model import init_model File "/home/lucid/QuickWiki/quickwiki/model/__init__.py", line 27, in <module> pages_table = sa.Table('pages', meta.metadata, AttributeError: 'module' object has no attribute 'metadata' (mydevenv)lucid@lucid-laptop:~/QuickWiki$

    Read the article

  • Authkit - deferring action for HTTP '401' response to client application

    - by jon
    Form, Redirect and Forward all send an unauthenticated user to a Form on a login page specified within an Authkit middleware application. I'd like to allow a client application to request a service via XHR and then present a custom 'client side' form if a HTTP status code of 401 is returned, which would then post to Authkit for authentication until valid authentication/authorization occured. Specifically, 1) a jquery $.get request might request a resource. 2) if an Authkit cookie check confirmed previous authorization the content would be returned. 3) if not I would like Authkit to simply return the '401 response' (and not redirect to another page, or return a form template) where a client side exception handler would notify the user and present an authentication form. Can Authkit work like this?

    Read the article

  • Django comparing model instances for equality

    - by orokusaki
    I understand that, with a singleton situation, you can perform such an operation as: spam == eggs and if spam and eggs are instances of the same class with all the same attribute values, it will return True. In a Django model, this is natural because two separate instances of a model won't ever be the same unless they have the same .pk value. The problem with this is that if a reference to an instance has attributes that have been updated by middleware somewhere along the way and it hasn't been saved, and you're trying to it to another variable holding a reference to an instance of the same model, it will return False of course because they have different values for some of the attributes. Obviously I don't need something like a singleton , but I'm wondering if there some official Djangonic (ha, a new word) method for checking this, or if I should simply check that the .pk value is the same with: spam.pk == eggs.pk I'm sorry if this was a huge waste of time, but it just seems like there might be a method for doing this, and something I'm missing that I'll regret down the road if I don't find it.

    Read the article

  • Managing execution priorities and request expiry time in your web application

    - by Dan
    Some installations that run our applications can be under hefty stress on a busy day. Our clients ask us is there is a way to manage priorities in our application. For example, in a typical internet banking application, banks are interested in having the form “Transfer money” responsive, while the “Statement” page is a lot less critical. Not being able to transfer money is a direct loss for the bank, while not being able to produce a statement or something similar can be fixed with an apology. AFAIK, neither can you manage different request or session timeouts in a typical web application, it is one value for the whole of your web app. Managing message priority and expiry time is a typical feature in many middleware platforms. Something like this can be useful for a web front end as well. Do any of web servers (either java or .net) or web frameworks provide these features? How would you go about implementing it if you’d have to go for roll-your-own?

    Read the article

  • Advanced Rails Routing of short URL's and usernames off of root url

    - by Michael Waxman
    I want to have username URL's and Base 58 short URL's to resources both off of the root url like this: http://mydomain.com/username #=> goes to given user http://mydomain.com/a3x9 #=> goes to given story I am aware of the possibilities of a user names conflicting with short urls, and I have a workaround, but what I can't figure out is the best way to set this up in rails. Can I do it in rails routes? Should I do something with a piece of Rack middleware? Should I set up a routing controller? Please let me know the best way to do this. Thanks so much!

    Read the article

  • Chipmunk Physics or Box2D for C++ 2D GameEngine ?

    - by Mr.Gando
    Hello, I'm developing what it's turning into a "cross-platform" 2D Game Engine, my initial platform target is iPhone OS, but could move on to Android or even some console like the PSP, or Nintendo DS, I want to keep my options open. My engine is developed in C++, and have been reading a lot about Box2D and Chipmunk but still I can't decide which one to use as my Physics Middleware. Chipmunk appears to have been made to be embedded easily, and Box2D seems to be widely used. Chipmunk is C , and Box2D is C++, but I've heard the API's of Box2D are much worse than chipmunk's API's. For now I will be using the engine shape creation and collision detection features for irregular polygons (not concave). I value: 1) Good API's 2) Easy to integrate. 3) Portability. And of course if you notice anything else, I would love to hear it. Which one do you think that would fit my needs better ?

    Read the article

  • How do i use repoze.who?

    - by misterwebz
    I'm having some trouble understanding how repoze.who works. I've followed a tutorial i found by searching on google and here's what i already have: This is what i added in my middleware.py file from repoze.who.config import make_middleware_with_config as make_who_with_config app = make_who_with_config(app, global_conf, app_conf['who.config_file'], app_conf['who.log_file'], app_conf['who.log_level']) Here's the who.ini : http://pastebin.com/w5Tba2Fp Here's repoze_auth.py in /lib/auth/: from paste.httpexceptions import HTTPFound from iwant.model import User class UserModelPlugin(object): def authenticate(self, environ, identity): try: username = identity['login'] password = identity['password'] except KeyError: return None success = User.authenticate(username, password) return success def add_metadata(self, environ, identity): username = identity.get('repoze.who.userid') user = User.get(username) if user is not None: identity['user'] = user I've also checked the plugins in the repoze.who folder, but i failed to understand how it's supposed to be used. I'd appreciate it if someone would push me in the right direction.

    Read the article

  • Servlet Session - switch from URL Rewriting to Cookie

    - by lajuette
    Situation: I have a "dumb" Javascript frontend that can contact some kind of SSO middleware (MW). The MW can obtain sessions by issuing requests that contain authentication credentials (username, password). I.e. the session will be created for a certain user. My frontend needs to "restart" the session to gain the user's permissions to the target system. For that i need a valid session cookie. The target system is not under my control (could be a more or less public WFS, WMS, etc.), so i cannot add any SSO mechanism to it. Question: Is it possible to "steal" a Session forging a request which URL contains a valid session ID in the jsessionid parameter? Goal : Issue such a request to a Servlet and make it respond with a Set-Cookie header that contains the same id. That way the frontend joins the session and may do whatever the user, which was used to create the session, is able to do.

    Read the article

  • How to clear the memory allocated for Customized Exception

    - by ilan
    Hi All I have a customized exception class. say class CustomExcep{}; My Application is a middleware made of C++. It is a webservice which is used for the communication between Java based web Front-end and the DCE Backend. whenever the DCE Backend is not running or down due to some core dumps, the application throws the CustomExcep. It's like this. CustomExcep * exc = new CustomExcep(); throw exc; I am unable to use the stack memory for this as it leads to some run-time exceptions. I need a solution to clear the memory used by this CustomException. Can we use Templates for this purpose? Any help would be appreciated. Thanks in Advance.

    Read the article

  • Rack::ResponseHeaders in rackup for Sinatra

    - by sevennineteen
    I think this is a very easy one, but I can't seem to get it right. Basically, I'm trying to use Rack middleware to set a default Cache-Control header into all responses served by my Sinatra app. It looks like Rack::ResponseHeaders should be able to do exactly what I need, but I get an error when attempting to use the syntax demonstrated here in my rackup file: use Rack::ResponseHeaders do |headers| headers['X-Foo'] = 'bar' headers.delete('X-Baz') end I was able to get Rack::Cache to work successfully as follows: use Rack::Cache, :default_ttl => 3600 However, this doesn't achieve exactly the output I want, whereas Rack::ResponseHeaders gives fine-grained control of the headers. FYI, my site is hosted on Heroku, and the required Rack gems are specified in my .gems manifest. Thanks! Update: After doing some research, it looks like the first issue is that Rack::ResponseHeaders is not found in the version of rack-contrib (0.9.2) which was installed. I'll start by looking into that.

    Read the article

  • Best implementation for MySQL replication with Rails 3?

    - by vonconrad
    We're looking at potentially setting up replication for our primary MySQL database, and while setting up the replication seems pretty straight-forward, the application implementation seems a bit murkier. My first idea would be to set up a master-slave configuration and RW-splitting, with all write queries (CREATE, INSERT, UPDATE) going to master, and all read queries (SELECT) going to slave. Having read up on it, it seems that there are essentially two options for how to implement this with our app: Using an independent middleware layer for all MySQL connections, such as MySQL proxy or DBSlayer. However, the former is in Alpha and the latter has limited documentation. Using a Ruby-based gem/plugin, such as Octopus to achieve RW-splitting in the framework. If we wanted to go with a master-slave setup, what you recommend moving forward? The other thought I've had was to use a master-master configuration, but am unsure about the implementation of such a setup. Thoughts?

    Read the article

  • Why are all response bodies after the first blank in Cucumber?

    - by James A. Rosen
    I'm using Cucumber (0.6.3), Cucumber-Rails (0.3.0), Webrat (0.7.0), and Rails (2.3.5) for some tests. The following scenario passes just fine: Scenario: load one page Given I am on the home page Then I should see "Welcome" The following, however, fails: Scenario: load two pages Given I am on the FAQ pag When I go to the home page Then I should see "Welcome" The problem is that the second @response.body is blank. I added a Rack middleware to get a little more information: class LogEachRequest def initialize(app); @app = app; @count = 0; end def call(env) puts "Processing request # #{@count += 1)" @app.call(env) end end It shows me only one request processed. That is, it only ever prints out Processing request # 1

    Read the article

  • how to develop domain specific language on top of another language ?

    - by sofreakinghigh
    say i found a good open source software/library written in python. i want to wrap some of the functions or methods that i have created into easy to understand language of my own. do porter_stemm(DOC) (the DSL) would be equivalent to the function or series of methods written in python. i want to create a DSL that is easy to learn, but need this DSL translated into the original open source software software. im not sure if i am clear here but my intention is: create an easy to learn code language that users can use to solve a problem in a certain niche. this simple language needs to be translated or compiled or interpretated via some middleware into the original open source software's language (python).

    Read the article

  • Translate model fields' attributes from a Database with Django?

    - by Luiz C.
    I'm trying to create a Model that has fields that have the following attributes translatable: verbose_name and choices. I can easily do this by tagging the strings and using the i18l middleware. The problem is that I don't want to define the translation in po/mo files. Is there a way to pull this data from a database table? If so, any examples? There are some options out there that offer model content translation. That is not my case. I need to translate the verbose_name, choices and error_messages from database.

    Read the article

  • Authkit - deferring action to HTTP response to client application

    - by jon
    Form, Redirect and Forward all send an unauthenticated user to a Form on a login page specified within an Authkit middleware application. I'd like to allow a client application to request a service via XHR and then present a custom 'client side' form if a HTTP status code of 401 is returned, which would then post to Authkit for authentication until valid authentication/authorization occured. Specifically, 1) a jquery $.get request might request a resource. 2) if an Authkit cookie check confirmed previous authorization the content would be returned. 3) if not I would like Authkit to simply return the '401 response' (and not redirect to another page, or return a form template) where a client side exception handler would notify the user and present an authentication form. Can Authkit work like this?

    Read the article

  • Limit number of views per day in Django

    - by ariddell
    Is there an easy way to limit the number of times a view can be accessed by a given IP address per day/week? A simplified version of the technique used by some booksellers to limit the number of pages of a book you can preview? There's only one view that this limit need apply to--i.e. it's not a general limit--and it would be nice if I could just have a variable overlimit in the template context. The solution need not be terribly robust, but limiting by IP address seemed like a better idea than using a cookie. I've looked into the session middleware but it doesn't make any references to tracking IP addresses as far as I can tell. Has anyone encountered this problem?

    Read the article

  • DLL response is too slow in Visual Studio [Resolved]

    - by magsto
    I use a 3rd party DLL in my VB.NET project (VS2005) that responds to slow and give wrong values in debug mode. In run-time mode everything works as expected. I do understand that there are something going on in the debug mode which makes the DLL communication slow. This behavior makes it hard to debug the application correctly. Is there any way to force VS to communicate with the DLL in "run-time" mode during debugging but let the rest of the project be in control of the debugger? I found a setting that resolved my issue: Project Properties Debug Enable Debuggers select "Enable unmanaged code debugging". Now the DLL communication flowed smoothly. The DLL I use is a middleware between my app and a USB device. There is no Debug/Release version of the DLL.

    Read the article

  • How to stream an HttpResponse with Django

    - by muudscope
    I'm trying to get the 'hello world' of streaming responses working for Django (1.2). I figured out how to use a generator and the yield function. But the response still not streaming. I suspect there's a middleware that's mucking with it -- maybe ETAG calculator? But I'm not sure how to disable it. Can somebody please help? Here's the "hello world" of streaming that I have so far: def stream_response(request): resp = HttpResponse( stream_response_generator()) return resp def stream_response_generator(): for x in range(1,11): yield "%s\n" % x # Returns a chunk of the response to the browser time.sleep(1)

    Read the article

  • Is there a way to reference a certain class/interface/... by enclosing it with its namespace rather than a using directive "using namespace_name" ?!

    - by Ahmed
    Is there a way to reference a certain class/interface/... by enclosing it with its namespace rather than a using directive "using namespace_name" ?! As, I'm working on a website, which uses SAP .NET connector. I already added a reference for connector ddl, and while referencing its namespace "using namespace_name", or set class namespace to another one rather than connector namespace, I got error regarding connector classes with that error message "The type or namespace couldn't be found, are you missing a using directive or an assembly reference?". But while changing namespace name to connector namespace, everything is going well?! // Set namespace to be IDestinationConfiguration interface namespace. namespace SAP.Middleware.Connector { public class ConnectorConfiguration : IDestinationConfiguration { } } So, connector types forced me to set namespace of class to their namespace! Is this possible? If so, how?

    Read the article

  • In Node.js, how can I load my modules once and then use them throughout the app?

    - by TIMEX
    I want to create one global module file, and then have all my files require that global module file. Inside that file, I would load all the modules once and export a dictionary of loaded modules. How can I do that? I actually tried creating this file...and every time I require('global_modules'), all the modules kept reloading. It's O(n). I want the file to be something like this (but it doesn't work): //global_modules.js - only load these one time var modules = { account_controller: '/account/controller.js', account_middleware: '/account/middleware.js', products_controller: '/products/controller.js', ... } exports.modules = modules;

    Read the article

  • How to implement CSRF protection in Ajax calls using express.js (looking for complete example)?

    - by Benjen
    I am trying to implement CSRF protection in an app built using node.js using the express.js framework. The app makes abundant use of Ajax post calls to the server. I understand that the connect framework provides CSRF middleware, but I am not sure how to implement it in the scope of client-side Ajax post requests. There are bits and pieces about this in other Questions posted here in stackoverflow, but I have yet to find a reasonably complete example of how to implement it from both the client and server sides. Does anyone have a working example they care to share?

    Read the article

  • Django: HTTPS for just login page?

    - by Mark
    I just added this SSL middleware to my site http://www.djangosnippets.org/snippets/85/ which I used to secure only my login page so that passwords aren't sent in clear-text. Of course, when the user navigates away from that page he's suddenly logged out. I understand why this happens, but is there a way to pass the cookie over to HTTP so that users can stay logged in? If not, is there an easy way I can use HTTPS for the login page (and maybe the registration page), and then have it stay on HTTPS if the user is logged in, but switch back to HTTP if the user doesn't log in? There are a lot of pages that are visible to both logged in users and not, so I can't just designate certain pages as HTTP or HTTPS.

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >