Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial django scaffold #1

Merged
merged 20 commits into from
Jan 6, 2019
Merged

Initial django scaffold #1

merged 20 commits into from
Jan 6, 2019

Conversation

brylie
Copy link
Contributor

@brylie brylie commented Dec 29, 2018

Note: work-in-progress

Create initial project scaffold.

Todo

  • environment variable for secret key
  • developer set-up instructions in README
  • settings for database
  • conditional django-debug-toolbar setting
  • debug environment variable

Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
gramps_online/settings.py Outdated Show resolved Hide resolved
gramps_online/settings.py Outdated Show resolved Hide resolved
@brylie
Copy link
Contributor Author

brylie commented Dec 29, 2018

@Nick-Hall, it might be useful to have a 'work-in-progress' label (e.g. bright orange) to indicate that a PR is still under construction.

@Nick-Hall Nick-Hall added the work in progress Work in progress label Dec 29, 2018
@brylie
Copy link
Contributor Author

brylie commented Dec 29, 2018

Thanks @Nick-Hall

Also, I realize that Gramps uses Mantis for the primary bug tracker. However, would it be permissible to use GitHub issues to manage this project roadmap? That way, I can quickly create issues, document the design considerations, and link them to a related pull-request from a single interface.

@Nick-Hall
Copy link
Member

OK. I have enabled GitHub Issues for this repository. We probably don't need the features of Mantis at this point.

However, I suggest we use the Gramps wiki rather than the GitHub wiki for documentation.

Copy link
Member

@Nick-Hall Nick-Hall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing much to say at the moment. Obviously, each file will need a header containing program, copyright and license information.

The code should also conform to our programming guidelines and we should aim for a pylint score of 9.0 or higher. However, don't feel that every file must have a score greater than 9.0 if it not sensible to do so, especially in small files.

@brylie
Copy link
Contributor Author

brylie commented Dec 30, 2018

Ok, I'll follow the developer guidelines from that document.

Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
@brylie
Copy link
Contributor Author

brylie commented Dec 31, 2018

@Nick-Hall this PR is ready for review.

Copy link
Member

@Nick-Hall Nick-Hall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a django expert, but it looks good to me.

Please add a header to each file. I have committed a sample for you to copy.

A quick pylint also reveals a missing module docstring in the manage.py file. Some short like "A utility for administrative tasks" should suffice.

Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
@brylie
Copy link
Contributor Author

brylie commented Dec 31, 2018

@Nick-Hall thanks for catching the lint and reminding me. What do you think about enabling PEP8 Speaks on this repository, to automatically check for code lint in pull requests?

Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
Signed-off-by: Brylie Christopher Oxley <brylie@gnumedia.org>
@brylie
Copy link
Contributor Author

brylie commented Dec 31, 2018

@Nick-Hall I resolved the lint errors and added a license notice to all project Python files. Please review.

@Nick-Hall
Copy link
Member

@brylie We usually place the copyright and license at the start of each file as recommended in the license file.

Using PEP8 Speaks is a good idea. I'll look into it. Maybe we can use it for core Gramps as well.

@brylie
Copy link
Contributor Author

brylie commented Jan 1, 2019

For whatever reason, PyCharm puts the license notice after module docstring and #! line, if present. I don't really want to fight the IDE on this one, and noted that it is not a strict requirement that a Copyright notice begin on line one.

I will look for a setting in PyCharm ASAP, as I am currently on my phone.

@Nick-Hall
Copy link
Member

One of our developers applied for a PyCharm license back in 2011. What is it like?

As far as I know, the shebang and/or encoding lines need to be before the license at the top of the file. The module docstring can be below it, and this is where we place it in the Gramps code. Let me know if this causes a problem.

@brylie
Copy link
Contributor Author

brylie commented Jan 2, 2019

Overall, PyCharm provides a really nice developer experience, including Django helpers and debugging. I have spent the past several years doing JavaScript development and debugging without basic things like 'go to definition', debugging breakpoints, intelligent code completion, etc., so PyCharm feels like a whole different level of support.

I would like that there were an open-source IDE, perhaps built in Python, with rich Django support, but haven't found one.

@brylie
Copy link
Contributor Author

brylie commented Jan 2, 2019

I have searched around and read the PyCharm documentation, but can't find any solutions for specifying that the Copyright notice be added above the module docstring. I opened a question on StackOverflow in this regard.

If there doesn't emerge a simple, automated solution to handle this, I respectfully request that we overlook this issue, so that we can move forward with development.

@Nick-Hall
Copy link
Member

@brylie Is this ready to merge? Do you want to squash the commits?

@brylie brylie merged commit 2d879a0 into develop Jan 6, 2019
@brylie brylie deleted the initial-django branch January 6, 2019 18:01
@Nick-Hall Nick-Hall removed the work in progress Work in progress label Jan 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants