Saturday, September 27, 2014

Re: Switching from Linux to Windows for development of Django applications

On 28/09/2014 3:09 AM, Some Developer wrote:
> If anyone can post information on their Windows development work flows
> I'd be very grateful since I'm pretty new to Windows development work.

* This goes against Microsoft recommendations but I install Python2.x
and Python3.x in the root of drive C: so I'm not forced to use a
admin-privileged cmd shell.

* I put the following dirs on the Windows path ...

C:\Users\mike\bin and C:\Users\mike\bat

* I write batch files rather than virtualenvwrapper because it wasn't
available to me when I started using virtualenv.

* My favourite batch file in development is run.bat which launches in various guises ... see below

* I use subversion running on my Ubuntu staging server plus buildbot on
the same machine. When I commit changes to the repo, buildbot blows the
staging site away completely and starts again from scratch and runs all
the tests. I know its not git but I like it.

* I use a plain text editor with syntax highlighting because I haven't
installed Pycharm. I've downloaded it but haven't had time to think
about it. I should.

Good luck


# run.bat
@echo off
echo .
echo .
echo .
echo Should be running in virtualenv
echo .
echo .
echo .

if %1xx==xx (
..\Scripts\python runserver
goto end

if %2xx==xx (
set apps=common company refer substance workplace
) else (
set apps=%2

if %1==dumpdata (
set file=%2
goto dumpdata

if %1==syncdb (
set file=%2
goto syncdb

if %1==test (

copy substance\fixtures\test_data.json
substance\fixtures\initial_data.json /Y

..\Scripts\python test --settings=ssds.settings.test
--verbosity=1 %apps%


if %1==cover (

copy substance\fixtures\test_data.json
substance\fixtures\initial_data.json /Y

coverage run test --settings=ssds.settings.test --verbosity=1

coverage html

goto end


..\Scripts\python syncdb

goto end


if %2xx==xx set file=fixtures\initial_data-x.json

..\Scripts\python dumpdata --settings=ssds.settings.production
--indent=2 --verbosity=0 --natural --exclude=contenttypes
--exclude=auth.permission --exclude=admin.logentry
--exclude=sessions.session --exclude=company.userprofile <snip my
project tables>...</snip> --exclude=south.migrationhistory > %file%


set json=fixtures\initial_data.json

if exist %json% (del %json%)

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment