Tuesday, 15 September 2015

python - Heroku django "OSError: [Errno 2] No such file or directory: '/static/static'" -


I'm new to Django and Heroko. It's an error when I happen to have some of my Git repository. Suggest that I need to change Thank you in advance

(website) C: \ user \ website \ src> Haroko Run Dragon management and collect - Noinput is running Dragon management. Py collectstatic --noinput for attached terminal ... top, run 16 9 0

  trace Track (most recent call last): File "manage.py", line 10, & lt; Module & gt; Execute_from_command_line (sys.argv) file "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__ .py", line 385, in the execute_from_command_line utility. Execute () file "/ app / .heroku / python / lib / python2.7 / site-packages / django / core / management / __init__ .py", line 377, in self.fetch_command (sub command) .run_from_argv (self .argv) file "/ app /.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 288, run_from_argv in self.execute (* args, ** option. __ dict__ file "/ app / .exe output = self.handle (* args, ** option) file" / app / / / Python / lib / python2.7 / site-packages / django / core / management / base.py ", line 338 hello / python / lib / python 2.7 / site-package / django / core / management / bases", line 533 , Handle returns self Handley_Nogs (** Options) file "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 168, handle_noraj collected = self. Collect () file "/app/.heroku/py Thon / lib / python2.7 / site-packages / django / contrib / staticfiles / management / command / collectstatic.py", line 98, path to find, finder. List in storage (self.ignore_patterns): file "/ app / .heroku /python/lib/python2.7/site-packages/django/contrib/staticfiles/finders.py", for paths in line 111, utils.get_files List (storage, unselected_pattern): file "/ app / .oroku / python / lib / python2.7 / site-packages / django / contrib / staticfiles / utils.py", line 27, get_files In directory, files = store.listdir (location) file "/app/.heroku/python/" for listing in OSILDR (path) in listdir, lib / python2.7 / site-packages / django / core / files / storage. Py ", line 270, OSError: [Error 2] There is no such file or directory: '/ static / static'  

settings.py

  STATIC_URL = '/ static /' # Template Location TEMPLATE_DIRS = (os.path.join (os.path) .dirname (BASE_DIR), "static", "templates"),) DEBUG: MEDIA_URL = '/ media /' STATIC_ROOT = Os.path.join (os.path.dirname (BASE_DIR), "st tick", "static-only") MEDIA_ROOT = os.path.join (os.path.dirname (BASE_DIR), "static", "media ") STATICFILES_DIRS = (Os.path.join (os.path.dirname (BASE_DIR), "static", "static"),)  

Currently, it seems that the error is a directory from STATICFILES_DIRS var point that does not exist:

  STATICFILES_DIRS = (os.path.join (os) .path.dirname (BASE_DIR), "static", "static")  

Visit your DNS project directory, find the static repository and focus on the entire space. After this, edit the STATICFILES_DIRS variable in settings.py shetat it points to this location.

For me (which does not mean that it should be similar to you), it looks like:

  STATICFILES_DIRS = (os.path.join (BASE_DIR, ../myapp/static '),)  

No comments:

Post a Comment