Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

Empty urls referenced in Infohub urls.py #286

Open
HarinderKaur11 opened this issue Apr 21, 2017 · 2 comments
Open

Empty urls referenced in Infohub urls.py #286

HarinderKaur11 opened this issue Apr 21, 2017 · 2 comments

Comments

@HarinderKaur11
Copy link

HarinderKaur11 commented Apr 21, 2017

I have been studying the code and noticed that signup and profile apps have empty urls.py files and these have been referenced in the main urls.py file of infohub. I have following concerns:

  1. These should not be empty as these should reference to the views of its own views leading to increase in code reusability.
  2. In case these are empty, these should not be included or at least be commented out as it leads to open branches in code structure, hence decreasing code quality.

screen shot 2017-04-21 at 11 39 00 am

screen shot 2017-04-21 at 11 39 08 am

screen shot 2017-04-21 at 11 39 27 am

@mish24
Copy link

mish24 commented Apr 21, 2017

The standard code structure requires urls.py to be present in every app of Django. If that was the case, there are many unused models.py there as well. But they're mostly not removed, as I've seen in other Django projects.

@HarinderKaur11
Copy link
Author

@mish24 What I am trying to say is that, the purpose of having urls.py file is to map the urls to the view functions. If we have defined an app in django and there are functions in the views.py, these should be mapped via the urls of that app(in this case profile and signup app) to be able to reuse that app. Also, models and urls are different stories as models have the code for tables in the database and if we don't need to create tables for a app, it makes sense to leave it empty.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants