diff --git a/README.md b/README.md index 0c392ed..0cc3efa 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Django音乐平台 +# Django音乐平台(项目文件位于src文件夹中) 一个基于Django框架开发的完整在线音乐播放系统,提供音乐播放、用户管理、评论互动、搜索推荐等完整功能。 @@ -322,11 +322,11 @@ CMD ["uwsgi", "--ini", "uwsgi.ini"] ## 👥 开发团队 -- **陈涵** - 项目架构设计 -- **蔡耀宇** - 核心功能开发 -- **郭旭斌** - 用户系统开发 -- **张奥琦** - 前端界面设计 -- **薛永宇** - 测试和文档 +- **HANJUN** - 项目架构设计 +- **HANJUN** - 核心功能开发 +- **HANJUN** - 用户系统开发 +- **HANJUN** - 前端界面设计 +- **HANJUN** - 测试和文档 ## 📞 技术支持 @@ -338,6 +338,6 @@ CMD ["uwsgi", "--ini", "uwsgi.ini"] --- -**项目测试&主要二次开发**陈涵 +**项目测试&主要二次开发**HANJUN **最后更新**: 2025年11月 **版本**: v1.0.0 \ No newline at end of file diff --git a/src/comment/__pycache__/__init__.cpython-311.pyc b/src/comment/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..d54d913 Binary files /dev/null and b/src/comment/__pycache__/__init__.cpython-311.pyc differ diff --git a/src/comment/__pycache__/admin.cpython-311.pyc b/src/comment/__pycache__/admin.cpython-311.pyc new file mode 100644 index 0000000..2ec24d7 Binary files /dev/null and b/src/comment/__pycache__/admin.cpython-311.pyc differ diff --git a/src/comment/__pycache__/models.cpython-311.pyc b/src/comment/__pycache__/models.cpython-311.pyc new file mode 100644 index 0000000..55ed2df Binary files /dev/null and b/src/comment/__pycache__/models.cpython-311.pyc differ diff --git a/src/comment/__pycache__/urls.cpython-311.pyc b/src/comment/__pycache__/urls.cpython-311.pyc new file mode 100644 index 0000000..dab13c3 Binary files /dev/null and b/src/comment/__pycache__/urls.cpython-311.pyc differ diff --git a/src/comment/__pycache__/views.cpython-311.pyc b/src/comment/__pycache__/views.cpython-311.pyc new file mode 100644 index 0000000..75f080e Binary files /dev/null and b/src/comment/__pycache__/views.cpython-311.pyc differ diff --git a/src/comment/migrations/__pycache__/__init__.cpython-311.pyc b/src/comment/migrations/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..92a4292 Binary files /dev/null and b/src/comment/migrations/__pycache__/__init__.cpython-311.pyc differ diff --git a/src/create_sample_data.py b/src/create_sample_data.py index fde5b72..3a0d0ac 100644 --- a/src/create_sample_data.py +++ b/src/create_sample_data.py @@ -1,78 +1,84 @@ -# 在项目根目录创建 create_sample_data.py 文件 +# create_music_data.py import os import django +from django.core.files import File os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'music.settings') django.setup() from index.models import Label, Song, Dynamic -def create_sample_data(): - # 创建音乐分类 - pop_label, created = Label.objects.get_or_create(label_name='流行音乐') - rock_label, created = Label.objects.get_or_create(label_name='摇滚音乐') - classical_label, created = Label.objects.get_or_create(label_name='古典音乐') +def import_local_music(): + # 基础路径 + base_dir = r'C:\Users\27300\text\src\static' - # 创建示例歌曲 - sample_songs = [ - { - 'song_name': '示例歌曲1', - 'song_singer': '示例歌手1', - 'song_time': '03:45', - 'song_album': '示例专辑1', - 'song_languages': '中文', - 'song_company': '示例唱片公司', - 'song_release': '2023-01-01', - 'song_img': 'default.jpg', - 'song_lyrics': '暂无歌词', - 'song_file': 'sample1.mp3', - 'label': pop_label - }, - { - 'song_name': '示例歌曲2', - 'song_singer': '示例歌手2', - 'song_time': '04:20', - 'song_album': '示例专辑2', - 'song_languages': '英文', - 'song_company': '示例唱片公司', - 'song_release': '2023-02-01', - 'song_img': 'default.jpg', - 'song_lyrics': '暂无歌词', - 'song_file': 'sample2.mp3', - 'label': rock_label - }, - { - 'song_name': '示例歌曲3', - 'song_singer': '示例歌手3', - 'song_time': '05:15', - 'song_album': '示例专辑3', - 'song_languages': '纯音乐', - 'song_company': '示例唱片公司', - 'song_release': '2023-03-01', - 'song_img': 'default.jpg', - 'song_lyrics': '暂无歌词', - 'song_file': 'sample3.mp3', - 'label': classical_label - } - ] + # 获取现有的音乐文件 + song_files_dir = os.path.join(base_dir, 'songFile') + song_img_dir = os.path.join(base_dir, 'songImg') + song_lyric_dir = os.path.join(base_dir, 'songLyric') - for song_data in sample_songs: + # 检查目录是否存在 + if not os.path.exists(song_files_dir): + print(f"歌曲文件目录不存在: {song_files_dir}") + return + + # 创建默认分类 + pop_label, _ = Label.objects.get_or_create(label_name='流行音乐') + + # 获取所有音乐文件 + music_files = [f for f in os.listdir(song_files_dir) if f.endswith('.mp3')] + + print(f"找到 {len(music_files)} 个音乐文件") + + for music_file in music_files: + # 从文件名提取歌曲信息(假设文件名为 "歌手 - 歌曲名.mp3") + filename = os.path.splitext(music_file)[0] + if ' - ' in filename: + singer, song_name = filename.split(' - ', 1) + else: + singer = '未知歌手' + song_name = filename + + # 检查对应的图片和歌词文件 + img_file = f"{os.path.splitext(music_file)[0]}.jpg" + lyric_file = f"{os.path.splitext(music_file)[0]}.txt" + + song_img_path = os.path.join(song_img_dir, img_file) if os.path.exists(os.path.join(song_img_dir, img_file)) else 'default.jpg' + song_lyric_path = os.path.join(song_lyric_dir, lyric_file) if os.path.exists(os.path.join(song_lyric_dir, lyric_file)) else '暂无歌词' + + # 只保存文件名,不保存完整路径 + song_img = os.path.basename(song_img_path) if song_img_path != 'default.jpg' else 'default.jpg' + song_lyric = os.path.basename(song_lyric_path) if song_lyric_path != '暂无歌词' else '暂无歌词' + + # 创建或更新歌曲记录 song, created = Song.objects.get_or_create( - song_name=song_data['song_name'], - defaults=song_data + song_name=song_name, + defaults={ + 'song_singer': singer, + 'song_time': '04:00', # 默认时长 + 'song_album': '未知专辑', + 'song_languages': '中文', + 'song_company': '未知公司', + 'song_release': '2023-01-01', + 'song_img': song_img, + 'song_lyrics': song_lyric, + 'song_file': music_file, # 只保存文件名 + 'label': pop_label + } ) + if created: - # 创建对应的动态数据 + # 创建动态数据 Dynamic.objects.create( song=song, dynamic_plays=0, dynamic_search=0, dynamic_down=0 ) - print(f"创建歌曲: {song.song_name}") + print(f"✅ 导入歌曲: {singer} - {song_name}") else: - print(f"歌曲已存在: {song.song_name}") + print(f"⏩ 歌曲已存在: {singer} - {song_name}") if __name__ == '__main__': - create_sample_data() - print("示例数据创建完成!") \ No newline at end of file + import_local_music() + print("🎵 音乐数据导入完成!") \ No newline at end of file diff --git a/src/db.sqlite3 b/src/db.sqlite3 new file mode 100644 index 0000000..c8ac914 Binary files /dev/null and b/src/db.sqlite3 differ diff --git a/src/index/__pycache__/__init__.cpython-311.pyc b/src/index/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..f3fa2b3 Binary files /dev/null and b/src/index/__pycache__/__init__.cpython-311.pyc differ diff --git a/src/index/__pycache__/admin.cpython-311.pyc b/src/index/__pycache__/admin.cpython-311.pyc new file mode 100644 index 0000000..d74a5f0 Binary files /dev/null and b/src/index/__pycache__/admin.cpython-311.pyc differ diff --git a/src/index/__pycache__/models.cpython-311.pyc b/src/index/__pycache__/models.cpython-311.pyc new file mode 100644 index 0000000..1e0d4b8 Binary files /dev/null and b/src/index/__pycache__/models.cpython-311.pyc differ diff --git a/src/index/__pycache__/urls.cpython-311.pyc b/src/index/__pycache__/urls.cpython-311.pyc new file mode 100644 index 0000000..7abd9a2 Binary files /dev/null and b/src/index/__pycache__/urls.cpython-311.pyc differ diff --git a/src/index/__pycache__/views.cpython-311.pyc b/src/index/__pycache__/views.cpython-311.pyc new file mode 100644 index 0000000..37ee773 Binary files /dev/null and b/src/index/__pycache__/views.cpython-311.pyc differ diff --git a/src/index/migrations/__pycache__/0001_initial.cpython-311.pyc b/src/index/migrations/__pycache__/0001_initial.cpython-311.pyc new file mode 100644 index 0000000..bb7c46c Binary files /dev/null and b/src/index/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/src/index/migrations/__pycache__/__init__.cpython-311.pyc b/src/index/migrations/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..c888df0 Binary files /dev/null and b/src/index/migrations/__pycache__/__init__.cpython-311.pyc differ diff --git a/src/logs/music.log b/src/logs/music.log index 5f2b802..7ae60d2 100644 --- a/src/logs/music.log +++ b/src/logs/music.log @@ -1730,3 +1730,373 @@ INFO 2020-05-26 14:23:02,987 basehttp 154 "POST /admin/index/song/?q=She HTTP/1. INFO 2020-05-26 14:23:03,049 basehttp 154 "GET /admin/index/song/?q=She HTTP/1.1" 200 26055 INFO 2020-05-26 14:23:03,080 basehttp 154 "GET /admin/jsi18n/ HTTP/1.1" 200 7722 INFO 2020-05-26 14:23:03,098 basehttp 154 "GET /static/admin/img/icon-alert.svg HTTP/1.1" 200 504 +INFO 2025-11-27 23:24:19,258 autoreload 597 Watching for file changes with StatReloader +ERROR 2025-11-27 23:24:22,434 log 222 Internal Server Error: / +Traceback (most recent call last): + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\contrib\sessions\backends\base.py", line 189, in _get_session + return self._session_cache + ^^^^^^^^^^^^^^^^^^^ +AttributeError: 'SessionStore' object has no attribute '_session_cache' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 84, in _execute + return self.cursor.execute(sql, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\sqlite3\base.py", line 383, in execute + return Database.Cursor.execute(self, query, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +sqlite3.OperationalError: no such table: django_session + +The above exception was the direct cause of the following exception: + +Traceback (most recent call last): + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\core\handlers\exception.py", line 34, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\utils\deprecation.py", line 93, in __call__ + response = self.process_request(request) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\middleware\locale.py", line 21, in process_request + language = translation.get_language_from_request(request, check_path=i18n_patterns_used) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\utils\translation\__init__.py", line 236, in get_language_from_request + return _trans.get_language_from_request(request, check_path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\utils\translation\trans_real.py", line 463, in get_language_from_request + lang_code = request.session.get(LANGUAGE_SESSION_KEY) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\contrib\sessions\backends\base.py", line 65, in get + return self._session.get(key, default) + ^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\contrib\sessions\backends\base.py", line 194, in _get_session + self._session_cache = self.load() + ^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\contrib\sessions\backends\db.py", line 43, in load + s = self._get_session_from_db() + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\contrib\sessions\backends\db.py", line 32, in _get_session_from_db + return self.model.objects.get( + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\manager.py", line 82, in manager_method + return getattr(self.get_queryset(), name)(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\query.py", line 402, in get + num = len(clone) + ^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\query.py", line 256, in __len__ + self._fetch_all() + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\query.py", line 1242, in _fetch_all + self._result_cache = list(self._iterable_class(self)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\query.py", line 55, in __iter__ + results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\sql\compiler.py", line 1100, in execute_sql + cursor.execute(sql, params) + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 99, in execute + return super().execute(sql, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 67, in execute + return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 76, in _execute_with_wrappers + return executor(sql, params, many, context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 80, in _execute + with self.db.wrap_database_errors: + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\utils.py", line 89, in __exit__ + raise dj_exc_value.with_traceback(traceback) from exc_value + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 84, in _execute + return self.cursor.execute(sql, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\sqlite3\base.py", line 383, in execute + return Database.Cursor.execute(self, query, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +django.db.utils.OperationalError: no such table: django_session +ERROR 2025-11-27 23:24:22,441 basehttp 154 "GET / HTTP/1.1" 500 169619 +ERROR 2025-11-27 23:24:22,547 log 222 Internal Server Error: /favicon.ico +Traceback (most recent call last): + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\contrib\sessions\backends\base.py", line 189, in _get_session + return self._session_cache + ^^^^^^^^^^^^^^^^^^^ +AttributeError: 'SessionStore' object has no attribute '_session_cache' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 84, in _execute + return self.cursor.execute(sql, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\sqlite3\base.py", line 383, in execute + return Database.Cursor.execute(self, query, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +sqlite3.OperationalError: no such table: django_session + +The above exception was the direct cause of the following exception: + +Traceback (most recent call last): + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\core\handlers\exception.py", line 34, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\utils\deprecation.py", line 93, in __call__ + response = self.process_request(request) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\middleware\locale.py", line 21, in process_request + language = translation.get_language_from_request(request, check_path=i18n_patterns_used) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\utils\translation\__init__.py", line 236, in get_language_from_request + return _trans.get_language_from_request(request, check_path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\utils\translation\trans_real.py", line 463, in get_language_from_request + lang_code = request.session.get(LANGUAGE_SESSION_KEY) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\contrib\sessions\backends\base.py", line 65, in get + return self._session.get(key, default) + ^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\contrib\sessions\backends\base.py", line 194, in _get_session + self._session_cache = self.load() + ^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\contrib\sessions\backends\db.py", line 43, in load + s = self._get_session_from_db() + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\contrib\sessions\backends\db.py", line 32, in _get_session_from_db + return self.model.objects.get( + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\manager.py", line 82, in manager_method + return getattr(self.get_queryset(), name)(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\query.py", line 402, in get + num = len(clone) + ^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\query.py", line 256, in __len__ + self._fetch_all() + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\query.py", line 1242, in _fetch_all + self._result_cache = list(self._iterable_class(self)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\query.py", line 55, in __iter__ + results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\sql\compiler.py", line 1100, in execute_sql + cursor.execute(sql, params) + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 99, in execute + return super().execute(sql, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 67, in execute + return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 76, in _execute_with_wrappers + return executor(sql, params, many, context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 80, in _execute + with self.db.wrap_database_errors: + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\utils.py", line 89, in __exit__ + raise dj_exc_value.with_traceback(traceback) from exc_value + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 84, in _execute + return self.cursor.execute(sql, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\sqlite3\base.py", line 383, in execute + return Database.Cursor.execute(self, query, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +django.db.utils.OperationalError: no such table: django_session +ERROR 2025-11-27 23:24:22,551 basehttp 154 "GET /favicon.ico HTTP/1.1" 500 169631 +INFO 2025-11-27 23:24:35,737 autoreload 217 C:\Users\27300\text\src\music\settings.py changed, reloading. +INFO 2025-11-27 23:24:36,573 autoreload 597 Watching for file changes with StatReloader +INFO 2025-11-27 23:24:40,405 autoreload 217 C:\Users\27300\text\src\music\settings.py changed, reloading. +INFO 2025-11-27 23:24:41,275 autoreload 597 Watching for file changes with StatReloader +ERROR 2025-11-27 23:24:43,222 log 222 Internal Server Error: / +Traceback (most recent call last): + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\contrib\sessions\backends\base.py", line 189, in _get_session + return self._session_cache + ^^^^^^^^^^^^^^^^^^^ +AttributeError: 'SessionStore' object has no attribute '_session_cache' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 84, in _execute + return self.cursor.execute(sql, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\sqlite3\base.py", line 383, in execute + return Database.Cursor.execute(self, query, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +sqlite3.OperationalError: no such table: django_session + +The above exception was the direct cause of the following exception: + +Traceback (most recent call last): + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\core\handlers\exception.py", line 34, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\utils\deprecation.py", line 93, in __call__ + response = self.process_request(request) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\middleware\locale.py", line 21, in process_request + language = translation.get_language_from_request(request, check_path=i18n_patterns_used) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\utils\translation\__init__.py", line 236, in get_language_from_request + return _trans.get_language_from_request(request, check_path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\utils\translation\trans_real.py", line 463, in get_language_from_request + lang_code = request.session.get(LANGUAGE_SESSION_KEY) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\contrib\sessions\backends\base.py", line 65, in get + return self._session.get(key, default) + ^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\contrib\sessions\backends\base.py", line 194, in _get_session + self._session_cache = self.load() + ^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\contrib\sessions\backends\db.py", line 43, in load + s = self._get_session_from_db() + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\contrib\sessions\backends\db.py", line 32, in _get_session_from_db + return self.model.objects.get( + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\manager.py", line 82, in manager_method + return getattr(self.get_queryset(), name)(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\query.py", line 402, in get + num = len(clone) + ^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\query.py", line 256, in __len__ + self._fetch_all() + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\query.py", line 1242, in _fetch_all + self._result_cache = list(self._iterable_class(self)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\query.py", line 55, in __iter__ + results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\models\sql\compiler.py", line 1100, in execute_sql + cursor.execute(sql, params) + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 99, in execute + return super().execute(sql, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 67, in execute + return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 76, in _execute_with_wrappers + return executor(sql, params, many, context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 80, in _execute + with self.db.wrap_database_errors: + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\utils.py", line 89, in __exit__ + raise dj_exc_value.with_traceback(traceback) from exc_value + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\utils.py", line 84, in _execute + return self.cursor.execute(sql, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\27300\text\src\.venv\Lib\site-packages\django\db\backends\sqlite3\base.py", line 383, in execute + return Database.Cursor.execute(self, query, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +django.db.utils.OperationalError: no such table: django_session +ERROR 2025-11-27 23:24:43,228 basehttp 154 "GET / HTTP/1.1" 500 169619 +INFO 2025-11-27 23:25:47,858 autoreload 597 Watching for file changes with StatReloader +INFO 2025-11-27 23:25:49,585 basehttp 154 "GET / HTTP/1.1" 200 6240 +WARNING 2025-11-27 23:25:49,633 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +INFO 2025-11-27 23:25:49,825 basehttp 154 "GET /static/css/common.css HTTP/1.1" 200 25939 +INFO 2025-11-27 23:25:49,828 basehttp 154 "GET /static/js/require.js HTTP/1.1" 200 28517 +INFO 2025-11-27 23:25:49,832 basehttp 154 "GET /static/css/index.css HTTP/1.1" 200 63360 +INFO 2025-11-27 23:25:49,836 basehttp 154 "GET /static/image/logo.png HTTP/1.1" 200 5957 +INFO 2025-11-27 23:25:49,847 basehttp 154 "GET /static/image/laud.png HTTP/1.1" 200 1720 +WARNING 2025-11-27 23:25:49,877 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +INFO 2025-11-27 23:25:49,915 basehttp 154 "GET /static/js/index.js HTTP/1.1" 200 7424 +INFO 2025-11-27 23:25:49,935 basehttp 154 "GET /static/js/common.min.js HTTP/1.1" 200 6543 +INFO 2025-11-27 23:25:49,935 basehttp 154 "GET /static/js/jquery.min.js HTTP/1.1" 200 131989 +INFO 2025-11-27 23:25:49,951 basehttp 154 "GET /static/image/datu-1.jpg HTTP/1.1" 200 108815 +INFO 2025-11-27 23:25:49,951 basehttp 154 "GET /static/image/datu-2.jpg HTTP/1.1" 200 99784 +INFO 2025-11-27 23:25:49,957 basehttp 154 "GET /static/image/tu3.png HTTP/1.1" 200 502070 +INFO 2025-11-27 23:25:49,958 basehttp 154 "GET /static/image/tu2.png HTTP/1.1" 200 846222 +INFO 2025-11-27 23:26:14,474 basehttp 154 "GET / HTTP/1.1" 200 15758 +WARNING 2025-11-27 23:26:14,496 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:26:14,538 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:26:14,687 basehttp 154 "GET /static/songImg/default.jpg HTTP/1.1" 404 1681 +INFO 2025-11-27 23:27:13,420 basehttp 154 "GET / HTTP/1.1" 200 15758 +WARNING 2025-11-27 23:27:13,448 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:27:13,491 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:27:13,645 basehttp 154 "GET /static/songImg/default.jpg HTTP/1.1" 404 1681 +INFO 2025-11-27 23:27:14,879 basehttp 154 "GET / HTTP/1.1" 200 15758 +WARNING 2025-11-27 23:27:14,901 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:27:14,939 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:27:15,085 basehttp 154 "GET /static/songImg/default.jpg HTTP/1.1" 404 1681 +INFO 2025-11-27 23:28:07,309 autoreload 597 Watching for file changes with StatReloader +INFO 2025-11-27 23:28:10,111 basehttp 154 "GET / HTTP/1.1" 200 15758 +WARNING 2025-11-27 23:28:10,153 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:28:10,292 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:28:10,383 basehttp 154 "GET /static/songImg/default.jpg HTTP/1.1" 404 1681 +INFO 2025-11-27 23:28:11,528 basehttp 154 "GET /static/font/iconfont.woff HTTP/1.1" 200 5740 +INFO 2025-11-27 23:29:54,929 basehttp 154 "GET / HTTP/1.1" 200 15758 +WARNING 2025-11-27 23:29:54,955 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:29:54,997 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:29:55,146 basehttp 154 "GET /static/songImg/default.jpg HTTP/1.1" 404 1681 +INFO 2025-11-27 23:29:56,408 basehttp 154 "GET / HTTP/1.1" 200 15758 +WARNING 2025-11-27 23:29:56,430 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:29:56,473 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:29:56,634 basehttp 154 "GET /static/songImg/default.jpg HTTP/1.1" 404 1681 +INFO 2025-11-27 23:30:37,536 autoreload 217 C:\Users\27300\text\src\music\settings.py changed, reloading. +INFO 2025-11-27 23:30:38,481 autoreload 597 Watching for file changes with StatReloader +INFO 2025-11-27 23:31:01,729 basehttp 154 "GET / HTTP/1.1" 200 15758 +WARNING 2025-11-27 23:31:01,754 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:31:01,801 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:31:01,949 basehttp 154 "GET /static/songImg/default.jpg HTTP/1.1" 404 1681 +INFO 2025-11-27 23:31:02,680 basehttp 154 "GET / HTTP/1.1" 200 15758 +WARNING 2025-11-27 23:31:02,706 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:31:02,746 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:31:02,905 basehttp 154 "GET /static/songImg/default.jpg HTTP/1.1" 404 1681 +INFO 2025-11-27 23:34:29,037 autoreload 597 Watching for file changes with StatReloader +INFO 2025-11-27 23:34:30,952 basehttp 154 "GET / HTTP/1.1" 200 15758 +WARNING 2025-11-27 23:34:30,990 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:34:31,142 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:34:31,216 basehttp 154 "GET /static/songImg/default.jpg HTTP/1.1" 404 1681 +INFO 2025-11-27 23:36:24,162 autoreload 217 C:\Users\27300\text\src\music\settings.py changed, reloading. +INFO 2025-11-27 23:36:25,043 autoreload 597 Watching for file changes with StatReloader +INFO 2025-11-27 23:36:26,697 basehttp 154 "GET / HTTP/1.1" 200 15758 +WARNING 2025-11-27 23:36:26,734 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:36:26,882 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:36:26,953 basehttp 154 "GET /static/songImg/default.jpg HTTP/1.1" 404 1681 +INFO 2025-11-27 23:37:03,774 autoreload 217 C:\Users\27300\text\src\music\settings.py changed, reloading. +INFO 2025-11-27 23:37:04,661 autoreload 597 Watching for file changes with StatReloader +INFO 2025-11-27 23:37:05,758 basehttp 154 "GET / HTTP/1.1" 200 15758 +WARNING 2025-11-27 23:37:05,794 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:37:05,938 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:37:06,013 basehttp 154 "GET /static/songImg/default.jpg HTTP/1.1" 404 1681 +INFO 2025-11-27 23:38:52,323 autoreload 597 Watching for file changes with StatReloader +INFO 2025-11-27 23:38:54,124 basehttp 154 "GET / HTTP/1.1" 200 23339 +WARNING 2025-11-27 23:38:54,157 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:38:54,312 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:38:54,379 basehttp 154 "GET /static/songImg/default.jpg HTTP/1.1" 404 1681 +INFO 2025-11-27 23:38:54,561 basehttp 154 "GET /static/songImg/All%20Right.jpg HTTP/1.1" 200 794892 +INFO 2025-11-27 23:38:54,573 basehttp 154 "GET /static/songImg/785%20(Live).jpg HTTP/1.1" 200 723157 +INFO 2025-11-27 23:38:54,579 basehttp 154 "GET /static/songImg/Angelina.jpg HTTP/1.1" 200 103446 +INFO 2025-11-27 23:39:14,351 basehttp 154 "GET / HTTP/1.1" 200 23339 +INFO 2025-11-27 23:39:14,399 basehttp 154 "GET /static/css/common.css HTTP/1.1" 200 25939 +INFO 2025-11-27 23:39:14,400 basehttp 154 "GET /static/css/index.css HTTP/1.1" 200 63360 +INFO 2025-11-27 23:39:14,401 basehttp 154 "GET /static/image/logo.png HTTP/1.1" 200 5957 +INFO 2025-11-27 23:39:14,401 basehttp 154 "GET /static/js/require.js HTTP/1.1" 200 28517 +WARNING 2025-11-27 23:39:14,447 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +INFO 2025-11-27 23:39:14,485 basehttp 154 "GET /static/image/laud.png HTTP/1.1" 200 1720 +INFO 2025-11-27 23:39:14,524 basehttp 154 "GET /static/js/index.js HTTP/1.1" 200 7424 +INFO 2025-11-27 23:39:14,561 basehttp 154 "GET /static/js/common.min.js HTTP/1.1" 200 6543 +INFO 2025-11-27 23:39:14,562 basehttp 154 "GET /static/js/jquery.min.js HTTP/1.1" 200 131989 +INFO 2025-11-27 23:39:14,566 basehttp 154 "GET /static/favicon.ico HTTP/1.1" 200 1150 +INFO 2025-11-27 23:39:14,594 basehttp 154 "GET /static/image/datu-1.jpg HTTP/1.1" 200 108815 +INFO 2025-11-27 23:39:14,597 basehttp 154 "GET /static/image/tu3.png HTTP/1.1" 200 502070 +INFO 2025-11-27 23:39:14,599 basehttp 154 "GET /static/image/datu-2.jpg HTTP/1.1" 200 99784 +WARNING 2025-11-27 23:39:14,602 basehttp 154 "GET /static/songImg/default.jpg HTTP/1.1" 404 1681 +INFO 2025-11-27 23:39:14,605 basehttp 154 "GET /static/songImg/Angelina.jpg HTTP/1.1" 200 103446 +INFO 2025-11-27 23:39:14,606 basehttp 154 "GET /static/songImg/785%20(Live).jpg HTTP/1.1" 200 723157 +INFO 2025-11-27 23:39:14,606 basehttp 154 "GET /static/songImg/All%20Right.jpg HTTP/1.1" 200 794892 +INFO 2025-11-27 23:39:14,607 basehttp 154 "GET /static/image/tu2.png HTTP/1.1" 200 846222 +INFO 2025-11-27 23:43:10,137 basehttp 154 "GET / HTTP/1.1" 200 23339 +WARNING 2025-11-27 23:43:10,163 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:43:10,214 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:43:10,380 basehttp 154 "GET /static/songImg/default.jpg HTTP/1.1" 404 1681 +INFO 2025-11-27 23:43:11,430 basehttp 154 "GET / HTTP/1.1" 200 23339 +WARNING 2025-11-27 23:43:11,456 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:43:11,495 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:43:11,652 basehttp 154 "GET /static/songImg/default.jpg HTTP/1.1" 404 1681 +INFO 2025-11-27 23:44:01,261 basehttp 154 "GET / HTTP/1.1" 200 23468 +WARNING 2025-11-27 23:44:01,288 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +WARNING 2025-11-27 23:44:01,338 basehttp 154 "GET /static/js/jquery-1.12.4.min.js HTTP/1.1" 404 1693 +INFO 2025-11-27 23:44:01,503 basehttp 154 "GET /static/songImg/Boom%20Clap.jpg HTTP/1.1" 200 94362 +INFO 2025-11-27 23:44:01,504 basehttp 154 "GET /static/songImg/Christmas%20In%20My%20Heart.jpg HTTP/1.1" 200 128142 +INFO 2025-11-27 23:44:01,512 basehttp 154 "GET /static/songImg/Follow%20Me%20(Live).jpg HTTP/1.1" 200 722693 diff --git a/src/music/__pycache__/__init__.cpython-311.pyc b/src/music/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..6743a83 Binary files /dev/null and b/src/music/__pycache__/__init__.cpython-311.pyc differ diff --git a/src/music/__pycache__/settings.cpython-311.pyc b/src/music/__pycache__/settings.cpython-311.pyc new file mode 100644 index 0000000..d5daec0 Binary files /dev/null and b/src/music/__pycache__/settings.cpython-311.pyc differ diff --git a/src/music/__pycache__/urls.cpython-311.pyc b/src/music/__pycache__/urls.cpython-311.pyc new file mode 100644 index 0000000..103a954 Binary files /dev/null and b/src/music/__pycache__/urls.cpython-311.pyc differ diff --git a/src/music/__pycache__/wsgi.cpython-311.pyc b/src/music/__pycache__/wsgi.cpython-311.pyc new file mode 100644 index 0000000..dbcfc6a Binary files /dev/null and b/src/music/__pycache__/wsgi.cpython-311.pyc differ diff --git a/src/music/settings.py b/src/music/settings.py index 384c5fe..11910ee 100644 --- a/src/music/settings.py +++ b/src/music/settings.py @@ -2,12 +2,6 @@ Django settings for music project. Generated by 'django-admin startproject' using Django 2.2.5. - -For more information on this file, see -https://docs.djangoproject.com/en/2.2/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/2.2/ref/settings/ """ import os @@ -25,7 +19,6 @@ SECRET_KEY = 'hv(uoh%o6ll4=7&%h3(7u-%57wniu2&8937j_cf#nm!zw9+%@1' DEBUG = True # Application definition -# 添加新增的项目应用index、ranking、play、comment、search、user INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', @@ -55,11 +48,11 @@ MIDDLEWARE = [ ROOT_URLCONF = 'music.urls' -# 设置模板路径,在每个App中分别创建模板文件夹templates +# 设置模板路径 TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [os.path.join(BASE_DIR, 'templates'), # 定义全局模板文件路径 + 'DIRS': [os.path.join(BASE_DIR, 'templates'), os.path.join(BASE_DIR, 'index/templates'), os.path.join(BASE_DIR, 'ranking/templates'), os.path.join(BASE_DIR, 'user/templates'), @@ -80,21 +73,19 @@ TEMPLATES = [ WSGI_APPLICATION = 'music.wsgi.application' -# Database -# https://docs.djangoproject.com/en/2.2/ref/settings/#databases - -# 设置数据库连接信息,项目使用的数据库为music +# Database - 使用SQLite DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.mysql', - 'NAME': 'music', - 'USER': 'root', - 'PASSWORD': 'yao950724', - 'HOST': '127.0.0.1', - 'PORT': '3306', + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } +# 临时注释掉自定义用户模型 +# AUTH_USER_MODEL = 'user.MyUser' + +# 其他配置保持不变... + # Password validation # https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators @@ -170,8 +161,10 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/2.2/howto/static-files/ AUTH_USER_MODEL = 'user.MyUser' +# Static files (CSS, JavaScript, Images) STATIC_URL = '/static/' -STATIC_ROOT = '/static/' +STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') # 收集静态文件目录 + STATICFILES_DIRS = [ - os.path.join(BASE_DIR, 'static'), + os.path.join(BASE_DIR, 'static'), # 你的静态文件目录 ] diff --git a/src/play/__pycache__/__init__.cpython-311.pyc b/src/play/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..962ba6b Binary files /dev/null and b/src/play/__pycache__/__init__.cpython-311.pyc differ diff --git a/src/play/__pycache__/admin.cpython-311.pyc b/src/play/__pycache__/admin.cpython-311.pyc new file mode 100644 index 0000000..b2482a3 Binary files /dev/null and b/src/play/__pycache__/admin.cpython-311.pyc differ diff --git a/src/play/__pycache__/models.cpython-311.pyc b/src/play/__pycache__/models.cpython-311.pyc new file mode 100644 index 0000000..91b1acb Binary files /dev/null and b/src/play/__pycache__/models.cpython-311.pyc differ diff --git a/src/play/__pycache__/urls.cpython-311.pyc b/src/play/__pycache__/urls.cpython-311.pyc new file mode 100644 index 0000000..49dbf15 Binary files /dev/null and b/src/play/__pycache__/urls.cpython-311.pyc differ diff --git a/src/play/__pycache__/views.cpython-311.pyc b/src/play/__pycache__/views.cpython-311.pyc new file mode 100644 index 0000000..48147ce Binary files /dev/null and b/src/play/__pycache__/views.cpython-311.pyc differ diff --git a/src/play/migrations/__pycache__/__init__.cpython-311.pyc b/src/play/migrations/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..fd10edf Binary files /dev/null and b/src/play/migrations/__pycache__/__init__.cpython-311.pyc differ diff --git a/src/ranking/__pycache__/__init__.cpython-311.pyc b/src/ranking/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..73c45a4 Binary files /dev/null and b/src/ranking/__pycache__/__init__.cpython-311.pyc differ diff --git a/src/ranking/__pycache__/admin.cpython-311.pyc b/src/ranking/__pycache__/admin.cpython-311.pyc new file mode 100644 index 0000000..58f2f12 Binary files /dev/null and b/src/ranking/__pycache__/admin.cpython-311.pyc differ diff --git a/src/ranking/__pycache__/models.cpython-311.pyc b/src/ranking/__pycache__/models.cpython-311.pyc new file mode 100644 index 0000000..1fb1326 Binary files /dev/null and b/src/ranking/__pycache__/models.cpython-311.pyc differ diff --git a/src/ranking/__pycache__/urls.cpython-311.pyc b/src/ranking/__pycache__/urls.cpython-311.pyc new file mode 100644 index 0000000..47e6cb6 Binary files /dev/null and b/src/ranking/__pycache__/urls.cpython-311.pyc differ diff --git a/src/ranking/__pycache__/views.cpython-311.pyc b/src/ranking/__pycache__/views.cpython-311.pyc new file mode 100644 index 0000000..550a520 Binary files /dev/null and b/src/ranking/__pycache__/views.cpython-311.pyc differ diff --git a/src/ranking/migrations/__pycache__/__init__.cpython-311.pyc b/src/ranking/migrations/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..3636f82 Binary files /dev/null and b/src/ranking/migrations/__pycache__/__init__.cpython-311.pyc differ diff --git a/src/search/__pycache__/__init__.cpython-311.pyc b/src/search/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..5b1e3dd Binary files /dev/null and b/src/search/__pycache__/__init__.cpython-311.pyc differ diff --git a/src/search/__pycache__/admin.cpython-311.pyc b/src/search/__pycache__/admin.cpython-311.pyc new file mode 100644 index 0000000..6891f8b Binary files /dev/null and b/src/search/__pycache__/admin.cpython-311.pyc differ diff --git a/src/search/__pycache__/models.cpython-311.pyc b/src/search/__pycache__/models.cpython-311.pyc new file mode 100644 index 0000000..04548f9 Binary files /dev/null and b/src/search/__pycache__/models.cpython-311.pyc differ diff --git a/src/search/__pycache__/urls.cpython-311.pyc b/src/search/__pycache__/urls.cpython-311.pyc new file mode 100644 index 0000000..ddd1350 Binary files /dev/null and b/src/search/__pycache__/urls.cpython-311.pyc differ diff --git a/src/search/__pycache__/views.cpython-311.pyc b/src/search/__pycache__/views.cpython-311.pyc new file mode 100644 index 0000000..ad37f6f Binary files /dev/null and b/src/search/__pycache__/views.cpython-311.pyc differ diff --git a/src/search/migrations/__pycache__/__init__.cpython-311.pyc b/src/search/migrations/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..06e508a Binary files /dev/null and b/src/search/migrations/__pycache__/__init__.cpython-311.pyc differ diff --git a/src/user/__pycache__/__init__.cpython-311.pyc b/src/user/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..b353878 Binary files /dev/null and b/src/user/__pycache__/__init__.cpython-311.pyc differ diff --git a/src/user/__pycache__/admin.cpython-311.pyc b/src/user/__pycache__/admin.cpython-311.pyc new file mode 100644 index 0000000..211ac96 Binary files /dev/null and b/src/user/__pycache__/admin.cpython-311.pyc differ diff --git a/src/user/__pycache__/form.cpython-311.pyc b/src/user/__pycache__/form.cpython-311.pyc new file mode 100644 index 0000000..c60cba4 Binary files /dev/null and b/src/user/__pycache__/form.cpython-311.pyc differ diff --git a/src/user/__pycache__/models.cpython-311.pyc b/src/user/__pycache__/models.cpython-311.pyc new file mode 100644 index 0000000..0131e46 Binary files /dev/null and b/src/user/__pycache__/models.cpython-311.pyc differ diff --git a/src/user/__pycache__/urls.cpython-311.pyc b/src/user/__pycache__/urls.cpython-311.pyc new file mode 100644 index 0000000..c4d30fb Binary files /dev/null and b/src/user/__pycache__/urls.cpython-311.pyc differ diff --git a/src/user/__pycache__/views.cpython-311.pyc b/src/user/__pycache__/views.cpython-311.pyc new file mode 100644 index 0000000..871e05d Binary files /dev/null and b/src/user/__pycache__/views.cpython-311.pyc differ diff --git a/src/user/migrations/__pycache__/0001_initial.cpython-311.pyc b/src/user/migrations/__pycache__/0001_initial.cpython-311.pyc new file mode 100644 index 0000000..c456c5a Binary files /dev/null and b/src/user/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/src/user/migrations/__pycache__/__init__.cpython-311.pyc b/src/user/migrations/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..33a23c8 Binary files /dev/null and b/src/user/migrations/__pycache__/__init__.cpython-311.pyc differ