Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build Django tables and initial data #697

Closed
JohnnyKing94 opened this issue Apr 5, 2015 · 21 comments
Closed

Can't build Django tables and initial data #697

JohnnyKing94 opened this issue Apr 5, 2015 · 21 comments
Assignees
Labels
bug Something is broken.
Milestone

Comments

@JohnnyKing94
Copy link

I tried installing with and without enviroment, both of them don't work... :( this is what i get everytime, please help me, i reinstalled several times with no success...

Traceback (most recent call last):
  File "./manage.py", line 31, in <module>
    execute_from_command_line(sys.argv)
  File "/var/www/my.website.com/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/var/www/my.website.com/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 303, in execute
    settings.INSTALLED_APPS
  File "/var/www/my.website.com/env/local/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
  File "/var/www/my.website.com/env/local/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/var/www/my.website.com/env/local/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/var/www/my.website.com/weblate/weblate/__init__.py", line 26, in <module>
    from weblate.requirements import (
  File "/var/www/my.website.com/weblate/weblate/requirements.py", line 24, in <module>
    from weblate.trans.vcs import GitRepository, HgRepository
  File "/var/www/my.website.com/weblate/weblate/trans/vcs.py", line 632, in <module>
    class HgRepository(Repository):
  File "/var/www/my.website.com/weblate/weblate/trans/vcs.py", line 44, in register_vcs
    if vcs.is_supported():
  File "/var/www/my.website.com/weblate/weblate/trans/vcs.py", line 263, in is_supported
    version = cls.get_version()
  File "/var/www/my.website.com/weblate/weblate/trans/vcs.py", line 288, in get_version
    cls._version = cls._get_version()
  File "/var/www/my.website.com/weblate/weblate/trans/vcs.py", line 855, in _get_version
    return cls.VERSION_RE.match(output).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
@nijel
Copy link
Member

nijel commented Apr 7, 2015

Can you please post here output of hg version?

@nijel nijel added the bug Something is broken. label Apr 7, 2015
@nijel nijel added this to the 2.3 milestone Apr 7, 2015
@nijel nijel self-assigned this Apr 7, 2015
nijel added a commit that referenced this issue Apr 7, 2015
Issue #697

Signed-off-by: Michal Čihař <michal@cihar.com>
@JohnnyKing94
Copy link
Author

Here it is ;)

(env)root@server: hg version
Mercurial SCM Distribuito (versione 3.3.3)
(see http://mercurial.selenic.com for more information)

Copyright (C) 2005-2014 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@nijel
Copy link
Member

nijel commented Apr 7, 2015

Ah okay, this string is localized and Weblate fails to parse it...

@nijel nijel closed this as completed in d9e24ab Apr 7, 2015
@JohnnyKing94
Copy link
Author

so what do i do?

@nijel
Copy link
Member

nijel commented Apr 7, 2015

I've just fixed it in git, so updating Weblate should solve the problem.

@JohnnyKing94
Copy link
Author

Now is working and is applying... but on the top of the log, there was this, is it normal??

(env)root@server:/var/www/my.website.com/weblate# ./manage.py migrate
/var/www/my.website.com/env/local/lib/python2.7/site-packages/social/apps/django_app/default/models.py:29: RemovedInDjango19Warning: Model class social.apps.django_app.default.models.UserSocialAuth doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class UserSocialAuth(models.Model, DjangoUserMixin):

/var/www/my.website.com/env/local/lib/python2.7/site-packages/social/apps/django_app/default/models.py:67: RemovedInDjango19Warning: Model class social.apps.django_app.default.models.Nonce doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class Nonce(models.Model, DjangoNonceMixin):

/var/www/my.website.com/env/local/lib/python2.7/site-packages/social/apps/django_app/default/models.py:78: RemovedInDjango19Warning: Model class social.apps.django_app.default.models.Association doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class Association(models.Model, DjangoAssociationMixin):

/var/www/my.website.com/env/local/lib/python2.7/site-packages/social/apps/django_app/default/models.py:91: RemovedInDjango19Warning: Model class social.apps.django_app.default.models.Code doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class Code(models.Model, DjangoCodeMixin):

Operations to perform:
Synchronize unmigrated apps: staticfiles, admindocs, messages, sitemaps, weblate, crispy_forms
Apply all migrations: lang, sessions, admin, sites, auth, default, contenttypes, accounts, trans
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Installing custom SQL...
Running migrations:
Rendering model states... DONE
Applying lang.0001_initial... OK
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying trans.0001_initial...
[...]continuing

@nijel
Copy link
Member

nijel commented Apr 7, 2015

It's normal for now, these are coming from Python Social Auth, see omab/python-social-auth#581

@JohnnyKing94
Copy link
Author

Thank you for everything ;) you're amzing,where can i leave a review, upvote, comment to the product or to the team?? ;)

