开发者

How to deal with symbolic links when going between Linux and Windows?

I have a django project that runs on a Linux server, and I've been working on it both on Linux and OS X. I've noticed that some of the pages are a bit off, to put it politely, in Internet Explorer, and so I checked out the subversion repository on Windows and tried to run a local server.

My media directory has symbolic links to all of the media from each different app, and obviously Windows doesn't know what to do with them. I could simply hard-copy or link everything manually in Windows, but then I wouldn't开发者_高级运维 be able to check that in (since the site runs on a Linux server), so it'd be a pain in the neck.

What is typically done in this case?


Set up a configuration using httpd and mod_wsgi that has appropriate Alias directives for the static media.


you could also add some static.serve links in your urls.py for debugging purpose :

if settings.DEBUG:
    urlpatterns += patterns('',
        (r'^static/(?P<path>.*)/?$', 'django.views.static.serve', {'document_root':settings.MEDIA_ROOT, 'show_indexes':True})
)

quicker than setting up apache+friends on win32.


Instead, of running a server on Windows just to test for IE, you can run a server from on an IP that identifies your machine on your network. Just run

python manage.py runserver ad.dr.re.ss:8000

To find the (local) address of your machine, access your router logs to see who's connected (I'm sure there's a better way, but this worked for me).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