So, I’m a beginner trying to learn django right now with “Practical Django Projects” with windows in eclipse pydev.
Anyways, main issue is I use windows and it seems to suggest I should use front slash in the comments for settings.py. But by default, the databases is already set to:
'NAME': 'C:\\Users\\dtc\\Documents\\Eclipse\\cms\\sqlite.db'
And while I was going through the book, it wants me to add this:
url(r'^tiny_mce/(?P<path>.*)$', 'django.views.static.serve',
{ 'document_root': '/path/to/tiny_mce/' }),
But that path didn’t work until I changed to double backslash \\path\\to\\…so I’m thinking I should just not worry about using double backslash.
It would be great if someone gave me a little insight on this because it’s giving me a total headache while trying to learn django.
Use python to get current directory and call a join on it with whatever you need to add. This will make it cross platform as python will take care of converting backslashes and forward slashes for you.
That will save you on typing and the path will be correct. If you look in settings.py that django generates it will tell you to always use / even on Windows.
One last thing, your urls should use forward slashes because that is how django is going to use them.
Hope that helps