My views.py has become too big and it\'s hard to find the right view.
How do I split it in several files and then import it? Does it involve any speed l
I've had to do this before (for clarities sake)
The way I did this was to create a views directory, then, in that, create a file called __init__.py
Now, when you're calling in your urls.py, you simply need to add another part
For example, previously, you may have called:-
url(r'^calendar/(?P\d\d\d\d)/$', 'myproject.calendar.views.year')
url(r'^calendar/(?P\d\d\d\d)/(?P[a-z]+)/$', 'myproject.calendar.views.year_by_user')
You can now call something along the lines of
url(r'^calendar/(?P\d\d\d\d)/$', 'myproject.calendar.views.year.index')
url(r'^calendar/(?P\d\d\d\d)/(?P[a-z]+)/$', 'myproject.calendar.views.year.user')
This is, of course, assuming that you had views/year.py containing the functions index and user ;)