@JohnnyKing94
Copy link
Author

I'd leave the review (if possible) any moment, everything is fine, just i get an internal error loading the page and this in the apache.log
what's wrong?
I installed wsgi correcly, removed it and then reinstalled again, i think it might be the file, i don't know

[Tue Apr 07 12:09:09 2015] [error] [client 79.18.75.152] mod_wsgi (pid=15900): Target WSGI script '/var/www/my.website.com/weblate/weblate/wsgi.py' cannot be loaded as Python module.
[Tue Apr 07 12:09:09 2015] [error] [client 79.18.75.152] mod_wsgi (pid=15900): Exception occurred processing WSGI script '/var/www/my.website.com/weblate/weblate/wsgi.py'.
[Tue Apr 07 12:09:09 2015] [error] [client 79.18.75.152] Traceback (most recent call last):
[Tue Apr 07 12:09:09 2015] [error] [client 79.18.75.152]   File "/var/www/my.website.com/weblate/weblate/wsgi.py", line 37, in <module>
[Tue Apr 07 12:09:09 2015] [error] [client 79.18.75.152]     from django.core.wsgi import get_wsgi_application
[Tue Apr 07 12:09:09 2015] [error] [client 79.18.75.152] ImportError: No module named wsgi

@nijel
Copy link
Member

nijel commented Apr 7, 2015

Looks like Django fails to import ... is it properly installed?

@JohnnyKing94
Copy link
Author

Yes this was the install log, everything was fine, i don't know what's wrong... the runserver command for testing purposes works too

Operations to perform:
Synchronize unmigrated apps: staticfiles, admindocs, messages, sitemaps, weblate, crispy_forms
Apply all migrations: lang, sessions, admin, sites, auth, default, contenttypes, accounts, trans
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Installing custom SQL...
Running migrations:
Rendering model states... DONE
Applying lang.0001_initial... OK
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying trans.0001_initial... OK
Applying default.0001_initial... OK
Applying accounts.0001_initial... OK
Applying accounts.0002_auto_20140923_1543... OK
Applying accounts.0003_auto_20141104_1159... OK
Applying accounts.0004_auto_20150108_1424... OK
Applying accounts.0005_auto_20150330_1358... OK
Applying accounts.0006_profile_hide_completed... OK
Applying admin.0001_initial... 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 default.0002_add_related_name... OK
Applying sessions.0001_initial... OK
Applying sites.0001_initial... OK
Applying trans.0002_auto_20141021_1347... OK
Applying trans.0003_auto_20141021_1348... OK
Applying trans.0004_auto_20141021_1550... OK
Applying trans.0005_auto_20141021_1550... OK
Applying trans.0006_auto_20141021_1609... OK
Applying trans.0007_auto_20141022_1159... OK
Applying trans.0008_auto_20141104_1200... OK
Applying trans.0009_auto_20141110_1501... OK
Applying trans.0010_source_check_flags... OK
Applying trans.0011_auto_20141114_1008... OK
Applying trans.0012_translation_have_comment... OK
Applying trans.0013_auto_20141124_1036... OK
Applying trans.0014_auto_20141202_1101... OK
Applying trans.0015_auto_20141203_1345... OK
Applying trans.0016_auto_20141208_1029... OK
Applying trans.0017_auto_20150108_1424... OK
Applying trans.0018_auto_20150213_1447... OK
Applying trans.0019_auto_20150220_1354... OK
Applying trans.0020_auto_20150220_1356... OK
Applying trans.0021_auto_20150306_1605... OK
Applying trans.0022_auto_20150309_0932... OK
Applying trans.0023_project_owner... OK
Applying trans.0024_subproject_edit_template... OK
Applying trans.0025_subproject_post_update_script... OK
Applying trans.0026_auto_20150401_1029... OK
Applying trans.0027_auto_20150401_1030... OK
Applying trans.0028_auto_20150402_1430... OK

