At first be sure that you are using this path to run pure apache: http://trianglesis.org.ua/django-python-3-4-wamp-apache-2-4-23-pycharm
This topic for those who wants to develop ON THE FLY with python and django and do not want to manually restart dev server each time when code changes AND you don’t like built in python web-server and want to run your dev site as it should run on apache.
Sublime Text 3
I use it for fast code changing and writting because PyCharm can’t work fine with multiline carrets, for example. Also PyCharm is too heavy when you want just copy&paste some features and see how it work on web. So my PyCharm will be used for debug purposes.
I hope you know what is the “Build system” in Sublime, if no – read this first: http://sublimetext.info/docs/en/reference/build_systems.html
- Should run Sublime text 3 “as Administrator”
- You can run it once with Shift + Left mouse
- You can switch settings on sublime_text.exe (Compatibilities -> Always run as Admin.)
- Then in Sublime: Tools -> Build System -> New Build System
- In opened file just copy&pase my example content
- Change paths to your programms: Chrome, IE etc…
- Save file with name like Apache.sublime-build
- Create .bat files from my examples
- Place it where you want
- Changes paths in build file to correspond bat file for each option you want
- Use simply with Ctrl + Shift + P type “name” of your build option.
If there is no Build system (Apache in my example) added in list: Tools -> Build System – it happened because build file is not in place:
- C:\Users\Username\AppData\Roaming\Sublime Text 3\Packages\User\Apache.sublime-build
If Build system is in the list, but not in console (Ctrl + Shift + P -> Build With Apache…) – it means that build file has a syntax error, check every bracket and comma from my example.
I have different options for build:
- Can restart apache – only from cmd with Sublime
- Can restart apache via .bat with Sublime
- Can restart apache via .bat AND open http://adress in web-browser
- restarting apache and open link can be used via bat only, I did no found the way to open it in sublime-build options
So, when you compose .bat file for open address after apache restarted – use command-line args in bat:
And then add this args (url paths) to build option:
When everything is fine – after you choose any build option – Apache will be restarted and web-browser will open page you want.