Custom Search

Wednesday, January 2, 2013

how to create and run a pyramid project

1) How to create starter project
======================

(pyra_env)saju@saju-desktop:~/pyra_env/test$ pcreate -s starter starter_proj
Creating directory /home/saju/pyra_env/test/starter_proj
  Recursing into +package+
    Creating /home/saju/pyra_env/test/starter_proj/starter_proj/
    Copying __init__.py to /home/saju/pyra_env/test/starter_proj/starter_proj/__init__.py
    Recursing into static
      Creating /home/saju/pyra_env/test/starter_proj/starter_proj/static/
      Copying favicon.ico to /home/saju/pyra_env/test/starter_proj/starter_proj/static/favicon.ico
      Copying footerbg.png to /home/saju/pyra_env/test/starter_proj/starter_proj/static/footerbg.png
      Copying headerbg.png to /home/saju/pyra_env/test/starter_proj/starter_proj/static/headerbg.png
      Copying ie6.css to /home/saju/pyra_env/test/starter_proj/starter_proj/static/ie6.css
      Copying middlebg.png to /home/saju/pyra_env/test/starter_proj/starter_proj/static/middlebg.png
      Copying pylons.css to /home/saju/pyra_env/test/starter_proj/starter_proj/static/pylons.css
      Copying pyramid-small.png to /home/saju/pyra_env/test/starter_proj/starter_proj/static/pyramid-small.png
      Copying pyramid.png to /home/saju/pyra_env/test/starter_proj/starter_proj/static/pyramid.png
      Copying transparent.gif to /home/saju/pyra_env/test/starter_proj/starter_proj/static/transparent.gif
    Recursing into templates
      Creating /home/saju/pyra_env/test/starter_proj/starter_proj/templates/
      Copying mytemplate.pt_tmpl to /home/saju/pyra_env/test/starter_proj/starter_proj/templates/mytemplate.pt
    Copying tests.py_tmpl to /home/saju/pyra_env/test/starter_proj/starter_proj/tests.py
    Copying views.py_tmpl to /home/saju/pyra_env/test/starter_proj/starter_proj/views.py
  Copying CHANGES.txt_tmpl to /home/saju/pyra_env/test/starter_proj/CHANGES.txt
  Copying MANIFEST.in_tmpl to /home/saju/pyra_env/test/starter_proj/MANIFEST.in
  Copying README.txt_tmpl to /home/saju/pyra_env/test/starter_proj/README.txt
  Copying development.ini_tmpl to /home/saju/pyra_env/test/starter_proj/development.ini
  Copying production.ini_tmpl to /home/saju/pyra_env/test/starter_proj/production.ini
  Copying setup.cfg_tmpl to /home/saju/pyra_env/test/starter_proj/setup.cfg
  Copying setup.py_tmpl to /home/saju/pyra_env/test/starter_proj/setup.py
Welcome to Pyramid.  Sorry for the convenience.
(pyra_env)saju@saju-desktop:~/pyra_env/test$


2) How to create alchemy project
=======================

(pyra_env)saju@saju-desktop:~/pyra_env/test$ pcreate -s alchemy alchemy_proj
Creating directory /home/saju/pyra_env/test/alchemy_proj
  Recursing into +package+
    Creating /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/
    Copying __init__.py to /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/__init__.py
    Copying models.py to /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/models.py
    Recursing into scripts
      Creating /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/scripts/
      Copying __init__.py to /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/scripts/__init__.py
      Copying initializedb.py to /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/scripts/initializedb.py
    Recursing into static
      Creating /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/static/
      Copying favicon.ico to /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/static/favicon.ico
      Copying footerbg.png to /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/static/footerbg.png
      Copying headerbg.png to /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/static/headerbg.png
      Copying ie6.css to /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/static/ie6.css
      Copying middlebg.png to /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/static/middlebg.png
      Copying pylons.css to /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/static/pylons.css
      Copying pyramid-small.png to /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/static/pyramid-small.png
      Copying pyramid.png to /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/static/pyramid.png
      Copying transparent.gif to /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/static/transparent.gif
    Recursing into templates
      Creating /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/templates/
      Copying mytemplate.pt_tmpl to /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/templates/mytemplate.pt
    Copying tests.py_tmpl to /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/tests.py
    Copying views.py_tmpl to /home/saju/pyra_env/test/alchemy_proj/alchemy_proj/views.py
  Copying CHANGES.txt_tmpl to /home/saju/pyra_env/test/alchemy_proj/CHANGES.txt
  Copying MANIFEST.in_tmpl to /home/saju/pyra_env/test/alchemy_proj/MANIFEST.in
  Copying README.txt_tmpl to /home/saju/pyra_env/test/alchemy_proj/README.txt
  Copying development.ini_tmpl to /home/saju/pyra_env/test/alchemy_proj/development.ini
  Copying production.ini_tmpl to /home/saju/pyra_env/test/alchemy_proj/production.ini
  Copying setup.cfg_tmpl to /home/saju/pyra_env/test/alchemy_proj/setup.cfg
  Copying setup.py_tmpl to /home/saju/pyra_env/test/alchemy_proj/setup.py
Welcome to Pyramid.  Sorry for the convenience.
(pyra_env)saju@saju-desktop:~/pyra_env/test$

====================

* The setup.py file in that directory can be used to distribute your application,
or install your application for deployment or development.

* To install a newly created project for development, you should cd to the newly
created project directory and run the command "#python setup.py develop".

* The file named setup.py will be in the root of the pcreate-generated project directory.

* The command "#python setup.py develop" will install a distribution representing your
project into the interpreter’s library set so it can be found by import statements and
by other console scripts such as pserve, pshell, proutes and pviews.


python setup.py develop
==================
(pyra_env)saju@saju-desktop:~/pyra_env/test/alchemy_proj$ python setup.py develop
running develop
running egg_info
creating alchemy_proj.egg-info
writing requirements to alchemy_proj.egg-info/requires.txt
writing alchemy_proj.egg-info/PKG-INFO
writing top-level names to alchemy_proj.egg-info/top_level.txt
writing dependency_links to alchemy_proj.egg-info/dependency_links.txt
...................
........this will install all dependencies...........
...................

Running the project application
========================
* Once a project is installed for development, you can run the application it represents
using the pserve command against the generated configuration file. In our case,
this file is named development.ini.

$pserve development.ini
Starting server in PID 16601.
serving on 0.0.0.0:6543 view at http://127.0.0.1:6543

OR

$pserve development.ini --reload
Starting subprocess with file monitor
Starting server in PID 16601.
serving on http://0.0.0.0:6543


* You can change the port on which the server runs on by changing the development.ini file.
For example, you can change the port = 6543 line in the development.ini file’s [server:main]
section to port = 8080 to run the server on port 8080 instead of port 6543.


The Startup Process (IMP)
====================
http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/startup.html

=============

http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/project.html

http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/startup.html

http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/logging.html

http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/environment.html

No comments:

Post a Comment