Good Day to all!

 

I just want to clarify my knowledge in Django

Because right now I am a little bit confused.

 

The views.py is the "controller" so this file is the

one who will be handling the POST and GET.

 

So there will be only one method that will be handling

the POST and GET for the whole application, so how can you differentiate
if the user is using the POST to save the Inventory items and not
Employee profiles?

 

Or I should have separate views.py for the Inventory items and Employee
profiles? 

If yes, so where should I put my main page where the user can login?

Or what should be the directory structure of my application?

 

Right now this is what my sample application looks like this

 

I hope this don't get distorted

 

DjangoProj [Directory]

      |

      |---------------------------- __init__.py

      |---------------------------- manage.py

      |---------------------------- settings.py

      |---------------------------- urls.py

      |--------App [Directory]

                        |

                        |----------------------------- __init__.py

                        |----------------------------- models.py  [ All
my models are here ]

                        |----------------------------- views.py   [ this
is where my web app starts ]

                        |

                        |- Forms [Directory]

                        |           |

                        |           |---------------------------------
__init__.py

                        |           |---------------------------------
LoginFrm.py      [ used for login ]

                        |           |---------------------------------
EmpFrm.py        [ used for adding employee and their access rights. I
just extended user of Django ]

                        |           |---------------------------------
InvItemFrm.py    [ used for add, delete, edit, view items]

                        |           |---------------------------------
RcveItemFrm.py   [ used for receiving items ]

                        |           |---------------------------------
ReturnItemFrm.py [ used for returning items ]

                        |

                        |

                        |- Templates [Directory]  

                                    |

                                    |---------------------------------
base.html        [ this is the base for all templates and it has a
checking feature to detect if user has login]


                                    |---------------------------------
base_login.html  [ this is used for login ]

                                    |---------------------------------
base_menu.html   [ this is used for viewing the menu ]

                                    |---------------------------------
index.html       [ this is the first page of my web app where you login
]

                                    |---------------------------------
main.html        [ this will come out after login in index.html ]

                                    |---------------------------------
aed_emp.html     [ used for add, delete, edit, view employees and their
rights ]

                                    |---------------------------------
aed_item.html    [ used for add, delete, edit, view items ]

                                    |---------------------------------
rcv_item.html    [ used for receiving items ]

                                    |---------------------------------
rtrn_item.html   [ used for returning items ]

                                    |---------------------------------
vrcv_items.html  [ used for viewing all items recieved ]

                                    |

                                    |- CSS [Directory]       [this is
where I put my CSS files ]

                                    |- Media [ Directory ]   [this is
where I put my images ]

                                    |- scripts [ Directory ]  [this is
where I put my javascripts ]

 

 

Is this the best way to organize the files in Django?

 

If you have comments, suggestion, anything please reply.

Need some inputs about this.

 

Also in a web cart scenario where is the best area to put the data of
the items inside the cart?

Is it good to put the checking if the user has login in the base
template and check the rights of the user in each page?

 

Hope someone here could be kind enough to help.

 

 

Thanks in advance

Myles

 

 

 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to