@JohnnyKing94
Copy link
Author

If you meant only Django, this is the log

(env)root@server:/var/www/my.website.com/weblate# pip install Django
Collecting Django
Using cached Django-1.8-py2.py3-none-any.whl
Installing collected packages: Django

Successfully installed Django-1.8

So i installed everything correctly, i don't know what could be

@nijel
Copy link
Member

nijel commented Apr 7, 2015

You might need to set WSGIPythonHome in Apache settings, see:
http://stackoverflow.com/questions/14927345/importerror-no-module-named-django-core-wsgi-apache-virtualenv-aws-wsgi

@JohnnyKing94
Copy link
Author

I already did it, i followed all your documentation on how to install, i copied the config apache file and edited for my site, here is mine

#
# VirtualHost for weblate
#
WSGIPythonPath /var/www/my.website.com/weblate
<VirtualHost *:80>
    ServerName my.website.com
    ServerAlias www.my.website.com
    ServerAdmin support@website.com

    DocumentRoot /var/www/my.website.com/weblate/weblate/media/

    Alias /robots.txt /var/www/my.website.com/weblate/weblate/media/robots.txt
    Alias /favicon.ico /var/www/my.website.com/weblate/weblate/media/favicon.ico

    Alias /media/ /var/www/my.website.com/weblate/weblate/media/
    Alias /doc/ /var/www/my.website.com/doc/packages/weblate/html/
    Alias /static/admin /var/www/my.website.com/env/lib/python2.7/site-packages/django/contrib/admin/static/admin/

    <Directory /var/www/my.website.com/env/lib/python2.7/site-packages/django/contrib/admin/static/admin/>
        Order deny,allow
        Allow from all
    </Directory>

    <Directory /var/www/my.website.com/weblate/weblate/media/>
        Order deny,allow
        Allow from all
    </Directory>

    <Directory /var/www/my.website.com/doc/packages/weblate/html/>
        Order deny,allow
        Allow from all
    </Directory>

    <Directory /var/www/my.website.com/weblate/weblate/examples/>
        Order deny,allow
        Allow from all
    </Directory>

    WSGIScriptAlias / /var/www/my.website.com/weblate/weblate/wsgi.py
    WSGIPassAuthorization On

    <Directory /var/www/my.website.com/weblate/weblate>
        <Files wsgi.py>
        Order deny,allow
        Allow from all
        </Files>
    </Directory>

</VirtualHost>

nijel added a commit that referenced this issue Apr 7, 2015
Issue #697

Signed-off-by: Michal Čihař <michal@cihar.com>
@nijel
Copy link
Member

nijel commented Apr 7, 2015

But the virtualenv path is missing there, it should be:

WSGIPythonPath /var/www/my.website.com/weblate:/var/www/my.website.com/env/lib/python2.7/site-packages

@JohnnyKing94
Copy link
Author

Thx now it works, i suggest to include this on your documentation for the ones are using an enviroment, cause there was no such line about this :D

Anyway now the error.log is spammed by these messages and i don't know how to prevent...

