mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
Fix after rebase
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -3,6 +3,8 @@ from datetime import timedelta
|
|||||||
|
|
||||||
import factory
|
import factory
|
||||||
import pytest
|
import pytest
|
||||||
|
# work around for bug described here https://stackoverflow.com/a/70312265/15762829
|
||||||
|
from django.conf import settings
|
||||||
from django.contrib import auth
|
from django.contrib import auth
|
||||||
from django.forms import model_to_dict
|
from django.forms import model_to_dict
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
@@ -14,6 +16,11 @@ from cookbook.models import Food, Ingredient, ShoppingListEntry, Step
|
|||||||
from cookbook.tests.factories import (IngredientFactory, MealPlanFactory, RecipeFactory,
|
from cookbook.tests.factories import (IngredientFactory, MealPlanFactory, RecipeFactory,
|
||||||
StepFactory, UserFactory)
|
StepFactory, UserFactory)
|
||||||
|
|
||||||
|
if settings.DATABASES['default']['ENGINE'] in ['django.db.backends.postgresql_psycopg2',
|
||||||
|
'django.db.backends.postgresql']:
|
||||||
|
from django.db.backends.postgresql.features import DatabaseFeatures
|
||||||
|
DatabaseFeatures.can_defer_constraint_checks = False
|
||||||
|
|
||||||
SHOPPING_LIST_URL = 'api:shoppinglistentry-list'
|
SHOPPING_LIST_URL = 'api:shoppinglistentry-list'
|
||||||
SHOPPING_RECIPE_URL = 'api:recipe-shopping'
|
SHOPPING_RECIPE_URL = 'api:recipe-shopping'
|
||||||
|
|
||||||
@@ -43,7 +50,7 @@ def recipe(request, space_1, u1_s1):
|
|||||||
# steps__food_recipe_count = params.get('steps__food_recipe_count', {})
|
# steps__food_recipe_count = params.get('steps__food_recipe_count', {})
|
||||||
params['created_by'] = params.get('created_by', auth.get_user(u1_s1))
|
params['created_by'] = params.get('created_by', auth.get_user(u1_s1))
|
||||||
params['space'] = space_1
|
params['space'] = space_1
|
||||||
return RecipeFactory.create(**params)
|
return RecipeFactory(**params)
|
||||||
|
|
||||||
# return RecipeFactory.create(
|
# return RecipeFactory.create(
|
||||||
# steps__recipe_count=steps__recipe_count,
|
# steps__recipe_count=steps__recipe_count,
|
||||||
|
|||||||
@@ -65,15 +65,16 @@ This configuration exposes the application through an nginx web server on port 8
|
|||||||
wget https://raw.githubusercontent.com/vabene1111/recipes/develop/docs/install/docker/plain/docker-compose.yml
|
wget https://raw.githubusercontent.com/vabene1111/recipes/develop/docs/install/docker/plain/docker-compose.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
~~~yaml
|
```yaml
|
||||||
{ % include "./docker/plain/docker-compose.yml" % }
|
{ % include "./docker/plain/docker-compose.yml" % }
|
||||||
~~~
|
```
|
||||||
|
|
||||||
### Reverse Proxy
|
### Reverse Proxy
|
||||||
|
|
||||||
Most deployments will likely use a reverse proxy.
|
Most deployments will likely use a reverse proxy.
|
||||||
|
|
||||||
#### Traefik
|
#### Traefik
|
||||||
|
|
||||||
If you use traefik, this configuration is the one for you.
|
If you use traefik, this configuration is the one for you.
|
||||||
|
|
||||||
!!! info
|
!!! info
|
||||||
@@ -85,9 +86,9 @@ If you use traefik, this configuration is the one for you.
|
|||||||
wget https://raw.githubusercontent.com/vabene1111/recipes/develop/docs/install/docker/traefik-nginx/docker-compose.yml
|
wget https://raw.githubusercontent.com/vabene1111/recipes/develop/docs/install/docker/traefik-nginx/docker-compose.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
~~~yaml
|
```yaml
|
||||||
{ % include "./docker/traefik-nginx/docker-compose.yml" % }
|
{ % include "./docker/traefik-nginx/docker-compose.yml" % }
|
||||||
~~~
|
```
|
||||||
|
|
||||||
#### nginx-proxy
|
#### nginx-proxy
|
||||||
|
|
||||||
@@ -97,6 +98,7 @@ in combination with [jrcs's letsencrypt companion](https://hub.docker.com/r/jrcs
|
|||||||
Please refer to the appropriate documentation on how to setup the reverse proxy and networks.
|
Please refer to the appropriate documentation on how to setup the reverse proxy and networks.
|
||||||
|
|
||||||
Remember to add the appropriate environment variables to `.env` file:
|
Remember to add the appropriate environment variables to `.env` file:
|
||||||
|
|
||||||
```
|
```
|
||||||
VIRTUAL_HOST=
|
VIRTUAL_HOST=
|
||||||
LETSENCRYPT_HOST=
|
LETSENCRYPT_HOST=
|
||||||
@@ -107,28 +109,28 @@ LETSENCRYPT_EMAIL=
|
|||||||
wget https://raw.githubusercontent.com/vabene1111/recipes/develop/docs/install/docker/nginx-proxy/docker-compose.yml
|
wget https://raw.githubusercontent.com/vabene1111/recipes/develop/docs/install/docker/nginx-proxy/docker-compose.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
~~~yaml
|
```yaml
|
||||||
{ % include "./docker/nginx-proxy/docker-compose.yml" % }
|
{ % include "./docker/nginx-proxy/docker-compose.yml" % }
|
||||||
~~~
|
```
|
||||||
|
|
||||||
#### Nginx Swag by LinuxServer
|
#### Nginx Swag by LinuxServer
|
||||||
[This container](https://github.com/linuxserver/docker-swag) is an all in one solution created by LinuxServer.io
|
|
||||||
|
|
||||||
It also contains templates for popular apps, including Tandoor Recipes, so you don't have to manually configure nginx and discard the template provided in Tandoor repo. Tandoor config is called `recipes.subdomain.conf.sample` which you can adapt for your instance
|
[This container](https://github.com/linuxserver/docker-swag) is an all in one solution created by LinuxServer.io.
|
||||||
|
|
||||||
|
It contains templates for popular apps, including Tandoor Recipes, so you don't have to manually configure nginx and discard the template provided in Tandoor repo. Tandoor config is called `recipes.subdomain.conf.sample` which you can adapt for your instance.
|
||||||
|
|
||||||
If you're running Swag on the default port, you'll just need to change the container name to yours.
|
If you're running Swag on the default port, you'll just need to change the container name to yours.
|
||||||
|
|
||||||
If your running Swag on a custom port, some headers must be changed. To do this,
|
If your running Swag on a custom port, some headers must be changed:
|
||||||
|
|
||||||
- Create a copy of `proxy.conf`
|
- Create a copy of `proxy.conf`
|
||||||
- Replace `proxy_set_header X-Forwarded-Host $host;` and `proxy_set_header Host $host;` to
|
- Replace `proxy_set_header X-Forwarded-Host $host;` and `proxy_set_header Host $host;` to
|
||||||
- `proxy_set_header X-Forwarded-Host $http_host;` and `proxy_set_header Host $http_host;`
|
- `proxy_set_header X-Forwarded-Host $http_host;` and `proxy_set_header Host $http_host;`
|
||||||
- Update `recipes.subdomain.conf` to use the new file
|
- Update `recipes.subdomain.conf` to use the new file
|
||||||
- Restart the linuxserver/swag container and Recipes will work
|
- Restart the linuxserver/swag container and Recipes will work correctly
|
||||||
|
|
||||||
More information [here](https://github.com/TandoorRecipes/recipes/issues/959#issuecomment-962648627).
|
More information [here](https://github.com/TandoorRecipes/recipes/issues/959#issuecomment-962648627).
|
||||||
|
|
||||||
|
|
||||||
In both cases, also make sure to mount `/media/` in your swag container to point to your Tandoor Recipes Media directory.
|
In both cases, also make sure to mount `/media/` in your swag container to point to your Tandoor Recipes Media directory.
|
||||||
|
|
||||||
Please refer to the [appropriate documentation](https://github.com/linuxserver/docker-swag#usage) for the container setup.
|
Please refer to the [appropriate documentation](https://github.com/linuxserver/docker-swag#usage) for the container setup.
|
||||||
@@ -136,6 +138,7 @@ Please refer to the [appropriate documentation](https://github.com/linuxserver/d
|
|||||||
## Additional Information
|
## Additional Information
|
||||||
|
|
||||||
### Nginx vs Gunicorn
|
### Nginx vs Gunicorn
|
||||||
|
|
||||||
All examples use an additional `nginx` container to serve mediafiles and act as the forward facing webserver.
|
All examples use an additional `nginx` container to serve mediafiles and act as the forward facing webserver.
|
||||||
This is **technically not required** but **very much recommended**.
|
This is **technically not required** but **very much recommended**.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user