nickjj / docker-django-example

A production ready example Django app that's using Docker and Docker Compose.
MIT License
1.17k stars 249 forks source link

Update README.md #31

Closed RobSisson closed 9 months ago

RobSisson commented 1 year ago

Adding a note to help windows users to avoid install an error, as detailed here: https://stackoverflow.com/questions/29045140/env-bash-r-no-such-file-or-directory

nickjj commented 1 year ago

Hi,

Thanks for the suggestion but I'm not sure if it's worth documenting non-WSL Windows support in that much detail since the run script is a shell script. Basically it's kind of expected you'll be using WSL, macOS or native Linux to use this project in its intended way.

Your proposed git command will work but you'll also want to configure your code editor to write files with Unix (lf) line endings instead of Windows (crlf) line endings or you may run into similar issues. Doing both of those things might be a conflict of interest for a primary Windows developer since your other projects won't want git and your code editor configured that way -- only this project.

Going over all of that takes up prime space in the README file for a potentially small subset of users.

I'm open to maybe including 1 sentence under "Did you receive a permission denied error" in the README in its own paragraph if we can include all of that context in 2 lines of documentation.

RobSisson commented 1 year ago

Gotcha, totally understand - it was my mistake when installing it tbh as I opened the wsl following the git clone and so the issue still arose, and thought it could help other new people like me.

Thanks for sharing the perspective of saving space, its a really good point and since I'm new to contributing to gits and doing readme's I appreciate the learning! In line with this, I've tried to do one better than its own paragraph and shorten it further making it less than a line by extending the sentence which you already wrote about editing for powershell and just linking to the SO thread.

Hope that's okay - if not, let me know and I'll adjust it inline with your previous suggestion.

Also, mad love for your work on this, as well as your support for Hotwire. I was inspired to choose the Turbo/Stimulus package over HTMX/Alpine due to seeing your podcast site on a forum in a related thread. I'm going to attempt to get Hotwire working with your repo over the next few days and have some questions which I'll ask in a separate thread.

I've also signed up for your deploy to production course; looking forward to it!

nickjj commented 1 year ago

Thanks for the kind words.

By the way I just released a video today creating a dropdown menu with Stimulus at https://nickjanetakis.com/blog/a-dropdown-menu-using-stimulus-and-tailwindcss-with-escape-key-support and the example Rails app https://github.com/nickjj/docker-rails-example has Stimulus built in by default. You can copy that directly to this Django app since it's all front-end related integration.

I think we can still tweak the location and wording of this Windows message, I'll get back to you by tomorrow on that.

nickjj commented 1 year ago

Hi,

I do think we should place this near the other sentences under the up command that would cause the error.

It could look something like this:


...

Now that everything is built and running we can treat it like any other Django app.

Did you receive an error about a port being in use? Chances are it's because something on your machine is already running on port 8000. Check out the docs in the .env file for the DOCKER_WEB_PORT_FORWARD variable to fix this.

Did you receive a permission denied error? Chances are you're running native Linux and your uid:gid aren't 1000:1000 (you can verify this by running id). Check out the docs in the .env file to customize the UID and GID variables to fix this.

On Windows (PowerShell) and received a "bash no such file or directory error"? You'll need to configure git and your code editor to use Unix (LF) line endings instead of Windows (CRLF) line endings. I'd suggest using WSL 2 instead too.


But I'm still on the fence on adding this since using PowerShell will also result in not being able to use the run script, hmm.

RobSisson commented 1 year ago

Sorry for being MIA for a while - been absorbed in other things.

Really good point, I've been struggling with the run script a lot, and eventually just decided to run the system on DigitalOcean droplet so I don't face the issues - still working to get it going though. Perhaps instead further highlighting the importance of not using windows earlier on could be useful?

Let me know if I need to do anything additional with this!

nickjj commented 9 months ago

Sorry for not replying in a year, I think I missed the notification.

As for using Windows, if you use WSL 2 you'll be good to go with the run script since it's a proper Linux environment. It's how I do all of my development on Windows.

With that said I think we can close this since there is a path forward on Windows and suggesting to use PowerShell will result in future compatibility issues.