Switching from Linux to Windows for development of Django applications

68 views
Skip to first unread message

Some Developer

unread,
Sep 27, 2014, 1:12:46 PM9/27/14
to django...@googlegroups.com
Hi,

For reasons outside of my control I have to switch from Linux to Windows
for Django development and was wondering if any Windows developers had
any tips?

On Linux I make heavy use of pip and virtualenv to make sure that my
packages are kept separate from the system packages. I'm thinking about
moving all my development to Python 3.4 which includes a version of
virtualenv. How does this work on Windows? Do you just install packages
normally using the command line into these environments using pip as you
would on Linux?

I'm also thinking about using PyCharm for my development since I can get
a student license for it which seems like a good deal to me. Does that
also support Python 3.4 virtualenvs?

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.

Thanks in advance.

Avraham Serour

unread,
Sep 27, 2014, 3:19:38 PM9/27/14
to django...@googlegroups.com
are you doing python or windows development?

python development on windows shouldn't be much different, you have virtualenv and the same pycharm

some packages that requires compilation could be a headache, the easier path is to get a binary and use easy_install to install inside the venv



--
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...@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/5426EF5A.2040705%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.

Mike Dewhirst

unread,
Sep 27, 2014, 11:36:36 PM9/27/14
to django...@googlegroups.com
On 28/09/2014 5:18 AM, Avraham Serour wrote:
> some packages that requires compilation could be a headache, the easier
> path is to get a binary and use easy_install to install inside the venv
>

Chris Gohlke is your very best friend ...

http://www.lfd.uci.edu/~gohlke/pythonlibs/

... makes Windows development sustainable.

Mike

Mike Dewhirst

unread,
Sep 28, 2014, 12:04:51 AM9/28/14
to django...@googlegroups.com
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%)


Reply all
Reply to author
Forward
0 new messages