On Mon, 2008-07-07 at 06:00 -0700, laspal wrote: > Hi, > I have a app called crm in which I have (model.py, views.py , > forms.py, urls.py and __init__.py) > > Now the problem is my code has become too big to handle in 1 file. > So I wanted to know how can I separate my views.py into multiples > files. > My models is as follows: > Industry: > Deals: > ................ > > So I wanted to create file like Industry.py, Deals.py so that my > views.py size will get reduce.. > Do I have to make changes to urls.py ??? > Where should I import all these files?? I just want to do it for my > views.py files only.
That's easy: - create a folder views with an empty __init__.py file inside. - split your old views.py into smaller files and delete views.py - modify your URLconf entries. You need something like 'crm.views.industry.my_view' instead of 'crm.views.my_view' You don't need to change anything else. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---