This usually happens if you $ python manage.py runserver 8000 and then don’t stop the server by hitting Cntrl+C but hit something like Cntrl+Z instead.
To stop the server on port 8000 so that you can run another instance again you can do the following..
Run the below command to list all your processes with ‘manage’ in their name.
$ ps aux | grep -i manage
Note the process_id (pid) for our “manage.py runserver” process which should be the second column from the left.
And then simply run
$ kill -9 <pid>
e.g. $ kill -9 30144
You can get stable version of Django Suit by using pip or easy_install:
pip install django-suit==0.2.15
You will need to add the
'suit' application to the
INSTALLED_APPS setting of your Django project
INSTALLED_APPS = (
'suit' must be added before
'django.contrib.admin' and if you are using third-party apps with special admin support (like django-cms) you also need to add
You also need to add
TEMPLATE_CONTEXT_PROCESSORS setting in your Django project
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
TEMPLATE_CONTEXT_PROCESSORS = TCP + (
Note: This is required to handle left side menu. If by some reason you removed original Django Suit
menu.html, you can skip this.
Filed under Django, Python
This little sucker happens because Apple doesn’t love http anymore, they love https. But also not to make developers angry, they made it configurable. One can find it easily by googling it for a 5 seconds.
Here’s a screenshot from stackoverflow:
this is how you do it
I had mentioned two different approaches at first post on this subject (https://timuraykutyildirim.wordpress.com/2015/01/15/how-to-run-bash-scripts-within-python/)
And once again first approach proved it’s worthy of knowing. This is how i searched string in a directory:
myString = str(raw_input('search key: '))
myCommand= 'grep -rl "' + myString +'" /Users/timuryildirim/Desktop/fortuna'
#result = subprocess.check_output([command])
It may look like a little thing that may not even worth to write on my blog but this little stuff just saved me tons of time and a huge panic attack while i was working on coding some http requests for a iPhone app. So here it is:
var newsParam = "Aston Martin"
var convertedNewsParam = newsParam.stringByReplacingOccurrencesOfString(" ", withString: "%20")
var webservicePath = "http://xx.xx.xx.xx:yy/myWebService?search_text=\(convertedNewsParam)"
Some may say, “Why don’t you request by using id?”. That’s what i said my colleagues but their code was working this way and they didn’t want to change it since it’s working. So, when i just copy-pasted url to Postman with request parameter as “Aston Martin” it was working fine but it was giving me this error message: fatal error: unexpectedly found nil while unwrapping an Optional value
But when i changed space charater to it’s html equivalent (which is “%20” as you see from the code) and change my request parameter to Aston%20Martin it sets us free from that fatal error.
*note: i tested this only on Photoshop
Just follow these steps:
- Close Photoshop or whatever you’ve opened
- Go to Finder > Preferences and check first checkbox (Show all filename extensions) and close the window
- Go to Finder > File > New File Window then select Applications
- Go to Adobe Photoshop CC > Locales > tr_TR > Support Files
- Rename the extension of .dat file to .bak
That should do the trick. Now when you opened your photoshop, it should be using English language
Sometimes you may have to display a view with an element that you cannot or should not create an outlet with it. In that occasions, this is what you need:
let vc : AnyObject! = self.storyboard?.instantiateViewControllerWithIdentifier("myTargetViewController")
self.showViewController(vc as UIViewController, sender: vc)
But in order to make this thing work; Open your storyboard, display Identity Inspector at right pan of your Xcode and copy “myTargetViewController” to that view controller’s Storyboard ID. That should do the trick😉
First of all, chmod is not the answer.
- sudo nano /etc/fstab
- Write “LABEL=drivename none ntfs rw,auto,nobrowse” in fstab
- kntrl-O & kntrl-X shotcuts will write and save your changes
- Unmount your drive from Mac
- Unplug your drive from Mac
- Plug your drive back in
- Within Finder’s menu bar, click “Go to Folder”
- Type /Volumes in “Go to Folder” screen. This will display all drives whether they’re available or not
- Drag your drive into Favourites, left of current Finder screen.
This is how you do it.
If have an error message like “ERROR: Cannot start PyCharm No JDK found. Please validate either PYCHARM_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.” while trying to install pycharm on ubuntu, this how you fix it:
sudo apt-get purge openjdk*
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Filed under Python, Ubuntu
There are 2 different approaches:
Some say first approach is deprecated but i think they haven’t faced any problem when all you need is a single line command to run within different parameters. So, in my opinion each one has it’s own advantage.