Reputation: 19578
I just started learning Pyramid using the official documentation and I found it very cool so far.
Unfortunately, while the basic one-file app is really simple and straight, I'm having an hard time trying to understand how a "serious app", generated using the pcreate
scaffolding command (alchemy
in my case), is supposed to be handled.
For example:
setup.py
mandatory or can I just use requirements.txt
as I'm used to do with Django in order to install dependencies? if I have to rely on setup.py
am I supposed to execute python setup.py develop
each time I create/delete a new file (since I saw them listed in SOURCES.txt
)?
In settings.ini
how "use
" (under [app:main]
) works? (can I "bypass" the egg-info
which is it pointing to and "bootrsapping" the app in an alternative way?)
Upvotes: 4
Views: 1047
Reputation: 15045
There are several tutorials that addresses all these topics, and provide references to further relevant reading for each step along the way. I suggest starting with the Quick Tutorial.
To answer your bullet points in order:
setup.py
is a standard for installing Python packages and dependencies and testing your app.pip install -e .
for installing more packages. Also while developing, you can use pserve development.ini --reload
which will monitor file changes and restart the server for you.use = egg:MyProject
, see Entry Points and PasteDeploy .ini Files. There are many ways to configure Pyramid apps including Application Configuration and Advanced Configuration.Upvotes: 2
Reputation: 83808
You chose Pyramid, the best Python web microframework, a very choice! Here are some pointers for further insight. Actually your question is not specific to Pyramid, but generally how Python packages and applications generally work.
is setup.py mandatory or can I just use requirements.txt as I'm used to do with Django in order to install dependencies?
It is not. You can use requirement.txt. setup.py install_dependencies
is mainly for libraries. For more information read blog post Declaring dependencies in Python.
if I have to rely on setup.py am I supposed to execute python setup.py develop each time I create/delete a new file (since I saw them listed in SOURCES.txt)?
It's not necessary.
In settings.ini how "use" (under [app:main]) works? (can I "bypass" the egg-info which is it pointing to and "bootrsapping" the app in an alternative way?)
Please see the other answer regarding Paster and Entry points.
Upvotes: 1