Skip to content

Commit caacc28

Browse files
committed
Improve startproject command
1 parent 483d46f commit caacc28

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

.github/workflows/shared-build/action.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ runs:
4646
run: pip install "django>=4,<5"
4747
shell: bash
4848
- name: Setup testproject
49-
run: django-admin startproject testproject --extension py,json,yml,toml --name Dockerfile,README.md,.env.example,.gitignore,Makefile --template=.
49+
run: django-admin startproject testproject --extension py,json,yml,yaml,toml --name Dockerfile,README.md,.env.example,.gitignore,Makefile --template=.
5050
shell: bash
5151
- run: |
5252
npm update --save
@@ -101,14 +101,6 @@ runs:
101101
shell: bash
102102
- run: poetry run ruff check ./backend/
103103
working-directory: testproject
104-
env:
105-
SECRET_KEY: ${{ steps.secret-id-generator.outputs.SECRET_KEY }}
106-
SENDGRID_USERNAME: foo
107-
SENDGRID_PASSWORD: password
108-
DJANGO_SETTINGS_MODULE: 'testproject.settings.local'
109-
ALLOWED_HOSTS: '.example.org'
110-
REDIS_URL: 'redis://'
111-
DATABASE_URL: 'sqlite:///'
112104
shell: bash
113105
- run: poetry run python manage.py makemigrations --check --dry-run
114106
working-directory: testproject/backend

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you made changes to this boilerplate and want to test them, do as follows:
1515
- Run `git archive -o boilerplate.zip HEAD` to create the template zip file
1616
- Run the following:
1717
```bash
18-
cd .. && django-admin startproject theprojectname --extension py,json,yml,toml --name Dockerfile,README.md,.env.example,.gitignore,Makefile --template=django-react-boilerplate/boilerplate.zip
18+
cd .. && django-admin startproject theprojectname --extension py,json,yml,yaml,toml --name Dockerfile,README.md,.env.example,.gitignore,Makefile --template=django-react-boilerplate/boilerplate.zip
1919
```
2020
- A new folder called `theprojectname` will be created and now you can test your changes
2121
- Make sure that the project is still running fine with and without docker

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ Send us an email at [email protected] telling us a bit more about how ou
6868
- [ ] Open the command line and go to the directory you want to start your project in.
6969
- [ ] Start your project using:
7070
```
71-
django-admin startproject {{project_name}} --extension py,json,yml,toml --name Dockerfile,README.md,.env.example,.gitignore,Makefile --template=https://github.com/vintasoftware/django-react-boilerplate/archive/boilerplate-release.zip
71+
django-admin startproject {{project_name}} --extension py,json,yml,yaml,toml --name Dockerfile,README.md,.env.example,.gitignore,Makefile --template=https://github.com/vintasoftware/django-react-boilerplate/archive/boilerplate-release.zip
7272
```
7373
Alternatively, you may start the project in the current directory by placing a `.` right after the project name, using the following command:
7474
```
75-
django-admin startproject {{project_name}} . --extension py,json,yml,toml --name Dockerfile,README.md,.env.example,.gitignore,Makefile --template=https://github.com/vintasoftware/django-react-boilerplate/archive/boilerplate-release.zip
75+
django-admin startproject {{project_name}} . --extension py,json,yml,yaml,toml --name Dockerfile,README.md,.env.example,.gitignore,Makefile --template=https://github.com/vintasoftware/django-react-boilerplate/archive/boilerplate-release.zip
7676
```
7777
In the next steps, always remember to replace {{project_name}} with your project's name (in case it isn't yet):
7878
- [ ] Above: don't forget the `--extension` and `--name` params!
@@ -88,14 +88,14 @@ After completing ALL of the above, remove this `Project bootstrap` section from
8888
- Setup [editorconfig](http://editorconfig.org/), [ruff](https://github.com/astral-sh/ruff) and [ESLint](http://eslint.org/) in the text editor you will use to develop.
8989
9090
### Setup
91-
- Inside the `backend` folder, do the following:
92-
- Create a copy of `{{project_name}}/settings/local.py.example`:
93-
`cp {{project_name}}/settings/local.py.example {{project_name}}/settings/local.py`
94-
- Create a copy of `.env.example`:
95-
`cp .env.example .env`
91+
- Do the following:
92+
- Create a git-untracked `local.py` settings file:
93+
`cp backend/{{project_name}}/settings/local.py.example backend/{{project_name}}/settings/local.py`
94+
- Create a git-untracked `.env.example` file:
95+
`cp backend/.env.example backend/.env`
9696
9797
### If you are using Docker:
98-
- Open the `/backend/.env` file on a text editor and uncomment the line `DATABASE_URL=postgres://{{project_name}}:password@db:5432/{{project_name}}`
98+
- Open the `backend/.env` file on a text editor and uncomment the line `DATABASE_URL=postgres://{{project_name}}:password@db:5432/{{project_name}}`
9999
- Open a new command line window and go to the project's directory
100100
- Run the initial setup:
101101
`make docker_setup`
@@ -131,7 +131,7 @@ After completing ALL of the above, remove this `Project bootstrap` section from
131131
- This is used to serve the frontend assets to be consumed by [django-webpack-loader](https://github.com/django-webpack/django-webpack-loader) and not to run the React application as usual, so don't worry if you try to check what's running on port 3000 and see an error on your browser
132132
133133
#### Setup the backend app
134-
- Open the `/backend/.env` file on a text editor and do one of the following:
134+
- Open the `backend/.env` file on a text editor and do one of the following:
135135
- If you wish to use SQLite locally, uncomment the line `DATABASE_URL=sqlite:///backend/db.sqlite3`
136136
- If you wish to use PostgreSQL locally, uncomment and edit the line `DATABASE_URL=postgres://{{project_name}}:password@db:5432/{{project_name}}` in order to make it correctly point to your database URL
137137
- The url format is the following: `postgres://USER:PASSWORD@HOST:PORT/NAME`

0 commit comments

Comments
 (0)