Closed ZoltanOnody closed 7 years ago
Niektore moduly su este stale deprecated ale aspon django ma uz nejaku normalnu verziu.
~Vsetko okrem loginu cez socialne siete vyzera byt funkcne. Niesom si isty, kedy presne sa ten login rozbil, zajtra na to skusim prijst a fixnut to.~
Ako tak testujem, login cez socialne siete nejde ani na betaliahen.ksp.sk
Vsetky moduly maju uz nejaku rozumnu verziu (mozno nie najvyssiu). Projekt som preklikal a vyzera byt funkcny.
Po mergnuti treba na serveri pustit python manage.py migrate --fake-initial
.
Uz to netreba aplikovat po commitoch ci?
Nie, moze sa to cele naraz, otestoval som to a vyzera, ze to funguje.
Kedze sa toto nebude nasadzovat teraz, asi by sme mohli mat wiki clanok s tym, co nezabudnut, ked sa toto bude davat na server (v zatvorenom PR by sa to stratilo).
Inak, skusal si aj spustat tie migracie / vytvorit databazu odznova? (Ked sa to teda tak velmi premazalo / zostrucnilo).
Skusal, vsetko fungovalo ako ma.
Pred spustením som si vytvoril úplne nový virtualenv a doňho nainštaloval requirements. Keď som sa to pokúšal spustiť, dostal som toto:
(env) mario@inspiration:~/ksp/liahen/liahen$ ./manage.py runserver
Unhandled exception in thread started by <function wrapper at 0x7f8589e2f7d0>
Traceback (most recent call last):
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 113, in inner_run
autoreload.raise_last_exception()
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
six.reraise(*_exception)
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/ksp_login/__init__.py", line 35, in <module>
__activate_social_auth_monkeypatch()
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/ksp_login/__init__.py", line 12, in __activate_social_auth_monkeypatch
from social.backends.open_id import (OPENID_ID_FIELD, OpenIdAuth)
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/social/backends/open_id.py", line 1, in <module>
from social_core.backends.open_id import OpenIdAuth, \
ImportError: cannot import name OpenIdConnectAssociation
Možno si nerozumejú verzie social-core, social a ksp_login?
jop ksp-login 0.4.2 je kompatibilna s python-social-auth 0.2.21.. v mastrovi ksp-login-u uz je sice nejaka podpora social-core a social-auth-app-django, ale tam tusim tie najnovsie verzie su este jemne zabugovane..
Hmm... zaujimave, pozriem sa na to.
@black3r neviem nakolko je to zabugovane, ja som to dost preklikal a tvarilo sa to byt funkcne.
Migracie maju pokazene, treba fakovat pri prechode zo starsich verzii, maju dokonca 2x tu issue reportnutu na githube :D
Neviem nakolko fakeovanie vadi ale --fake-initial
zbehol v pohode a tak ci tak musime fakeovat kvoli prechodu zo south
na django migracie.
Pre zmenu teraz:
(env) mario@inspiration:~/ksp/liahen/liahen$ ./manage.py runserver
Performing system checks...
Unhandled exception in thread started by <function wrapper at 0x7fe9eefceed8>
Traceback (most recent call last):
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 121, in inner_run
self.check(display_num_errors=True)
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 374, in check
include_deployment_checks=include_deployment_checks,
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 361, in _run_checks
return checks.run_checks(**kwargs)
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 24, in check_resolver
for pattern in resolver.url_patterns:
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 313, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 306, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/mario/ksp/liahen/liahen/page/urls.py", line 15, in <module>
url(r'^account/', include('ksp_login.urls')),
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/django/conf/urls/__init__.py", line 50, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/ksp_login/urls.py", line 5, in <module>
from ksp_login import views
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/ksp_login/views.py", line 14, in <module>
from social_django.utils import setting
File "/home/mario/ksp/liahen/env/local/lib/python2.7/site-packages/social_django/utils.py", line 9, in <module>
from social_core.utils import setting_name, module_member, get_strategy, \
ImportError: cannot import name set_current_strategy_getter
Zoli, ak to u teba funguje, tak je to nejaké zvláštne ... premazal si si virtualenv pred spúšťaním?
Sorry, asi som uz prepracovany.
zoli@hp:~/projects/liahen$ virtualenv -p python2.7 env
Running virtualenv with interpreter /usr/bin/python2.7
New python executable in /home/zoli/projects/liahen/env/bin/python2.7
Also creating executable in /home/zoli/projects/liahen/env/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
zoli@hp:~/projects/liahen$ source env/bin/activate
(env) zoli@hp:~/projects/liahen$ pip freeze
appdirs==1.4.0
packaging==16.8
pkg-resources==0.0.0
pyparsing==2.1.10
six==1.10.0
(env) zoli@hp:~/projects/liahen$ pip install -r requirements.txt
Collecting git+git://github.com/koniiiik/ksp_login.git@f92287cedaa2647f3e57e9308a5e6c2a65c6232d (from -r requirements.txt (line 5))
Cloning git://github.com/koniiiik/ksp_login.git (to f92287cedaa2647f3e57e9308a5e6c2a65c6232d) to /tmp/pip-185DX3-build
Could not find a tag or branch 'f92287cedaa2647f3e57e9308a5e6c2a65c6232d', assuming commit.
Requirement already satisfied: appdirs==1.4.0 in ./env/lib/python2.7/site-packages (from -r requirements.txt (line 1))
Collecting Django==1.10.5 (from -r requirements.txt (line 2))
Using cached Django-1.10.5-py2.py3-none-any.whl
Collecting django-extensions==1.7.5 (from -r requirements.txt (line 3))
Using cached django_extensions-1.7.5-py2.py3-none-any.whl
Collecting httplib2==0.9.2 (from -r requirements.txt (line 4))
Collecting Markdown==2.6.7 (from -r requirements.txt (line 6))
Collecting oauth2==1.9.0.post1 (from -r requirements.txt (line 7))
Using cached oauth2-1.9.0.post1-py2.py3-none-any.whl
Collecting oauthlib==2.0.1 (from -r requirements.txt (line 8))
Requirement already satisfied: pkg-resources==0.0.0 in ./env/lib/python2.7/site-packages (from -r requirements.txt (line 9))
Collecting psycopg2==2.6.2 (from -r requirements.txt (line 10))
Collecting PyJWT==1.4.2 (from -r requirements.txt (line 11))
Using cached PyJWT-1.4.2-py2.py3-none-any.whl
Requirement already satisfied: pyparsing==2.1.10 in ./env/lib/python2.7/site-packages (from -r requirements.txt (line 12))
Collecting python-openid==2.2.5 (from -r requirements.txt (line 13))
Collecting requests==2.12.5 (from -r requirements.txt (line 14))
Using cached requests-2.12.5-py2.py3-none-any.whl
Collecting requests-oauthlib==0.7.0 (from -r requirements.txt (line 15))
Using cached requests_oauthlib-0.7.0-py2.py3-none-any.whl
Requirement already satisfied: six==1.10.0 in ./env/lib/python2.7/site-packages (from -r requirements.txt (line 16))
Collecting social-auth-app-django==0.1.0 (from -r requirements.txt (line 17))
Using cached social_auth_app_django-0.1.0-py2-none-any.whl
Collecting social-auth-core==0.2.1 (from -r requirements.txt (line 18))
Using cached social_auth_core-0.2.1-py2-none-any.whl
Installing collected packages: Django, django-extensions, httplib2, Markdown, oauth2, oauthlib, psycopg2, PyJWT, python-openid, requests, requests-oauthlib, social-auth-core, social-auth-app-django, ksp-login
Running setup.py install for ksp-login ... done
Successfully installed Django-1.10.5 Markdown-2.6.7 PyJWT-1.4.2 django-extensions-1.7.5 httplib2-0.9.2 ksp-login-0.4.2 oauth2-1.9.0.post1 oauthlib-2.0.1 psycopg2-2.6.2 python-openid-2.2.5 requests-2.12.5 requests-oauthlib-0.7.0 social-auth-app-django-0.1.0 social-auth-core-0.2.1
(env) zoli@hp:~/projects/liahen$ pip freeze
appdirs==1.4.0
Django==1.10.5
django-extensions==1.7.5
httplib2==0.9.2
ksp-login==0.4.2
Markdown==2.6.7
oauth2==1.9.0.post1
oauthlib==2.0.1
packaging==16.8
pkg-resources==0.0.0
psycopg2==2.6.2
PyJWT==1.4.2
pyparsing==2.1.10
python-openid==2.2.5
requests==2.12.5
requests-oauthlib==0.7.0
six==1.10.0
social-auth-app-django==0.1.0
social-auth-core==0.2.1
(env) zoli@hp:~/projects/liahen$ python manage.py migrate --fake-initial
Operations to perform:
Apply all migrations: admin, auth, contenttypes, sessions, social_django, submit, tasks
Running migrations:
Applying contenttypes.0001_initial... FAKED
Applying auth.0001_initial... FAKED
Applying admin.0001_initial... FAKED
Applying admin.0002_logentry_remove_auto_add... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length... OK
Applying sessions.0001_initial... FAKED
Applying social_django.0001_initial... FAKED
Applying social_django.0002_add_related_name... OK
Applying social_django.0003_alter_email_max_length... OK
Applying social_django.0004_auto_20160423_0400... OK
Applying social_django.0005_auto_20160727_2333... OK
Applying tasks.0001_initial... FAKED
Applying submit.0001_initial... FAKED
(env) zoli@hp:~/projects/liahen$ python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
January 26, 2017 - 08:57:17
Django version 1.10.5, using settings 'page.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Uz by to malo fungovat, dropol som aj env
aj databazu a vsetko som vytvoril nanovo predtym ako som commitol.
zajtra skusim reviewnut
Moze sa to teda mergnut?
jj moze
closes #10