-
Notifications
You must be signed in to change notification settings - Fork 6.6k
modify middleware settings and url paths for django 2.0 #1503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
CLAs look good, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tutorial at https://cloud.google.com/python/django/kubernetes-engine is currently broken. This PR fixes the issue.
For example, the wrong middleware causes an error when accessing Django admin console:
AttributeError: 'WSGIRequest' object has no attribute 'user'
@@ -21,11 +21,11 @@ FROM gcr.io/google_appengine/python | |||
|
|||
# Create a virtualenv for the application dependencies. | |||
# # If you want to use Python 3, add the -p python3.4 flag. | |||
RUN virtualenv /env | |||
RUN virtualenv -p python3.4 /env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I bumped this to 3.6 and confirmed it works 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I changed the version.
@@ -21,11 +21,11 @@ FROM gcr.io/google_appengine/python | |||
|
|||
# Create a virtualenv for the application dependencies. | |||
# # If you want to use Python 3, add the -p python3.4 flag. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should change this comment, since python36 is preselected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I changed it.
Do the docs specify that python 3.6 specifically is used for this sample code? Is there a way we can write it to be a little more version-agnostic, for instance using -p python3 instead of 3.6? |
I confirmed it's ok to do so. |
We do often update versions of dependencies such as Django as part of our maintenance (via bots). Given that, should we change it to -p python3 or do you think it should stay as it is? |
I fixed these issues myself. I also had to make the changes described here https://gist.github.com/morenoh149/39be1ace1f99b9571fd2b6b96098075d I could submit these as a separate PR but may make logical sense to include in this PR |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
CLAs look good, thanks! |
Thanks. I think it's better to change url path settings for django 2. |
lgtm |
@andrewsg , could you check this PR? Editing my comment may have been wrong if you did not notice the PR changing. |
lgtm. Thanks! |
Please check the django 2.0 middleware settings of the official document.
(pip requirements.txt: Django==2.0.3)
https://docs.djangoproject.com/en/2.0/topics/http/middleware/