Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#25398 closed Cleanup/optimization (fixed)

Use os.path.join() to construct file paths in docs instead of hardcoding '/'

Reported by: Aaron Owned by: Andrew Artajos
Component: Documentation Version: 1.8
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Maxime Lorant)

It has come to my attention while using the django documentation that several examples and directions specify the use of paths or os.path.join use the default BASE_DIR and a path written like "directory/subDirectory". I think this confuses a number of people who develop on windows platforms because it is actually more ideal to use os.path.join like this:

os.path.join(BASE_DIR, "directory", "subDirectory")

If you change this within your documentation it might help users who are having problems configuring django with various paths in their applications while also understanding the functionality of os.path better.

Change History (10)

comment:1 by Maxime Lorant, 9 years ago

Description: modified (diff)

comment:2 by Moritz Sichert, 9 years ago

I only found one occurrence here. Are there some more you saw that I missed?

comment:3 by Tim Graham, 9 years ago

Easy pickings: set
Summary: Static Files DocumentationUse os.path.join() to construct file paths in docs instead of hardcoding '/'
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:4 by Andrew Artajos, 9 years ago

Owner: changed from nobody to Andrew Artajos
Status: newassigned

comment:5 by Andrew Artajos, 9 years ago

Created a PR 5387 in Github for this.

comment:6 by Andrew Artajos, 9 years ago

Resolution: fixed
Status: assignedclosed

comment:7 by Claude Paroz, 9 years ago

Has patch: set
Resolution: fixed
Status: closednew

Please do not close the ticket as fixed before the patch is committed.

comment:8 by Claude Paroz <claude@…>, 9 years ago

Resolution: fixed
Status: newclosed

In d2ef521a:

Fixed #25398 -- Revised instances of os.path.join()

Replaced occurrences of os.path.join(BASE_DIR, 'folder/subfolder')
to os.path.join(BASE_DIR, 'folder', 'subfolder')

comment:9 by Claude Paroz <claude@…>, 9 years ago

In 0633d228:

[1.9.x] Fixed #25398 -- Revised instances of os.path.join()

Replaced occurrences of os.path.join(BASE_DIR, 'folder/subfolder')
to os.path.join(BASE_DIR, 'folder', 'subfolder')

Backport of d2ef521a53 from master.

comment:10 by Claude Paroz <claude@…>, 9 years ago

In 29c9a7d:

[1.8.x] Fixed #25398 -- Revised instances of os.path.join()

Replaced occurrences of os.path.join(BASE_DIR, 'folder/subfolder')
to os.path.join(BASE_DIR, 'folder', 'subfolder')

Backport of d2ef521a53 from master.

Note: See TracTickets for help on using tickets.
Back to Top