Skip to content

Commit

Permalink
Added some recommednations for Workflow and urls
Browse files Browse the repository at this point in the history
  • Loading branch information
shabda committed May 7, 2012
1 parent 6840a0d commit db8be9d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
4 changes: 3 additions & 1 deletion source/urls.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This enables calling `{% url urlpatternname %}` much easier.

The pattern name should be of the form `appname_viewname`. If the same view is
used in multiple urlpatterns, the name should be of form `appname_viewname_use`,
as in `search_advanced_auth` and `search_advanced_unauth`.::
as in `search_advanced_product` and `search_advanced_content`.::

#urls.py for app search
urlpatterns = patterns(
Expand All @@ -47,6 +47,8 @@ as in `search_advanced_auth` and `search_advanced_unauth`.::
url(r'^advanced_content_search/$', 'advanced', name='search_advanced_content'),
...
)

Here the same view `advanced` is used at two different urls and has two different names.

References
----------------
Expand Down
33 changes: 26 additions & 7 deletions source/workflow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,54 @@ Use a source control system
-------------------------------
Use SVN, GIT, Hg whatever. But choose one and use it.

Create a requirements.txt
----------------------------------
Your project should have a requirements.txt file. A `pip install -r requirements.txt`
should get all the third party apps which are not part of your source control system.

Use virtualenv and pip
---------------------------
Your various projects might require different versions of third party libraries. Use `virtualenv<http://pypi.python.org/pypi/virtualenv>`_ to keep
separate environments and use `pip<http://www.pip-installer.org/en/latest/index.html>`_ to manage dependencies.

Use pep8.py to check compliance with Python coding guidelines.
----------------------------------------------------------------
Your code would be using conforming to pep8, which are the standard coding guidelines. `Pep8.py<http://pypi.python.org/pypi/pep8>`_ can check your code for deviations.


Use pyflakes for static analysis.
----------------------------------------------------------------
`Pyflakes<http://pypi.python.org/pypi/pyflakes>` can find out some common mistakes. Run it after each deploy.


Use a bug tracking tool.
----------------------------
I recommend `Unfuddle <http://unfuddle.com/>`_, (It has various niceties, above
a source control and bug tracking tool).
But others might work for you. In particular Trac is free.

Use a schema migration tool
------------------------------
There are various schema migration tools available. `South <http://south.aeracode.org/>`_ has emerged as the
most used and supported tool.
Use south for schema migration
---------------------------------
Django doesn't come with a built in tool for Schema Migration. `South <http://south.aeracode.org/>`_ is the best tool for managing schema migrations and is well supported.

Create various entries in your /etc/hosts mapped to localhost
------------------------------------------------------------------
While development you probably want multiple users logged in to the site
simulataneously. For example, while developing, I have one user logged in the
simultaneously. For example, while developing, I have one user logged in the
admin, one normal
user using the site. If both try to access the site from localhost, one will be
logged out when other logs in.

If you have multiple entries mapped to localhost in /etc/hosts, you can use
multiple users simulataneously logged in.
multiple users simultaneously logged in.

Do not commit the generated files
-----------------------------------
Django does not have a lot of auto generated files. However as you work with
other django apps, you may come across auto generated files. These should not be
checked in the the Django repository.
For example, for this book, we checkin the source files and folder, but not the
autogenerated build folders.
auto-generated build folders.



0 comments on commit db8be9d

Please sign in to comment.