{"action":"created","issue":{"url":"https://api.github.com/repos/torchbox/wagtail-template/issues/28","labels_url":"https://api.github.com/repos/torchbox/wagtail-template/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/torchbox/wagtail-template/issues/28/comments","events_url":"https://api.github.com/repos/torchbox/wagtail-template/issues/28/events","html_url":"https://github.com/torchbox/wagtail-template/issues/28","id":58769209,"number":28,"title":"Restructuring ideas","user":{"login":"kaedroho","id":1093808,"avatar_url":"https://avatars.githubusercontent.com/u/1093808?v=3","gravatar_id":"","url":"https://api.github.com/users/kaedroho","html_url":"https://github.com/kaedroho","followers_url":"https://api.github.com/users/kaedroho/followers","following_url":"https://api.github.com/users/kaedroho/following{/other_user}","gists_url":"https://api.github.com/users/kaedroho/gists{/gist_id}","starred_url":"https://api.github.com/users/kaedroho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaedroho/subscriptions","organizations_url":"https://api.github.com/users/kaedroho/orgs","repos_url":"https://api.github.com/users/kaedroho/repos","events_url":"https://api.github.com/users/kaedroho/events{/privacy}","received_events_url":"https://api.github.com/users/kaedroho/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-24T17:07:38Z","updated_at":"2015-02-24T19:21:38Z","closed_at":null,"body":"In this template, we put all the projects code in a subdirectory. This is a nice way to separate code from configuration. Making the project easier to browse (especially for people who are unfamilar with the project).\r\n\r\nTheres a couple of issues though...\r\n - ``PYTHONPATH`` needs to be set to a subdirectory of the project. Configuration managment systems and PaaS services need to know about this.\r\n - The settings are deeply nested in a quite redundant-looking path.\r\n\r\nI propose that we make two changes:\r\n\r\nMake the root directory the python root (instead of the subdirectory)\r\n - The subdirectory will still exist though, all project imports would have to be prefixed with the project name eg: ``mysite.core``\r\n - This would make setting the ``PYTHONPATH`` variable easy as the configuration management system would not need to be aware of the internal structure of the project. It will also make projects work nicely on heroku/dokku/etc\r\n - This is exactly how python packages are structured\r\n\r\nRemove the project_name subfolder.\r\n - We currently have another folder inside the code directory named after the project for settings, urls.py, wsgi.py, etc.\r\n - I think we should move all of these files into the main code directory (so settings is found at ``project_name/settings``)."},"comment":{"url":"https://api.github.com/repos/torchbox/wagtail-template/issues/comments/75825882","html_url":"https://github.com/torchbox/wagtail-template/issues/28#issuecomment-75825882","issue_url":"https://api.github.com/repos/torchbox/wagtail-template/issues/28","id":75825882,"user":{"login":"kaedroho","id":1093808,"avatar_url":"https://avatars.githubusercontent.com/u/1093808?v=3","gravatar_id":"","url":"https://api.github.com/users/kaedroho","html_url":"https://github.com/kaedroho","followers_url":"https://api.github.com/users/kaedroho/followers","following_url":"https://api.github.com/users/kaedroho/following{/other_user}","gists_url":"https://api.github.com/users/kaedroho/gists{/gist_id}","starred_url":"https://api.github.com/users/kaedroho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaedroho/subscriptions","organizations_url":"https://api.github.com/users/kaedroho/orgs","repos_url":"https://api.github.com/users/kaedroho/repos","events_url":"https://api.github.com/users/kaedroho/events{/privacy}","received_events_url":"https://api.github.com/users/kaedroho/received_events","type":"User","site_admin":false},"created_at":"2015-02-24T19:21:38Z","updated_at":"2015-02-24T19:21:38Z","body":"manage.py would be in the root alongsite fabfile, etc\r\n\r\nurls.py and wsgi.py would be in the project folder (``/project_name/{urls,wsgi}.py``)"}}