Pamela Fox
commited on
Commit
·
f28be2b
1
Parent(s):
80db45a
More azd fixes
Browse files- .devcontainer/devcontainer.json +1 -1
- .gitignore +2 -0
- README.md +11 -6
- infra/resources.bicep +1 -0
.devcontainer/devcontainer.json
CHANGED
@@ -49,7 +49,7 @@
|
|
49 |
},
|
50 |
|
51 |
// Use 'postCreateCommand' to run commands after the container is created.
|
52 |
-
"postCreateCommand": "pip install -r requirements.txt",
|
53 |
|
54 |
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
55 |
"remoteUser": "vscode",
|
|
|
49 |
},
|
50 |
|
51 |
// Use 'postCreateCommand' to run commands after the container is created.
|
52 |
+
"postCreateCommand": "pip install -r requirements-dev.txt && pre-commit install",
|
53 |
|
54 |
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
55 |
"remoteUser": "vscode",
|
.gitignore
CHANGED
@@ -2,3 +2,5 @@
|
|
2 |
__pycache__/
|
3 |
staticfiles/
|
4 |
.coverage
|
|
|
|
|
|
2 |
__pycache__/
|
3 |
staticfiles/
|
4 |
.coverage
|
5 |
+
|
6 |
+
.azure
|
README.md
CHANGED
@@ -46,13 +46,18 @@ coverage report
|
|
46 |
|
47 |
## Deployment
|
48 |
|
49 |
-
|
50 |
|
51 |
-
|
52 |
-
|
|
|
53 |
|
54 |
-
|
|
|
|
|
55 |
|
56 |
-
|
57 |
|
58 |
-
|
|
|
|
|
|
46 |
|
47 |
## Deployment
|
48 |
|
49 |
+
This repository is set up for deployment on Azure App Service (w/PostGreSQL flexible server) using the configuration files in the `infra` folder.
|
50 |
|
51 |
+
1. Sign up for a [free Azure account](https://azure.microsoft.com/free/?WT.mc_id=python-79461-pamelafox)
|
52 |
+
2. Install the [Azure Dev CLI](https://learn.microsoft.com/azure/developer/azure-developer-cli/install-azd?WT.mc_id=python-79461-pamelafox). (If you open this repository in Codespaces or with the VS Code Dev Containers extension, that part will be done for you.)
|
53 |
+
3. Provision and deploy all the resources:
|
54 |
|
55 |
+
```
|
56 |
+
azd up
|
57 |
+
```
|
58 |
|
59 |
+
4. To be able to access `/admin`, you'll need a Django superuser. Navigate to the Azure Portal for the App Service, select SSH, and run this command:
|
60 |
|
61 |
+
```
|
62 |
+
python manage.py createsuperuser
|
63 |
+
```
|
infra/resources.bicep
CHANGED
@@ -92,6 +92,7 @@ resource web 'Microsoft.Web/sites@2022-03-01' = {
|
|
92 |
alwaysOn: true
|
93 |
linuxFxVersion: 'PYTHON|3.10'
|
94 |
ftpsState: 'Disabled'
|
|
|
95 |
}
|
96 |
httpsOnly: true
|
97 |
}
|
|
|
92 |
alwaysOn: true
|
93 |
linuxFxVersion: 'PYTHON|3.10'
|
94 |
ftpsState: 'Disabled'
|
95 |
+
appCommandLine: 'python manage.py migrate'
|
96 |
}
|
97 |
httpsOnly: true
|
98 |
}
|