Pamela Fox
commited on
Commit
·
9a1de81
1
Parent(s):
da9b1f7
Update to versions and dev container
Browse files- .devcontainer/Dockerfile +2 -2
- .devcontainer/devcontainer.json +0 -3
- .devcontainer/docker-compose.yml +1 -1
- .github/dependabot.yaml +11 -0
- README.md +5 -5
- infra/main.bicep +1 -1
- requirements.txt +3 -3
.devcontainer/Dockerfile
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
ARG
|
2 |
-
FROM --platform=amd64 mcr.microsoft.com/
|
3 |
|
4 |
RUN curl -fsSL https://aka.ms/install-azd.sh | bash
|
5 |
|
|
|
1 |
+
ARG IMAGE=bullseye
|
2 |
+
FROM --platform=amd64 mcr.microsoft.com/devcontainers/${IMAGE}
|
3 |
|
4 |
RUN curl -fsSL https://aka.ms/install-azd.sh | bash
|
5 |
|
.devcontainer/devcontainer.json
CHANGED
@@ -10,9 +10,6 @@
|
|
10 |
"features": {
|
11 |
"ghcr.io/devcontainers/features/github-cli:1": {
|
12 |
"version": "latest"
|
13 |
-
},
|
14 |
-
"ghcr.io/devcontainers/features/python:1": {
|
15 |
-
"version": "os-provided"
|
16 |
}
|
17 |
},
|
18 |
|
|
|
10 |
"features": {
|
11 |
"ghcr.io/devcontainers/features/github-cli:1": {
|
12 |
"version": "latest"
|
|
|
|
|
|
|
13 |
}
|
14 |
},
|
15 |
|
.devcontainer/docker-compose.yml
CHANGED
@@ -7,7 +7,7 @@ services:
|
|
7 |
dockerfile: .devcontainer/Dockerfile
|
8 |
args:
|
9 |
# [Choice] Python version: 3, 3.8, 3.7, 3.6
|
10 |
-
|
11 |
# On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
|
12 |
USER_UID: 1000
|
13 |
USER_GID: 1000
|
|
|
7 |
dockerfile: .devcontainer/Dockerfile
|
8 |
args:
|
9 |
# [Choice] Python version: 3, 3.8, 3.7, 3.6
|
10 |
+
IMAGE: python:3.10
|
11 |
# On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
|
12 |
USER_UID: 1000
|
13 |
USER_GID: 1000
|
.github/dependabot.yaml
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# To get started with Dependabot version updates, you'll need to specify which
|
2 |
+
# package ecosystems to update and where the package manifests are located.
|
3 |
+
# Please see the documentation for all configuration options:
|
4 |
+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
5 |
+
|
6 |
+
version: 2
|
7 |
+
updates:
|
8 |
+
- package-ecosystem: "pip" # See documentation for possible values
|
9 |
+
directory: "/" # Location of package manifests
|
10 |
+
schedule:
|
11 |
+
interval: "weekly"
|
README.md
CHANGED
@@ -22,7 +22,7 @@ then it's best to first [create a Python virtual environment](https://docs.pytho
|
|
22 |
1. Install the requirements:
|
23 |
|
24 |
```shell
|
25 |
-
pip install -r requirements.txt
|
26 |
```
|
27 |
|
28 |
2. Create an `.env` file using `.env.sample` as a guide. Set the value of `DBNAME` to the name of an existing database in your local PostgreSQL instance. Set the values of `DBHOST`, `DBUSER`, and `DBPASS` as appropriate for your local PostgreSQL instance. If you're in the devcontainer, copy the values exactly from `.env.sample`.
|
@@ -30,13 +30,13 @@ pip install -r requirements.txt
|
|
30 |
3. Run the migrations:
|
31 |
|
32 |
```
|
33 |
-
|
34 |
```
|
35 |
|
36 |
4. Run the local server:
|
37 |
|
38 |
```
|
39 |
-
|
40 |
```
|
41 |
|
42 |
5. Navigate to "/quizzes" (since no "/" route is defined) to verify server is working.
|
@@ -48,7 +48,7 @@ This app comes with the built-in Django admin.
|
|
48 |
1. Create a superuser:
|
49 |
|
50 |
```
|
51 |
-
|
52 |
```
|
53 |
|
54 |
2. Restart the server and navigate to "/admin"
|
@@ -60,7 +60,7 @@ python manage.py createsuperuser
|
|
60 |
Run tests:
|
61 |
|
62 |
```
|
63 |
-
|
64 |
coverage run --source='.' manage.py test quizzes
|
65 |
coverage report
|
66 |
```
|
|
|
22 |
1. Install the requirements:
|
23 |
|
24 |
```shell
|
25 |
+
python3 -m pip install -r requirements-dev.txt
|
26 |
```
|
27 |
|
28 |
2. Create an `.env` file using `.env.sample` as a guide. Set the value of `DBNAME` to the name of an existing database in your local PostgreSQL instance. Set the values of `DBHOST`, `DBUSER`, and `DBPASS` as appropriate for your local PostgreSQL instance. If you're in the devcontainer, copy the values exactly from `.env.sample`.
|
|
|
30 |
3. Run the migrations:
|
31 |
|
32 |
```
|
33 |
+
python3 manage.py migrate
|
34 |
```
|
35 |
|
36 |
4. Run the local server:
|
37 |
|
38 |
```
|
39 |
+
python3 manage.py runserver
|
40 |
```
|
41 |
|
42 |
5. Navigate to "/quizzes" (since no "/" route is defined) to verify server is working.
|
|
|
48 |
1. Create a superuser:
|
49 |
|
50 |
```
|
51 |
+
python3 manage.py createsuperuser
|
52 |
```
|
53 |
|
54 |
2. Restart the server and navigate to "/admin"
|
|
|
60 |
Run tests:
|
61 |
|
62 |
```
|
63 |
+
python3 manage.py collectstatic
|
64 |
coverage run --source='.' manage.py test quizzes
|
65 |
coverage report
|
66 |
```
|
infra/main.bicep
CHANGED
@@ -73,7 +73,7 @@ module web 'core/host/appservice.bicep' = {
|
|
73 |
tags: union(tags, { 'azd-service-name': 'web' })
|
74 |
appServicePlanId: appServicePlan.outputs.id
|
75 |
runtimeName: 'python'
|
76 |
-
runtimeVersion: '3.
|
77 |
scmDoBuildDuringDeployment: true
|
78 |
ftpsState: 'Disabled'
|
79 |
managedIdentity: true
|
|
|
73 |
tags: union(tags, { 'azd-service-name': 'web' })
|
74 |
appServicePlanId: appServicePlan.outputs.id
|
75 |
runtimeName: 'python'
|
76 |
+
runtimeVersion: '3.10'
|
77 |
scmDoBuildDuringDeployment: true
|
78 |
ftpsState: 'Disabled'
|
79 |
managedIdentity: true
|
requirements.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
Django==4.1.1
|
2 |
-
psycopg2
|
3 |
-
python-dotenv
|
4 |
-
whitenoise[brotli]
|
|
|
1 |
Django==4.1.1
|
2 |
+
psycopg2==2.9.5
|
3 |
+
python-dotenv==0.21.1
|
4 |
+
whitenoise[brotli]==6.3.0
|