[Tue Apr 07 13:48:34 2015] [error] /var/www/my.website.com/env/lib/python2.7/site-packages/crispy_forms/utils.py:25: RemovedInDjango19Warning: memoize wrapper is deprecated and will be removed in Django 1.9. Use django.utils.lru_cache instead.
[Tue Apr 07 13:48:34 2015] [error]   default_field_template = memoize(default_field_template, {}, 1)
[Tue Apr 07 13:48:34 2015] [error] 
[Tue Apr 07 13:48:34 2015] [error] WARNING:py.warnings:/var/www/my.website.com/env/lib/python2.7/site-packages/crispy_forms/utils.py:25: RemovedInDjango19Warning: memoize wrapper is deprecated and will be removed in Django 1.9. Use django.utils.lru_cache instead.
[Tue Apr 07 13:48:34 2015] [error]   default_field_template = memoize(default_field_template, {}, 1)
[Tue Apr 07 13:48:34 2015] [error] 
[Tue Apr 07 13:48:34 2015] [error] /var/www/my.website.com/env/lib/python2.7/site-packages/crispy_forms/templatetags/crispy_forms_filters.py:20: RemovedInDjango19Warning: memoize wrapper is deprecated and will be removed in Django 1.9. Use django.utils.lru_cache instead.
[Tue Apr 07 13:48:34 2015] [error]   uni_formset_template = memoize(uni_formset_template, {}, 1)
[Tue Apr 07 13:48:34 2015] [error] 
[Tue Apr 07 13:48:34 2015] [error] WARNING:py.warnings:/var/www/my.website.com/env/lib/python2.7/site-packages/crispy_forms/templatetags/crispy_forms_filters.py:20: RemovedInDjango19Warning: memoize wrapper is deprecated and will be removed in Django 1.9. Use django.utils.lru_cache instead.
[Tue Apr 07 13:48:34 2015] [error]   uni_formset_template = memoize(uni_formset_template, {}, 1)
[Tue Apr 07 13:48:34 2015] [error] 
[Tue Apr 07 13:48:34 2015] [error] /var/www/my.website.com/env/lib/python2.7/site-packages/crispy_forms/templatetags/crispy_forms_filters.py:25: RemovedInDjango19Warning: memoize wrapper is deprecated and will be removed in Django 1.9. Use django.utils.lru_cache instead.
[Tue Apr 07 13:48:34 2015] [error]   uni_form_template = memoize(uni_form_template, {}, 1)
[Tue Apr 07 13:48:34 2015] [error] 
[Tue Apr 07 13:48:34 2015] [error] WARNING:py.warnings:/var/www/my.website.com/env/lib/python2.7/site-packages/crispy_forms/templatetags/crispy_forms_filters.py:25: RemovedInDjango19Warning: memoize wrapper is deprecated and will be removed in Django 1.9. Use django.utils.lru_cache instead.
[Tue Apr 07 13:48:34 2015] [error]   uni_form_template = memoize(uni_form_template, {}, 1)
[Tue Apr 07 13:48:34 2015] [error] 
[Tue Apr 07 13:48:34 2015] [error] /var/www/my.website.com/env/lib/python2.7/site-packages/crispy_forms/templatetags/crispy_forms_tags.py:197: RemovedInDjango19Warning: memoize wrapper is deprecated and will be removed in Django 1.9. Use django.utils.lru_cache instead.
[Tue Apr 07 13:48:34 2015] [error]   whole_uni_formset_template = memoize(whole_uni_formset_template, {}, 1)
[Tue Apr 07 13:48:34 2015] [error] 
[Tue Apr 07 13:48:34 2015] [error] WARNING:py.warnings:/var/www/my.website.com/env/lib/python2.7/site-packages/crispy_forms/templatetags/crispy_forms_tags.py:197: RemovedInDjango19Warning: memoize wrapper is deprecated and will be removed in Django 1.9. Use django.utils.lru_cache instead.
[Tue Apr 07 13:48:34 2015] [error]   whole_uni_formset_template = memoize(whole_uni_formset_template, {}, 1)
[Tue Apr 07 13:48:34 2015] [error] 
[Tue Apr 07 13:48:34 2015] [error] /var/www/my.website.com/env/lib/python2.7/site-packages/crispy_forms/templatetags/crispy_forms_tags.py:202: RemovedInDjango19Warning: memoize wrapper is deprecated and will be removed in Django 1.9. Use django.utils.lru_cache instead.
[Tue Apr 07 13:48:34 2015] [error]   whole_uni_form_template = memoize(whole_uni_form_template, {}, 1)
[Tue Apr 07 13:48:34 2015] [error] 
[Tue Apr 07 13:48:34 2015] [error] WARNING:py.warnings:/var/www/my.website.com/env/lib/python2.7/site-packages/crispy_forms/templatetags/crispy_forms_tags.py:202: RemovedInDjango19Warning: memoize wrapper is deprecated and will be removed in Django 1.9. Use django.utils.lru_cache instead.
[Tue Apr 07 13:48:34 2015] [error]   whole_uni_form_template = memoize(whole_uni_form_template, {}, 1)
[Tue Apr 07 13:48:34 2015] [error] 

