Я развернул проект django (1.7) в pythonanywhere и его ссылка is http://drchitradhawle.pythonanywhere.com/ Я предполагаю, что есть проблема со статическим связыванием файлов и bootstrap.Plz кто-нибудь поможет мне сортировать вне проблемы также сообщите мне всю процедуру, чтобы связать любой статический файл и загрузочный файл в проекте django.Ошибка в связывании статических файлов в проекте django, развернутом на pythonanywhere
Моя структура проекта -
home
-DrChitraDhawle
-website
-webpage
-static
-css
-images
-templates
-website
-settings.py
settings.py файл -
STATIC_ROOT = "/home/DrChitraDhawle/website/webpage/static"
STATIC_URL = '/static/'
STATICFILES_DIR = (
('assets', '/home/DrChitraDhawle/website/webpage'),
)
#
#STATICFILES_DIR = [os.path.join(BASE_DIR, '')]
Ссылка статического набора файлов в веб-вкладке есть -
И я использовал его в своей программе, -
{% load staticfiles %}
<link rel="stylesheet" type="text/css" href="{% static 'webpage/bootstrap.min.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'webpage/style.css' %}" />
<!DOCTYPE html>
<html lang="en">
<head>
<title>Dr.Chitra Webpage</title>
.
.
.
журнал ошибок на питоне нигде - журнал
2015-03-08 16:09:52,766 :django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
2015-03-08 16:09:53,926 :Traceback (most recent call last):
2015-03-08 16:09:53,926 : File "/bin/user_wsgi_wrapper.py", line 130, in __call__
2015-03-08 16:09:53,926 : self.error_log_file.logger.exception("Error running WSGI application")
2015-03-08 16:09:53,926 : File "/usr/lib/python2.7/logging/__init__.py", line 1185, in exception
2015-03-08 16:09:53,926 : self.error(msg, *args, **kwargs)
2015-03-08 16:09:53,927 : File "/usr/lib/python2.7/logging/__init__.py", line 1178, in error
2015-03-08 16:09:53,927 : self._log(ERROR, msg, args, **kwargs)
2015-03-08 16:09:53,927 : File "/usr/lib/python2.7/logging/__init__.py", line 1270, in _log
2015-03-08 16:09:53,928 : record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra)
2015-03-08 16:09:53,928 : File "/usr/lib/python2.7/logging/__init__.py", line 1244, in makeRecord
2015-03-08 16:09:53,928 : rv = LogRecord(name, level, fn, lno, msg, args, exc_info, func)
2015-03-08 16:09:53,928 : File "/usr/lib/python2.7/logging/__init__.py", line 284, in __init__
2015-03-08 16:09:53,928 : self.threadName = threading.current_thread().name
2015-03-08 16:09:53,928 : File "/usr/lib/python2.7/threading.py", line 1160, in currentThread
2015-03-08 16:09:53,929 : return _active[_get_ident()]
2015-03-08 16:09:53,929 : File "/bin/user_wsgi_wrapper.py", line 122, in __call__
2015-03-08 16:09:53,929 : app_iterator = self.app(environ, start_response)
2015-03-08 16:09:53,929 : File "/bin/user_wsgi_wrapper.py", line 136, in import_error_application
2015-03-08 16:09:53,929 : raise e
2015-03-08 16:09:53,929 :django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
Access -
78.12.109.13 - - [09/Mar/2015:10:55:39 +0000] "GET /static/webpage/images/chitraMam.jpg HTTP/1.1" 404 1165 "http://drchitradhawle.pythonanywhere.com/" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.76 Safari/537.36" "78.12.109.13"
78.12.109.13 - - [09/Mar/2015:10:55:40 +0000] "GET /favicon.ico HTTP/1.1" 404 1150 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.76 Safari/537.36" "78.12.109.13"
78.12.109.13 - - [09/Mar/2015:10:55:43 +0000] "GET /static/webpage/bootstrap.min.css HTTP/1.1" 404 1164 "http://drchitradhawle.pythonanywhere.com/" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.76 Safari/537.36" "78.12.109.13"
78.12.109.13 - - [09/Mar/2015:10:55:43 +0000] "GET /static/webpage/style.css HTTP/1.1" 404 1154 "http://drchitradhawle.pythonanywhere.com/" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.76 Safari/537.36" "78.12.109.13"
78.12.109.13 - - [09/Mar/2015:10:55:56 +0000] "GET /static HTTP/1.1" 404 1148 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.76 Safari/537.36" "78.12.109.13"
78.12.109.13 - - [09/Mar/2015:10:55:58 +0000] "GET /static/ HTTP/1.1" 404 1149 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.76 Safari/537.36" "78.12.109.13"
78.12.109.13 - - [09/Mar/2015:10:56:03 +0000] "GET /static/webpage/ HTTP/1.1" 404 1151 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.76 Safari/537.36" "78.12.109.13"
14.139.240.226 - - [09/Mar/2015:11:04:16 +0000] "GET /webpage/research/ HTTP/1.1" 200 1615 "http://drchitradhawle.pythonanywhere.com/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0" "14.139.240.226"
14.139.240.226 - - [09/Mar/2015:11:04:17 +0000] "GET /static/webpage/bootstrap.min.css HTTP/1.1" 404 1164 "http://drchitradhawle.pythonanywhere.com/webpage/research/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0" "14.139.240.226"
14.139.240.226 - - [09/Mar/2015:11:04:17 +0000] "GET /static/webpage/style.css HTTP/1.1" 404 1154 "http://drchitradhawle.pythonanywhere.com/webpage/research/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0" "14.139.240.226"
14.139.240.226 - - [09/Mar/2015:11:04:18 +0000] "GET /static/webpage/style.css HTTP/1.1" 404 1154 "http://drchitradhawle.pythonanywhere.com/webpage/research/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0" "14.139.240.226"
14.139.240.226 - - [09/Mar/2015:11:04:18 +0000] "GET /static/webpage/bootstrap.min.css HTTP/1.1" 404 1164 "http://drchitradhawle.pythonanywhere.com/webpage/research/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0" "14.139.240.226"
Спасибо за ваш ответ, Но теперь я застрял в какой-то другой проблеме -Настройка неправильно настроена. Пожалуйста, попробуйте решить его, чтобы я мог продолжить то, что вы мне сказали. http://stackoverflow.com/questions/28947354/i-have-deployed-my-django-project-in-pythonanywhere-databases-is-improperly-con –