Comments (2)
We have a set of issue templates, please help us help you: follow them to report a bug, they have questions we really need answers from, otherwise it's hard to answer.
Might be related to #4209 which OP mentioned a permission issue:
in order to create my own media folder with django:django as the owner:group, because in the PR doesn't include the media folder creation and when I build containers this media folder was created with root:root ownership, so my django app crashed when I tried to upload any file because doesn't have permissions to write on that folder.
from cookiecutter-django.
From the above just did
The only one modification I made was in /compose/production/django/Dockerfile, I added this line: RUN mkdir ${APP_HOME}/proveemax/media && chown django:django ${APP_HOME}/proveemax/media
I think @edwardigarashi might be onto something. The rule forweb-media-router
needs to have priority over the rule forweb-secure-router
. Traefik looks at the rule length to determine this when no explicit priority is set.These rules are defined in this file (traefik.yml).
Adding a high priority like 1000 (just has to be higher than the length of the rule in
web-secure-router
) will make Traefik prioritize this rule.web-media-router: rule: "Host(`{{ cookiecutter.domain_name }}`) && PathPrefix(`/media/`)" entryPoints: - web-secure middlewares: - csrf service: django-media tls: certResolver: letsencrypt priority: 1000
Alternatively, you can manually set the priority for both rules. Which might be a better solution to merge in case this solves the issue. Or we could even add the
www
subdomain to the media router rule like this:rule: "(Host(`{{ cookiecutter.domain_name }}`) || Host(`www.{{ cookiecutter.domain_name }}`)) && PathPrefix(`/media/`)"
This would always make the media router rule have priority when consistent with the
web-secure-router
rule.@maponzzi This is definitely happening in your case. Your first rule has a priority of 70 and the media rule has a priority of 56. So nothing will ever be sent to the media router.
try changing the nginx container from nginx:1.17.8-alpine to nginx:1.23-alpine in the Docker file for nginx and see if that fixes the issue.
from cookiecutter-django.
Related Issues (20)
- Improve test coverage of production build/config HOT 2
- whitenoise.runserver_nostatic is ignored HOT 5
- Cannot connect to redis://redis:6379/0 HOT 1
- Link in README to http://12factor.net is broken - use HTTPS
- cookiecutter-django template django.db.utils.ProgrammingError HOT 3
- Django can't find assetss generated by Webpack HOT 2
- 504 Gateway Timeout HOT 2
- VSCode privileges .editorconfig over settings.json for single quotes HOT 3
- Unused gulp dependency added to package.json when Webpack is chosen HOT 2
- fresh project runs into `ERROR: value too long for type character varying(50)` HOT 3
- Collectfast is no longer maintained HOT 1
- Invalid HTTP_HOST header: <ip>. You may need to add <ip> to ALLOWED_HOSTS. (yes, again) HOT 1
- Addressing E203 Whitespace Error in Pre-commit using flake8 Configuration HOT 1
- Why prefer python than bash for wait the service start HOT 2
- Changes are not detected in docker windows without frontend pipeline HOT 2
- Lightweight Cookiecutter Project
- error on letsencrypt certificate renewal HOT 4
- Flower on production raises Permission denied
- Python 3.12 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cookiecutter-django.