New question #264888 on Graphite:
https://answers.launchpad.net/graphite/+question/264888

I'm trying to setup the graphite webapp. I had no problems installing whisper 
and carbon, but am stuck at getting the webapp up and running. A few issues 
that I'm having are the following:
- When running "python manage.py syncdb" I get a stacktrace with the error 
"ImportError: No module named graphite.settings"
- When running "django-admin.py collectstatic --noinput 
--settings=graphite.settings" it prints a stack trace which basically just says 
"ImportError: No module named graphite.settings"

I've installed everything from source, installed the requirements defined in 
the requirements.txt file through pip and set up my Apache installation. Here 
are the versions that I'm running:
graphite-web: 
https://github.com/graphite-project/graphite-web/commit/2603222535a6e73f52c8df3482bd8e38971eed25
python: 2.7.6
apache: 2.4.7
django: 1.6.0 (although I tried 1.7 and 1.8 with the same results)

This is my 000-default.conf virtual host file:
WSGISocketPrefix /var/run/apache2/wsgi

<VirtualHost *:80>
        ServerName graphite
        DocumentRoot "/opt/graphite/webapp"
        ErrorLog /opt/graphite/storage/log/webapp/error.log
        CustomLog /opt/graphite/storage/log/webapp/access.log common

        # I've found that an equal number of processes & threads tends
        # to show the best performance for Graphite (ymmv).
        WSGIDaemonProcess graphite processes=5 threads=5 
display-name='%{GROUP}' inactivity-timeout=120
        WSGIProcessGroup graphite
        WSGIApplicationGroup %{GLOBAL}
        WSGIImportScript /opt/graphite/conf/graphite.wsgi 
process-group=graphite application-group=%{GLOBAL}

        # XXX You will need to create this file! There is a 
graphite.wsgi.example
        # file in this directory that you can safely use, just copy it to 
graphite.wgsi
        WSGIScriptAlias / /opt/graphite/conf/graphite.wsgi


        # XXX To serve static files, either:
        # * Install the whitenoise Python package (pip install whitenoise)
        # * Collect static files in a directory by running:
        #     django-admin.py collectstatic --noinput 
--settings=graphite.settings
        #   And set an alias to serve static files with Apache:
        Alias /static/ /opt/graphite/static/
        <Directory "/opt/graphite/static">
                Options Indexes FollowSymLinks Includes ExecCGI
                AllowOverride All
                Require all granted
                Allow from all
        </Directory>

        ########################
        # URL-prefixed install #
        ########################
        # If using URL_PREFIX in local_settings for URL-prefixed install (that 
is not located at "/"))
        # your WSGIScriptAlias line should look like the following (e.g. 
URL_PREFX="/graphite"

        #WSGIScriptAlias /graphite /srv/graphite-web/conf/graphite.wsgi/graphite
        #Alias /graphite/static /opt/graphite/webapp/content
        #<Location "/graphite/static/">
        #    SetHandler None
        #</Location>


        # XXX In order for the django admin site media to work you
        # must change @DJANGO_ROOT@ to be the path to your django
        # installation, which is probably something like:
        # /usr/lib/python2.6/site-packages/django
        Alias /media/ 
"/.virtualenvs/graphite-web/lib/python2.7/site-packages/django/contrib/admin/media/"

        # The graphite.wsgi file has to be accessible by apache. It won't
        # be visible to clients because of the DocumentRoot though.
        <Directory /opt/graphite/conf/>
                <IfVersion < 2.4>
                        Order deny,allow
                        Allow from all
                </IfVersion>
                <IfVersion >= 2.4>
                        Require all granted
                </IfVersion>
        </Directory>

</VirtualHost>

As you can see I had to add access to the /opt/graphite/static/ directory by 
adding the Directory directive, if not it would give me a 403 forbidden message.

When browsing to http://localhost I am greeted with just the top black bar with 
the links to "Login, Documentation, Dashboard, events" but nothing else on the 
page. The web inspector shows all requests to the /static/ map failing with a 
404. I understand this is not weird because I can't compile the static files.
Furthermore, when inspecting the error.log file all I'm getting is this:
[Thu Apr 09 11:24:41.891172 2015] [wsgi:error] [pid 18496] 
/usr/local/lib/python2.7/dist-packages/tagging/managers.py:11: 
RemovedInDjango18Warning: `ModelTagManager.get_query_set` method should be 
renamed `get_queryset`.
[Thu Apr 09 11:24:41.891194 2015] [wsgi:error] [pid 18496]   class 
ModelTagManager(models.Manager):
[Thu Apr 09 11:24:41.891199 2015] [wsgi:error] [pid 18496]

I've tried chown'ing the /opt/graphite/ directory recursively to the apache 
user (www-data), myself and even root, but with no changes. I feel like I'm 
missing something very basic but I can't seem to figure out what. Is this a bug 
or am I just fucking up?

-- 
You received this question notification because you are a member of
graphite-dev, which is an answer contact for Graphite.

_______________________________________________
Mailing list: https://launchpad.net/~graphite-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~graphite-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to