Opened 3 years ago

Closed 3 years ago

#72 closed defect (fixed)

Installation error using custom setting.MEDIA_URL

Reported by: myitchychin Owned by: somebody
Priority: minor Milestone:
Component: Themes Version: devel
Keywords: installation Cc:
Blocked By: Blocking:

Description

In ./djangobb_forum/models.py line 46, the code uses settings.MEDIA_URL instead of settings.MEDIA_ROOT.

It is also using a simple concatenation instead of using os.path.join which causes an error in Windows based operating systems where paths use back slashes and not forward slashes.


G:\Websites\mysite.com\djangobb>python manage.py syncdb
Traceback (most recent call last):

File "manage.py", line 11, in <module>

execute_manager(settings)

File "F:\Program Files\Python26\lib\site-packages\django\core\management\init.py", line 362, in execute_manager

utility.execute()

File "F:\Program Files\Python26\lib\site-packages\django\core\management\init.py", line 303, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)

File "F:\Program Files\Python26\lib\site-packages\django\core\management\base.py", line 195, in run_from_argv

self.execute(*args, options.dict)

File "F:\Program Files\Python26\lib\site-packages\django\core\management\base.py", line 213, in execute

translation.activate('en-us')

File "F:\Program Files\Python26\lib\site-packages\django\utils\translation\init.py", line 73, in activate

return real_activate(language)

File "F:\Program Files\Python26\lib\site-packages\django\utils\translation\init.py", line 43, in delayed_loader

return g% caller?(*args, kwargs)

File "F:\Program Files\Python26\lib\site-packages\django\utils\translation\trans_real.py", line 205, in activate

_active[currentThread()] = translation(language)

File "F:\Program Files\Python26\lib\site-packages\django\utils\translation\trans_real.py", line 194, in translation

default_translation = _fetch(settings.LANGUAGE_CODE)

File "F:\Program Files\Python26\lib\site-packages\django\utils\translation\trans_real.py", line 180, in _fetch

app = import_module(appname)

File "F:\Program Files\Python26\lib\site-packages\django\utils\importlib.py",line 35, in import_module

import(name)

File "G:\Websites\mysite.com\djangobb\djangobb_forum\init.py", line 1, in <module>

import signals

File "G:\Websites\mysite.com\djangobb\djangobb_forum\signals.py", line 6, in <module>

from djangobb_forum.models import Topic, Post, PrivateMessage?

File "G:\Websites\mysite.com\djangobb\djangobb_forum\models.py", line 46, in <module>

THEME_CHOICES = [(theme, theme) for theme in os.listdir(path)

WindowsError?: [Error 123] The filename, directory name, or volume label syntax is incorrect: 'G:
Websites
mysite.com
djangobbhttp://static.mysite.com/resources/forum/forum/themes/*.*'

Change History (2)

comment:1 Changed 3 years ago by myitchychin

The correct code for line 46 should be...

path = os.path.join(settings.PROJECT_ROOT, settings.MEDIA_ROOT, 'forum', 'themes')

comment:2 Changed 3 years ago by slav0nic

  • Resolution set to fixed
  • Status changed from new to closed

tnx, fixed
we need more betatesters with windows :P
[226]

Note: See TracTickets for help on using tickets.