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
[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__ ?