@JohnnyKing94
Copy link
Author

and these ones too

[Tue Apr 07 13:48:32 2015] [error] /usr/local/lib/python2.7/dist-packages/South-0.7.6-py2.7.egg/south/modelsinspector.py:17: RemovedInDjango19Warning: django.contrib.contenttypes.generic is deprecated and will be removed in Django 1.9. Its contents have been moved to the fields, forms, and admin submodules of django.contrib.contenttypes.
[Tue Apr 07 13:48:32 2015] [error]   from django.contrib.contenttypes import generic
[Tue Apr 07 13:48:32 2015] [error] 
[Tue Apr 07 13:48:32 2015] [error] /var/www/my.website.com/env/lib/python2.7/site-packages/social/apps/django_app/default/models.py:29: RemovedInDjango19Warning: Model class social.apps.django_app.default.models.UserSocialAuth doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
[Tue Apr 07 13:48:32 2015] [error]   class UserSocialAuth(models.Model, DjangoUserMixin):
[Tue Apr 07 13:48:32 2015] [error] 
[Tue Apr 07 13:48:32 2015] [error] /var/www/my.website.com/env/lib/python2.7/site-packages/social/apps/django_app/default/models.py:67: RemovedInDjango19Warning: Model class social.apps.django_app.default.models.Nonce doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
[Tue Apr 07 13:48:32 2015] [error]   class Nonce(models.Model, DjangoNonceMixin):
[Tue Apr 07 13:48:32 2015] [error] 
[Tue Apr 07 13:48:32 2015] [error] /var/www/my.website.com/env/lib/python2.7/site-packages/social/apps/django_app/default/models.py:78: RemovedInDjango19Warning: Model class social.apps.django_app.default.models.Association doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
[Tue Apr 07 13:48:32 2015] [error]   class Association(models.Model, DjangoAssociationMixin):
[Tue Apr 07 13:48:32 2015] [error] 
[Tue Apr 07 13:48:32 2015] [error] /var/www/my.website.com/env/lib/python2.7/site-packages/social/apps/django_app/default/models.py:91: RemovedInDjango19Warning: Model class social.apps.django_app.default.models.Code doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
[Tue Apr 07 13:48:32 2015] [error]   class Code(models.Model, DjangoCodeMixin):
[Tue Apr 07 13:48:32 2015] [error] 

@nijel
Copy link
Member

nijel commented Apr 7, 2015

I've already added that to sample configuration in c75dcad.

As for the logs, it's again the same Python Social Auth issue as mentioned above.

@nijel
Copy link
Member

nijel commented Apr 7, 2015

...with exception for south which should not be used at all with current Weblate.

@JohnnyKing94
Copy link
Author

Sorry i didn't see :(

Anyway there are no tricks to prevent these errors/debugs to appear in my .log?

@JohnnyKing94
Copy link
Author

If I set DEBUG to False in the settings.py
does it change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken.
Projects
None yet
Development

No branches or pull requests

2 participants