-
Notifications
You must be signed in to change notification settings - Fork 0
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
Make the template project compatible with startproject #20
Conversation
696c1fa
to
2dece40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really appreciate your doing this, Jon
I had wondered if we might want to use cookiecutter for this, but the inbuilt django method is much more straight-forward, especially when there aren't yet any variants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: there's some hardening that we should do at some point, but it's more for consistency than anything serious so I'm happy to leave it as is (and also to do the follow-up PR)
If you're interested, see ackama/rails-template#513 and related for the hardening changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with workflow permissions. I am assuming that since I am never attempting to make any changes to the repo during the workflow run I should be safe to just lock all the steps to read
only (with a global no permissions at all)?
If so then I don't see any reason not to include it as part of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup and we also want to set persist-credentials: false
on actions/checkout
calls
2dece40
to
f16ed0e
Compare
.github/workflows/startproject.yml
Outdated
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: I'm thinking that since we're always going to have permissions
now, we should have it as the first property for consistency, but it's not super important
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
permissions: | |
contents: read | |
runs-on: ubuntu-latest |
- 5432:5432 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: we should explicitly disable persisted credentials since they're not needed for this workflow
- uses: actions/checkout@v4 | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false |
Adds the necessary place holders for ensuring the `template` project can be used with the Django `startproject` command. Also adds a Github workflow for the repository itself that ensure the repository can be used to create a valid Django project.
f16ed0e
to
f00bdcc
Compare
Adds the necessary place holders for ensuring the
template
project can be used with the Djangostartproject
command.{{ project_name }}
)The Github action workflow
startproject
performs the following to ensure that we can create a valid project from this repositoiry:startproject
Django command specifying thetemplate
directory as the sourceinvoke check
on the project - which runs all the static analysis, linting and testsCloses #19