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
manage.py 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

Mike

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

if %1xx==xx (
..\Scripts\python manage.py runserver --settings=ssds.settings.dev
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 manage.py 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 manage.py test --settings=ssds.settings.test --verbosity=1
%apps%

coverage html
)

goto end

:syncdb

..\Scripts\python manage.py syncdb


goto end

:dumpdata

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

..\Scripts\python manage.py 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%

:end

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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/542788C5.7020805%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment