Search Results

Search found 5 results on 1 pages for 'misterwebz'.

Page 1/1 | 1 

  • Pylons authentication?

    - by misterwebz
    Is there a one and true way to add authentication in Pylons? I've seen so many different ways, but most of them are either outdated or too complex. Is there a tutorial somewhere that explains how to add authentication in a good and solid way?

    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

  • How to display multiple images?

    - by misterwebz
    I'm trying to get multiple image paths from my database in order to display them, but it currently doesn't work. Here's what i'm using: def get_image(self, userid, id): image = meta.Session.query(Image).filter_by(userid=userid) permanent_file = open(image[id].image_path, 'rb') if not os.path.exists(image.image_path): return 'No such file' data = permanent_file.read() permanent_file.close() response.content_type = guess_type(image.image_path)[0] or 'text/plain' return data I'm getting an error regarding this part: image[id].image_path What i want is for Pylons to display several jpg files on 1 page. Any idea how i could achieve this?

    Read the article

  • My login controller doesn't work. Problem with fetching username.

    - by misterwebz
    Currently my login controller doesn't work because i can't seem to fetch the username and password. I'm currently using something like this: form_username = str(request.params.get('username')) db_user = meta.Session.query(User).filter_by(username=form_username) if db_user is None: return redirect('auth/error') No matter which username is use, db_user always returns True and thus never goes to auth/error. I used the shell to play with this and i was able establish a connection with the database, so i'm not sure what i'm doing wrong here.

    Read the article

  • When did you feel comfortable with programming?

    - by misterwebz
    I've been programming for about 6 months, but i still feel like i haven't learned anything. Or maybe i'm overwhelmed by the things i still don't know. Am i doing something wrong here or is this normal? I want to be able to work as a freelancer in a year or two, but i'm not sure if that goal is achievable. So when did you feel comfortable using your programming language of choice and how did you learn it?

    Read the article

1