Open phoenixg opened 6 years ago
pip3.6 install virtualenv
现在报这个错误了:
→ pip3.6 install -r requirements.txt
Collecting celery==3.1.23 (from -r requirements.txt (line 1))
Downloading celery-3.1.23-py2.py3-none-any.whl (520kB)
100% |████████████████████████████████| 522kB 1.3MB/s
Collecting Django==1.9 (from -r requirements.txt (line 2))
Downloading Django-1.9-py2.py3-none-any.whl (6.6MB)
100% |████████████████████████████████| 6.6MB 210kB/s
Collecting django-celery==3.1.17 (from -r requirements.txt (line 3))
Downloading django-celery-3.1.17.tar.gz (79kB)
100% |████████████████████████████████| 81kB 3.0MB/s
Collecting django-cors-middleware==1.2.0 (from -r requirements.txt (line 4))
Downloading django-cors-middleware-1.2.0.tar.gz
Collecting django-filter==0.13.0 (from -r requirements.txt (line 5))
Downloading django_filter-0.13.0-py2.py3-none-any.whl
Collecting djangorestframework==3.4.1 (from -r requirements.txt (line 6))
Downloading djangorestframework-3.4.1-py2.py3-none-any.whl (705kB)
100% |████████████████████████████████| 706kB 1.5MB/s
Collecting djangorestframework-word-filter==0.1.1 (from -r requirements.txt (line 7))
Downloading djangorestframework_word_filter-0.1.1-py2.py3-none-any.whl
Collecting psycopg2==2.6.2 (from -r requirements.txt (line 8))
Downloading psycopg2-2.6.2.tar.gz (376kB)
100% |████████████████████████████████| 378kB 2.0MB/s
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
Error: pg_config executable not found.
Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/sc/rp8kdvtn233gcdpdh48dtdkm0000gn/T/pip-build-opeyxn4z/psycopg2/
(venv)
安装postgresql了吗
之前没有安装,现在我通过 brew install postgresql
安装好了。 执行第二条同步命令时报错:
→ python3 manage.py migrate
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 342, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 89, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
File "/usr/local/lib/python3.6/site-packages/django/db/migrations/executor.py", line 20, in __init__
self.loader = MigrationLoader(self.connection)
File "/usr/local/lib/python3.6/site-packages/django/db/migrations/loader.py", line 49, in __init__
self.build_graph()
File "/usr/local/lib/python3.6/site-packages/django/db/migrations/loader.py", line 176, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/usr/local/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 65, in applied_migrations
self.ensure_schema()
File "/usr/local/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 52, in ensure_schema
if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 231, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 204, in _cursor
self.ensure_connection()
File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection
self.connect()
File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 170, in connect
conn_params = self.get_connection_params()
File "/usr/local/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 157, in get_connection_params
"settings.DATABASES is improperly configured. "
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the NAME value.
可是我从没连过 postgresql,麻烦问一下客户端连接要怎么填写连接参数?
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': '',
'USER': '',
'PASSWORD': '',
'HOST': '127.0.0.1',
'PORT': '5432',
}
}
解决了, 我好像都装好了, 现在访问 http://127.0.0.1:8000/
有界面了, 但是要上传 har 文件, 怎么配合 charles 使用呢?
选择har
→ python3 manage.py migrate 哥们,这个怎么解决的