Unknown command: 'collectstatic'
  • Hi,

    I want to install objavi server and when i execute de postinstall script i have an "Unknown command: 'collectstatic'".

    My  django-admin.py version is 1.5.1 .... can you help me ?

    Thanks

    --
    stef
  • 37 Comments sorted by
  • Hi!

    Current version is not compatible with Django 1.5 (New development version 2.0 is compatible with 1.5 and 1.6). You need older version of Django to make it work. Check requirements/_base.txt and requirements/postgresql.txt files for correct versions. It would be best if you install it inside of virtual environment so you don't have problems with different version numbers.

    Aco
  • Ok .... is it better i install Objavi 2.6 ?

    --
    stef
  • Ok i have installed objavi with no error .... django is in a virtual environment.But when i want to use BookType with Objavi to publish my book i have "Unknown error while trying to publish this book".In settings.py i have
    OBJAVI_URL = "http://127.0.0.1/objavi_site/"

    Can you help me ,

    --
    stef
  • What do you see when you go to 127.0.0.1/objavi_site?
  • I see the directory of my objavi_site (attach file) ... i think it's not good for a web site ...

    --
    stef

    507 x 611 - 62K
  • No, it is not good.  It appears that you haven't configured the Apache server for Objavi properly.
  • My apache error.log said :
    [Wed Jul 24 19:22:18 2013] [error] python_init: Python version mismatch, expected '2.7.2+', found '2.7.5+'.
    [Wed Jul 24 19:22:18 2013] [error] python_init: Python executable found '/usr/bin/python'.
    [Wed Jul 24 19:22:18 2013] [error] python_init: Python path being used '/usr/lib/python2.7/:/usr/lib/python2.7/plat-i386-linux-gnu:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload'.
    [Wed Jul 24 19:22:18 2013] [notice] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads.
    [Wed Jul 24 19:22:18 2013] [notice] mod_python: using mutex_directory /tmp
    [Wed Jul 24 19:22:18 2013] [warn] mod_wsgi: Compiled for Python/2.7.2+.
    [Wed Jul 24 19:22:18 2013] [warn] mod_wsgi: Runtime using Python/2.7.5+.
    [Wed Jul 24 19:22:18 2013] [notice] Apache/2.2.22 (Debian) mod_fastcgi/mod_fastcgi-SNAP-0910052141 PHP/5.4.4-15.1 proxy_html/3.0.1 mod_python/3.3.1 Python/2.7.5+ mod_wsgi/3.3 mod_perl/2.0.8 Perl/v5.14.2 configured -- resuming normal operations

    But i don't know what i have to do :(

    --
    stef
  • The error log warns that mod_wsgi is compiled using Python runtime 2.7.2, while the system provides Python 2.7.5.  Not sure if this is the culprit in this case; probably isn't.

    I would wager that you haven't configured the Apache virtual host for Objavi correctly.  Are you using the configuration file provided by the "create_site" script?  Is Booktype installed on the same host?
  • I have configured  virtualhost for objavi with the file apache.conf which is in the /var/www/objavi_site. Le folder objavi_site was created with :
    ./scripts/create_site --with-booktype=/usr/local/src/mybooktype/Booktype /var/www/objavi_site

    I have moved this apache2.conf in the /etc/apache2/sites-available/objavi and execute a2ensite objavi. I have restarted apache2 without errors.
    Objavi and BookType are in the same host ....

  • If you used the generated apache.conf file, then the OBJAVI_URL is "http://127.0.0.1/".  The problem here is that both Booktype and Objavi correspond to this same address.  You can get around this problem by using ServerName directive in virtual host configurations for Objavi and Booktype.

  • I don't understand .... my booktype run in localhost:8080 (no apache configuration) and objavi in localhost/objavi_site. Then in settings.py OBJAVI_URL = "http://127.0.0.1/objavi_site"
    Post edited by leblond at 2013-07-25 08:57:19
  • If you used the provided apache.conf file for Objavi, then Objavi is not on localhost/objavi_site but on localhost/. Did you tweak the configuration file?

    What do you see in the web browser when you open http://localhost/
  • This is my configuration file :

    <VirtualHost *:80>
        SetEnv LC_TIME "en_GB.UTF-8"
        SetEnv LANG "en_GB.UTF-8"

        WSGIScriptAlias /         /var/www/objavi_site/wsgi.py
        Alias           /static   /var/www/objavi_site/static
        Alias           /data     /var/www/objavi_site/data

        <Location "/">
            Allow from all
            Options FollowSymLinks
        </Location>

        <Directory "/var/www/objavi_site/static">
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
        </Directory>

        <Directory "/var/www/objavi_site/data">
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
        </Directory>

            ErrorLog  ${APACHE_LOG_DIR}/objavi-error.log
            CustomLog ${APACHE_LOG_DIR}/objavi-access.log combined
            LogLevel  warn

    In localhost i see :

    It works!


    This is the default web page for this server.


    The web server software is running but no content has been added, yet.



  • Disable the default web site using "a2dissite default" and reload.
  • It doesn't work (objavi said   internal server error) but i have somes messages in the objavi-error.log :

    [Thu Jul 25 15:37:44 2013] [error] [client 127.0.0.1] mod_wsgi (pid=28042): Target WSGI script '/var/www/objavi_site/wsgi.py' cannot be loaded as Python module.
    [Thu Jul 25 15:37:44 2013] [error] [client 127.0.0.1] mod_wsgi (pid=28042): Exception occurred processing WSGI script '/var/www/objavi_site/wsgi.py'.
    [Thu Jul 25 15:37:44 2013] [error] [client 127.0.0.1] Traceback (most recent call last):
    [Thu Jul 25 15:37:44 2013] [error] [client 127.0.0.1]   File "/var/www/objavi_site/wsgi.py", line 8, in <module>
    [Thu Jul 25 15:37:44 2013] [error] [client 127.0.0.1]     import django.core.handlers.wsgi
    [Thu Jul 25 15:37:44 2013] [error] [client 127.0.0.1] ImportError: No module named django.core.handlers.wsgi
  • What version of Django do you have installed?  Go to /var/www/objavi_site, and there run the following commands:

    python manage.py shell
    import django
    print django.get_version()

  • python manage.py shell
    Python 2.7.5+ (default, Jun  2 2013, 21:21:29)
    [GCC 4.7.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    (InteractiveConsole)
    >>> import django
    >>> print django.get_version()
    1.3
    >>>

  • Ok, so you mentioned that you have Django in a virtual environment.  In that case the mod_wsgi should be using the Python interpreter from that virtual environment and not the system one.  You should be using the WSGIPythonHome directive in the apache.conf file to specify the Python system.

  • I don't know exectly how to use this directive. So i have put in my apache configuration file this instructions :
    WSGIPythonHome /usr/local/src/mybooktype
    WSGIPythonPath /usr/local/src/mybooktype/lib/python2.7/site-packages

    But it doesn't work. So the response is :
    Page not found (404)

    Request Method: GET Request URL: http://127.0.0.1/objavi_site/





    Using the URLconf defined in objavi.urls,
    Django tried these URL patterns, in this order:




    1. ^admin/doc/




    2. ^admin/




    3. ^


      ^$




    4. ^


      ^css$




    5. ^


      ^booklist$




    6. ^


      ^fontlist$




    7. ^


      ^espri$



    The current URL, objavi_site/, didn't match any of these.



    Post edited by leblond at 2013-07-25 10:45:17
  • Actually, it appears to be working.  The URL you tried, http://127.0.0.1/objavi_site/, is not valid.  Try "http://127.0.0.1/"

  • Sorry but when i try http/127.0.0.1 or localhost, the response is :

    It works!


    This is the default web page for this server.


    The web server software is running but no content has been added, yet.


  • This is the page that is served by the "default" web site that serves static content from the /var/www directory.  The message you see is in the /var/www/index.html file.  If you see this page, it means that the default web site is not disabled.  Disable it, restart the apache service.  Then visit the "http://127.0.0.1" page, reload it a few times.
  • YEEESS ... i access to objavi ... the default web wasn't in sites-enable but in sites-available. I have remove it by hand.
    But now when i try to publish my book (pdf for example) with booktype, it said  Please wait. It will take couple of moments. Your book is being generated.
    In my settings.py i have put OBJAVI_URL = "http://127.0.0.1"

  • Both Objavi and Booktype have settings.py.  Which one is this?  In Booktype's make sure OBJAVI_URL and THIS_BOOKI_SERVER are correct.
  • Sorry, it is the settings.py of booktype  :
    - OBJAVI_URL = "http://127.0.0.1"
    - THIS_BOOKI_SERVER = "http://localhost:8080"

    Post edited by leblond at 2013-07-25 11:50:21
  • Remove the "http://" from THIS_BOOKI_SERVER, so it looks like this:

    THIS_BOOKI_SERVER = "localhost:8080"
  • I have already try it but it doesn't work
  • But my objavi doesn't work :(  ... when i try to publish a book, nothing happend
  • Check the logs, for both Booktype and Objavi, to see where it got stuck.
  • I have nothing in booktype-access.log and booktype-error.org.
    In objavi-error.log i have just 127.0.0.1 - - [25/Jul/2013:18:15:32 +0200] "GET /?server=www.booki.cc&book=null&mode=booklist HTTP/1.1" 200 27381 "http://127.0.0.1/" "Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20130719 Firefox/24.0 Iceweasel/24.0a2"
    In apache errors.log, when i try to access to objavi, i have :

    [Thu Jul 25 18:15:32 2013] [error] getting booklist: http://www.booki.cc/list-books.json

  • Start the supervisorclt program and make sure that objavi-celery-worker and objavi-celery-camera programs are running.
  • objavi-celery-camera             FATAL      Exited too quickly (process log may have details)
    objavi-celery-worker             FATAL      Exited too quickly (process log may have details)


  • My objavi-error.log said nothing and objavi-access.log said :
    127.0.0.1 - - [27/Jul/2013:16:34:19 +0200] "GET /?server=www.booki.cc&book=null&mode=booklist HTTP/1.1" 200 27381 "http://127.0.0.1/" "Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20130719 Firefox/24.0 Iceweasel/24.0a2"

    My apache error.log said : [Sat Jul 27 16:34:19 2013] [error] getting booklist: http://www.booki.cc/list-books.json

     
  • Logs for Celery worker and camera are in /var/log/supervisor.  See what's keeping them from starting.
  • I just remembered that you are using a virtual environment for running Objavi.  In this case Celery workers should also be started with Python interpreter from the virtualenv.  Edit the /etc/supervisor/conf.d/objavi.conf file and make sure that /usr/local/src/mybooktype/bin/python is used for the "command = ..." entries.
  • I saw in /var/log/supervisor/supervisord.log :

    2013-07-25 17:56:23,489 INFO spawned: 'objavi-celery-worker' with pid 5792
    2013-07-25 17:56:23,507 INFO exited: objavi-celery-worker (exit status 1; not expected)
    2013-07-25 17:56:24,508 INFO gave up: objavi-celery-worker entered FATAL state, too many start retries too quickly

    But totay, nothing in the log ...

    In /etc/supervisor/conf.d/objavi.conf,  /usr/local/src/mybooktype/bin/python is now used ... but objavi doesn't work

  • Don't forget to "reload" the supervisor configuration after you make changes to its configuration file, for changes to take effect.

    There should be individual log files for objavi-celery-worker and objavi-celery-camera, both for stderr and stdout, in the /var/log/supervisor directory.  See what they say after you reload and restart, like this:

    sudo supervisorctl
    reload
    start all