-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from AnimalFoodBank:wip/drf-via-cookiecutter
API communication w/ Login
- Loading branch information
Showing
143 changed files
with
5,463 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,26 @@ https://vitejs.dev/guide/#scaffolding-your-first-vite-project | |
https://vuejs.org/guide/scaling-up/tooling.html#project-scaffolding | ||
|
||
|
||
We're using Vue 3 with vue-i18n, make sure to install the vue-i18n@next version, which includes support for Vue 3 and TypeScript. | ||
|
||
```bash | ||
yarn add vue-i18n@next | ||
``` | ||
|
||
|
||
Remember to configure TypeScript to include the vue-i18n types in your tsconfig.json file: | ||
|
||
```json | ||
{ | ||
"compilerOptions": { | ||
// ... | ||
"types": ["vue-i18n"] | ||
} | ||
} | ||
``` | ||
|
||
This will enable TypeScript to recognize the types from vue-i18n and provide better autocompletion and error checking. | ||
|
||
|
||
## Commands | ||
|
||
|
@@ -42,8 +62,24 @@ https://vuejs.org/guide/scaling-up/tooling.html#project-scaffolding | |
$ pip-compile --upgrade --output-file=- requirements.in | tee requirements.txt | ||
... | ||
|
||
```bash | ||
curl -v -X POST -H "Content-Type: application/json" -H "X-CSRFToken: $token" -d '{"username":"[email protected]","password":"1234"}' http://127.0.0.1:8000/auth-token/ | ||
``` | ||
|
||
### DRF | ||
|
||
|
||
#### Mailpit | ||
https://cookiecutter-django.readthedocs.io/en/latest/developing-locally.html#mailpit | ||
https://github.com/axllent/mailpit | ||
|
||
```bash | ||
$ ./mailpit | ||
INFO[2023/11/17 18:22:21] [smtpd] starting on 0.0.0.0:1025 | ||
INFO[2023/11/17 18:22:21] [http] starting server on http://localhost:8025/ | ||
``` | ||
http://localhost:8025 | ||
|
||
|
||
|
||
### Django Management | ||
|
@@ -140,3 +176,8 @@ https://github.com/unfoldadmin/django-unfold#installation | |
] | ||
} | ||
``` | ||
|
||
|
||
## Links nov 19 | ||
|
||
https://httptoolkit.com/blog/how-to-debug-cors-errors/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# http://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.{py,rst,ini}] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[*.{html,css,scss,json,yml,xml}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[Makefile] | ||
indent_style = tab | ||
|
||
[default.conf] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Config for Dependabot updates. See Documentation here: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
# Update GitHub actions in workflows | ||
- package-ecosystem: 'github-actions' | ||
directory: '/' | ||
# Every weekday | ||
schedule: | ||
interval: 'daily' | ||
|
||
# Enable version updates for Python/Pip - Production | ||
- package-ecosystem: 'pip' | ||
# Look for a `requirements.txt` in the `root` directory | ||
# also 'setup.cfg', 'runtime.txt' and 'requirements/*.txt' | ||
directory: '/' | ||
# Every weekday | ||
schedule: | ||
interval: 'daily' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: CI | ||
|
||
# Enable Buildkit and let compose use it to speed up image building | ||
env: | ||
DOCKER_BUILDKIT: 1 | ||
COMPOSE_DOCKER_CLI_BUILD: 1 | ||
|
||
on: | ||
pull_request: | ||
branches: ['master', 'main'] | ||
paths-ignore: ['docs/**'] | ||
|
||
push: | ||
branches: ['master', 'main'] | ||
paths-ignore: ['docs/**'] | ||
|
||
concurrency: | ||
group: ${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
linter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
# Consider using pre-commit.ci for open source project | ||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] | ||
|
||
# With no caching at all the entire ci process takes 4m 30s to complete! | ||
pytest: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
postgres: | ||
image: postgres:15 | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
|
||
env: | ||
# postgres://user:password@host:port/database | ||
DATABASE_URL: 'postgres://postgres:postgres@localhost:5432/postgres' | ||
|
||
steps: | ||
- name: Checkout Code Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: pip | ||
cache-dependency-path: | | ||
requirements/base.txt | ||
requirements/local.txt | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements/local.txt | ||
- name: Test with pytest | ||
run: pytest |
Oops, something went wrong.