Skip to content
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

Django: Add ZSH info for setting up dev environment #4662

Merged
merged 4 commits into from May 4, 2021

Conversation

hamishwillee
Copy link
Collaborator

https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/development_environment

MacOS Catalina and later use the ZSH shell by default, which uses the .zshrc file as a startup. The main change here is to mention the location of this startup file and that you may need to either set .bashrc or .zshrc. I don't have a mac so I have made the ASSUMPTION that the commands you add to the file are the same, and that it is sourced in the same way.

This also fixes up some mis-use of spans in pre blocks and other minor tidy.

@CreaTorAlexander can you please sanity check?

Issue number (if there is an associated issue)

Fixes #2688

@hamishwillee hamishwillee requested a review from a team May 3, 2021 04:01
@hamishwillee hamishwillee added the Content:Learn:Django Learning area Django docs label May 3, 2021
@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2021

Python 3.9.0</span>
</pre>
<pre class="brush: bash">python3 -V
Python 3.9.0</pre>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.9.4 is the latest point release.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I am not going to update this to latest version without re-testing the whole tutorial. I tend to do that once every 6- 12 months. So please ignore for now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me. Just wanted to highlight it. I'm wondering, if I were to do that today, whether I'd get the newer version (and thus, a note might be helpful to not confuse beginners).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will think on this, and perhaps address in the next update. I don't disagree.

@@ -262,7 +258,8 @@ <h4 id="macOS_virtual_environment_setup">macOS virtual environment setup</h4>

<pre class="brush: bash">sudo pip3 install virtualenvwrapper</pre>

<p>Then add the following lines to the end of your shell startup file.</p>
<p>Then add the following lines to the end of your shell startup file (these are the same lines as for Ubuntu).
If you're using the <em>zsh shell</em> then the startup file will be a hidden file named <strong>.zshrc</strong> in your home directory. If you're using the <em>bash shell</em> then it will be a hidden file named <strong>.bash_profile</strong>. You may need to create the file if it does not yet exist.</p>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a .bashrc as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even on mac? Either way, I plan only to mention .bash_profile because that is what was tested when this was done.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on Sabayon Linux :-)
We have all sorts of shells available.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're a sick sick man :-). We have to draw the line somewhere - this is an 80/20 rule - most people will use the default shell on the most popular distributions. Those that don't are probably experienced enough to know how their shell works.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would most likely be the bash on Linux systems (I'm not quite sure, whether Ubuntu uses the dash).

hamishwillee and others added 2 commits May 4, 2021 09:08
…ndex.html

Co-authored-by: André Jaenisch <Ryuno-Ki@users.noreply.github.com>
…ndex.html

Co-authored-by: André Jaenisch <Ryuno-Ki@users.noreply.github.com>
@hamishwillee
Copy link
Collaborator Author

Thanks for review @Ryuno-Ki . I've merged your suggestions. Left the Python versions alone though - I will do a thorough update of the whole tutorial at some point along with all dependencies. I don't change the Python version when I do spot fixes to the docs.

Copy link
Collaborator

@Ryuno-Ki Ryuno-Ki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes will be an improvement, so let's get them in!

@Ryuno-Ki Ryuno-Ki merged commit 6d3886b into mdn:main May 4, 2021
@Ryuno-Ki
Copy link
Collaborator

Ryuno-Ki commented May 4, 2021

Thank you for writing an update, @hamishwillee

@hamishwillee hamishwillee deleted the django_zshrc branch May 4, 2021 22:21
@hamishwillee
Copy link
Collaborator Author

thanks for the review!

@ddbeck ddbeck added Content:Learn Learning area docs and removed Content:Learn:Django Learning area Django docs labels Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Learn Learning area docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Django virtual environment set up .zshrc not mentioned
3 participants