Skip to content

Commit

Permalink
Merge pull request #24 from AnimalFoodBank:wip/drf-via-cookiecutter
Browse files Browse the repository at this point in the history
API communication w/ Login
  • Loading branch information
delano authored Nov 21, 2023
2 parents d70902d + 76fca2d commit 85b0395
Show file tree
Hide file tree
Showing 143 changed files with 5,463 additions and 285 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -140,3 +176,8 @@ https://github.com/unfoldadmin/django-unfold#installation
]
}
```


## Links nov 19

https://httptoolkit.com/blog/how-to-debug-cors-errors/
27 changes: 27 additions & 0 deletions apps/afb_requests/.editorconfig
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
1 change: 1 addition & 0 deletions apps/afb_requests/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
20 changes: 20 additions & 0 deletions apps/afb_requests/.github/dependabot.yml
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'
71 changes: 71 additions & 0 deletions apps/afb_requests/.github/workflows/ci.yml
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
Loading

0 comments on commit 85b0395

Please sign in to comment.