+ 1

How do I create file urls.py in folder named pages

Folder 'pages' was created by me, so you shouldn't mind the name of it. Could anyone explain how to create urls.py in python if the following command in terminal is not working: $ touch pages/urls.py P.S. I'm working on Windows. Also created and activated virtual environment, for the time being use django framework. Don't know if that's important... Thanks

17th Mar 2022, 4:42 PM
Olexandra Voichenko
13 Antworten
+ 3
Also, what terminal are you using? It seems that windows powershell does not have the touch command. https://www.shellhacks.com/windows-touch-command-equivalent/
17th Mar 2022, 4:52 PM
Simon Sauter
Simon Sauter - avatar
+ 2
I don't know if I am missing something but you can use the pycharm editor directly to create a file?
17th Mar 2022, 5:06 PM
Sandeep
Sandeep - avatar
+ 2
Simon Sauter FF9900 ravilnicki Sandeep thanks everyone, you helped a lot🙏
17th Mar 2022, 6:27 PM
Olexandra Voichenko
+ 2
Bob_Li Sandeep I see, thank you for the tips, I'd look at these
18th Mar 2022, 7:52 AM
Olexandra Voichenko
+ 1
Make sure that the path is available in your virtual environment and that you have writing permissions.
17th Mar 2022, 4:49 PM
Simon Sauter
Simon Sauter - avatar
+ 1
Simon Sauter I've checked the path, and it's available
17th Mar 2022, 4:53 PM
Olexandra Voichenko
+ 1
I don't think bash commands work in a python terminal. Use python commands instead. Like the one mentioned by FF9900 . You could also take a look at the os module.
17th Mar 2022, 4:58 PM
Simon Sauter
Simon Sauter - avatar
+ 1
I rarely use the cmd terminal to create folders and files. It's not like you always have to do it this way. But here is a good reference topic: https://stackoverflow.com/questions/30011267/create-an-empty-file-on-the-commandline-in-windows-like-the-linux-touch-command/37756874#37756874
18th Mar 2022, 2:50 AM
Bob_Li
Bob_Li - avatar
+ 1
You can also try the Hyper terminal. In hyper terminal, you can run Linux commands https://hyper.is/
18th Mar 2022, 3:05 AM
Sandeep
Sandeep - avatar
0
Simon Sauter yeah, I'm using PyCharm terminal
17th Mar 2022, 4:55 PM
Olexandra Voichenko
0
You can install bash on windows if you want. A lot (most?) of "command line" tutorials use bash and not powershell -- sometimes without making this explicit. https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/
17th Mar 2022, 4:55 PM
Simon Sauter
Simon Sauter - avatar
0
FF9900 I'd check this out right away
17th Mar 2022, 4:58 PM
Olexandra Voichenko