#pyramid

/

      • sawdog_ joined the channel
      • sawdog_ is now known as sawdog
      • cyp joined the channel
      • mejymejy joined the channel
      • mejymejy has quit
      • _julian joined the channel
      • digitalsatori joined the channel
      • moo-_- joined the channel
      • tjt263 joined the channel
      • rickmak_ joined the channel
      • rickmak joined the channel
      • rickmak_ joined the channel
      • asarch joined the channel
      • ryanhiebert joined the channel
      • mejymejy joined the channel
      • mejymejy has quit
      • otter768 joined the channel
      • vyndion has quit
      • rtopliffe has quit
      • falican joined the channel
      • c0le joined the channel
      • Kane` joined the channel
      • c0le has quit
      • ramteid joined the channel
      • c0le joined the channel
      • rickmak_ has quit
      • tisto joined the channel
      • tokra100 joined the channel
      • digitalsatori joined the channel
      • otter768 joined the channel
      • yeukhon joined the channel
      • digitalsatori joined the channel
      • frispete_ joined the channel
      • digitalsatori joined the channel
      • hpeter joined the channel
      • atomekk joined the channel
      • rickmak joined the channel
      • brodul joined the channel
      • El_Rolando joined the channel
      • yleclanche joined the channel
      • digitalsatori joined the channel
      • mr_jolly joined the channel
      • digitalsatori joined the channel
      • digitalsatori joined the channel
      • zupo joined the channel
      • mr_jolly has quit
      • markm joined the channel
      • mr_jolly joined the channel
      • mr_jolly has quit
      • Paradisee joined the channel
      • digitalsatori joined the channel
      • frkout joined the channel
      • Paradisee
        hello guys
      • i never used pyramid before, i come from flask, but i'm having troubles with it and its tutorial
      • can maybe someone give me a little hand with a simple application?
      • rickmak joined the channel
      • i have to develop an e-commerce site, i already have the whole template, but can't figure out how to get started with pyramid.
      • stevepiercy applauds a little for Paradisee
      • mr_jolly joined the channel
      • stevepiercy
        Paradisee a template is all you have?
      • Paradisee
        by template, i mean full graphic, and so on.
      • stevepiercy
        ecommerce sites usually involve a great deal more complexity than just HTML, CSS, and images
      • if you use PayPal buttons, you're done
      • Paradisee
        anyway.
      • stevepiercy
        if you want to write your own ecommerce app, i'd first ask what kind of web apps have you previously created?
      • Paradisee
        i've made lot of them, where people buy stuff.
      • stevepiercy
        have you done any programming?
      • Paradisee
        all the time.
      • stevepiercy
        in what language?
      • Paradisee
        py.
      • i'm not a beginner if that is what i wanna ask
      • stevepiercy
        ok, just had to weed out the possible poser
      • Paradisee
        you*
      • stevepiercy
        yeah
      • yeah, if you had no experience with web app dev, i'd say go learn some stuff, come back in about a year
      • so with Pyramid, it's just Python
      • with a bunch of cool stuff slapped on top
      • that's a crude description, but not too far off the mark
      • Paradisee
        i don't know if you used flask before, but i usually add a route/view for my html page, but in pyramid the things seems pretty different (not so different)
      • i see you can use .pt
      • tisto is now known as tisto|away
      • stevepiercy
        ok, so i'd recommend looking at some examples of configuring routes in the Quck Tutorial
      • Paradisee
        i've read that almost.
      • stevepiercy
        .pt is simply one kind of template
      • Quick
      • Quack
      • Paradisee
        bvasically its html.
      • stevepiercy
        right
      • which is what made me think at first, uh-oh, newb
      • templates have nothing to do with configuring routes
      • Paradisee
        ya, i know that
      • all the stuff is done in python.
      • stevepiercy
        you are probably most familiar with url dispatch
      • this is the relevant step in the Quick Tutorial http://docs.pylonsproject.org/projects/pyramid/...
      • Paradisee
        from the example i can see this: @view_config(route_name='home', renderer='templates/mytemplate.pt')
      • stevepiercy
        yup
      • Paradisee
        but it should be added in some way?
      • i mean, in the config or somewhere else?
      • i mean the orute.
      • config.add_static_view('static', 'static', cache_max_age=3600)
      • config.add_route('home', '/')
      • that's what im trying to understand.
      • stevepiercy
        "it" as in the route?
      • Paradisee
        ?
      • stevepiercy
        [00:29:22] <Paradisee> from the example i can see this: @view_config(route_name='home', renderer='templates/mytemplate.pt')
      • [00:29:37] <Paradisee> but it should be added in some way?
      • otter768 joined the channel
      • Paradisee
        the view.py should have all these methods and decoratore that describe where the template should be "routed"
      • stevepiercy
        there are a few ways to configure routes. in the method demonstrated, the route is configured in the __init.py__ file
      • Paradisee
        but do i need to define them in the config?
      • ya, i saw that
      • stevepiercy
        that's just one way to configure routes
      • wiggy joined the channel
      • Paradisee
        i would like to avoid that way
      • wiggy
        morning
      • Paradisee
        instead, like in flask just making methods to define them.
      • morning.
      • stevepiercy
        ah, there's a problem with that
      • with how flask does it
      • sure, it's easy, but....
      • read the note in the blue box at the start of that Step 11.
      • Paradisee
        Why do this twice? Other Python web frameworks let you create a route and associate it with a view in one step. As illustrated in Routes Need Relative Ordering, multiple routes might match the same URL pattern. Rather than provide ways to help guess, Pyramid lets you be explicit in ordering. Pyramid also gives facilities to avoid the problem. It's relatively easy to build a system that uses implicit route ordering with Pyramid too.
      • stevepiercy
        yup
      • that one
      • "other frameworks" includes Flask
      • Paradisee
        YA
      • so it's reccomended to make all the routes in the __init__ ?
      • i'll give a try. i'm gonna fail so badly :D
      • otter768 has quit
      • stevepiercy
        failing is good because you learn what not to do
      • Paradisee
        ParseError: Unexpected end tag.
      • - String: "</div>"
      • - Filename: /home/paradisee/Documents/Pyramid/Reatina/reatina/templates/index.pt
      • sakal_ joined the channel
      • ]np
      • is there a way to return the whole page.pt ?
      • Ergo joined the channel
      • instead of a dict.
      • wiggy
        you can return a response directly
      • plamut_ joined the channel
      • Paradisee
        can you make me an example?
      • stevepiercy
        Paradisee regarding Route Configuration, see: http://docs.pylonsproject.org/projects/pyramid/... That's the long, complete story
      • Paradisee the paste you gave does not show a route configuration
      • Paradisee
        that's in the __init__
      • and it is from the scaffold.
      • didn't change nothing there yet.
      • Ergo
        hey guys
      • Paradisee
        o/
      • stevepiercy
        as a sanity check, Paradisee do you have a working demo of a Pyramid app?