django press Enter and it show ^M - python

I want to change my models in django
when I execute python manage.py makemigrations ,it asks a question:
Did you rename the demoapp.Myblog model to Blog? [y/N] y^M^M^M
that I input y and press Enter,but it adds ^M to the line
I've looked around and apparently but I've got no choices
can anybody tell me how to fix it?

Better to reset the console frequently.
This is not a big problem but due to multiple terminals being not reset for long durations, such problem occurs.

Apparently, this may happen if your terminal isn't configured correctly, and incorrectly interprets newlines. If you're not running on ubuntu, google for the operating system and/or terminal application you're using, with the term ctrl+m. ^ is often displayed when you press control and some key. I'm not sure about the technical details, buy I often see ^c after stopping an application with CTRL+c.

Related

Spyder - stop consoles accidentally closing

When I use Spyder, I have fairly frequently accidentally closed the wrong consoles. Usually by a cmd+W. Most applications ask if I want to save before close/confirm I definitely want to close. Spyder just closes, so I may lose training that's been occurring for an hour, say, by a single click or keyboard typo, and I cannot find a way to get it to ask before it does close a console.
Anyone know how to fix this?
You could use hist -g in the console to get your history back.
And you could do this:
Tools > Preferences > General > Advanced Settings
check Prompt when exiting

Django changes is not reflecting on the browser

It's my second day of Django and everything seems to be going petty well. Though the installation process is a bit longer, I still find it friendly to get started with. I am currently learning how to pass data to static file from views.py. The problem I am having is that it is only showing the previous changes not the recent. I have hard-refresh but still not working. I don't know how to stop and rerun the server because I don't know how to combine both Ctr + BREAK.
Ctrl + break mean pressing ctrl and alphabet c key at same time it will break the server and if you want to rerun it run the command
python manage.py runserver
There may be issue that you won't Saving your work other then this try force reload CSS file by pressing ctrl+ f5 in browser tab in which Django project is running.It might be helpful.

What does it mean to "restart" a program (in my case IDLE)?

This answer on Stack Overflow offers a solution I am trying to implement. In particular, see the sections "Installation Instructions" and "How to Use".
Can anyone tell me the steps required to "restart" IDLE?
New Information:
Just as people have suggested I thought this simply meant closing the program and opening it back up again...but I already tried that.
The other twist to my situation is that I'm working on a virtual machine so I was unable to do the installation of IDLE2HTML.py myself. My work's Help Desk had to do it so I cannot speak for the accuracy of their work. For now I'm assuming they did it correctly, but when I go to the "Options" menu there is no option to "Save as HTML".
My only guess at this point is that I still need to "restart IDLE".
Just wanted to double check if there was something else I could do before going back to my Help Desk department.
IDLE reads the idlelib/config-xyz.def files, including config-extensions.def, just once, when it starts. So any changes to config-extensions.def only takes effect the next time you start IDLE.
If you do not see 'Save as HTML' after starting IDLE, the extension is not installed properly.
It means you need to close the IDLE so that any changes made by the script can affect the IDLE
Simply close the IDLE either via the X, Ctrl+Q or File>Exit, then open the IDLE again.
If you are using idlelib module from a Python program then close your program and run it again.

PyCharm won't accept code completion on enter

since yesterday PyCharm 2016.3 won't accept selected lines from the list of code completion:
If I hit enter, a new line will be set into the editor rather than the selected line of the popup window. Is there any setting for this behaviour? Until now I couldn't find anything.
I noticed on a few occasions the GUI going somehow off-rails, including in ways similar to the one described. I couldn't determine a pattern in the occurences. Just closing and re-opening the project didn't always help.
What worked pretty reliably for me in the end was exiting PyCharm (giving it ample time to finish), making sure no related java processes remains active (running on Linux, in some cases I had to manually kill such processes when it became clear they're not going away by themselves) and then re-starting the IDE.
I found the current keymap for code completion by chance. This is set via:
Settings > Keymap > Code > Completion > Basic

Aquamacs (on Mac lion): whatever I write i being interpreted as "Enter"

I am editing a python script that I wrote a while ago, using aquamacs on Mac lion.
Whichever letter or number I type is being interpreted as "enter" (that is, I hit "g" for example, my text is dissrupted and a newline appears, but "g" does not appear). Restarting aquamacs, the terminal out of which I run it, or the whole computer did not help.
Other observations (that might or might not be connected):
- The script is located in a folder under Dropbox
- The file has special attributes (that is an "#" appears at the end of the permissions, upon typing ls -lah)
- I might have hit a combination of Control, Apple and other keys that I should not have ....
Any solution to this would be very much appreciated (and my apologies, if that has been treated before).
Thanks!
I also met with this problem recently.
You need to add minor mode Fill. Press on the Python in the mode line in mouse-3 way and choose Auto Fill.

Categories