eggDiscover / documentation / build / install.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Installation &mdash; EggDiscover 0.1 documentation</title>
    
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '0.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="EggDiscover 0.1 documentation" href="index.html" />
    <link rel="next" title="Followerslookup" href="followerslookup.html" />
    <link rel="prev" title="Welcome to EggDiscover’s documentation!" href="index.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="followerslookup.html" title="Followerslookup"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Welcome to EggDiscover’s documentation!"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">EggDiscover 0.1 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="installation">
<h1>Installation<a class="headerlink" href="#installation" title="Permalink to this headline"></a></h1>
<div class="section" id="requirements">
<h2>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline"></a></h2>
<p>To run Egdiscover you will need :</p>
<ol class="arabic simple">
<li>Virtualenv</li>
<li>Pip</li>
<li>RabbitMQ</li>
</ol>
</div>
<div class="section" id="get-the-needed-modules">
<h2>Get the needed modules<a class="headerlink" href="#get-the-needed-modules" title="Permalink to this headline"></a></h2>
<p>You will need to create a virtualenv on your system :</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">virtualenv</span> <span class="n">environment</span>
</pre></div>
</div>
<p>Then go in the created virtualenv and activate it</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">cd</span> <span class="n">environment</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">source</span> <span class="nb">bin</span><span class="o">/</span><span class="n">activate</span>
</pre></div>
</div>
<p>And copy the project somewhere in your file system</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">hg</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">bitbucket</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">boblefrag</span><span class="o">/</span><span class="n">eggdiscover</span> <span class="o">.</span>
</pre></div>
</div>
<p>Go in the created directory :</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">cd</span> <span class="n">eggdiscover</span>
</pre></div>
</div>
<p>And install the requirements</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">pip</span> <span class="n">install</span> <span class="n">requirements</span><span class="o">.</span><span class="n">txt</span>
</pre></div>
</div>
</div>
<div class="section" id="configure-your-application">
<h2>Configure your application<a class="headerlink" href="#configure-your-application" title="Permalink to this headline"></a></h2>
<p>1) create a broker v_host and a broker user as explained in the
RabbitMQ documentation. Give this user access to the broker vost</p>
<p>2) created a database. You can use PostgreSQL or MySQL for
exemple. SQLite cannot be used as concurent write will be used.</p>
<p>3) Edit local_settings.py and change the values of DATABASES to match
your configuration and edit BROKER part to match your broker
installation.</p>
</div>
<div class="section" id="create-a-twitter-application">
<h2>Create a Twitter application<a class="headerlink" href="#create-a-twitter-application" title="Permalink to this headline"></a></h2>
<p>In order to be able to make request upon the twitter REST API, you
will need a twitter application. Go on the twitter site and create
your application.</p>
<p>Twitter will give you a consumer key and a consumer secret. put this
informations in TWITTER_CONSUMER_KEY and TWITTER_CONSUMER_SECRET</p>
<p>=
Create the databases tables
===========================</p>
<p>To init your database you need to run in the root of your project :</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">python</span> <span class="n">manage</span><span class="o">.</span><span class="n">py</span> <span class="n">syncdb</span>
</pre></div>
</div>
<p>This will create tables Django need to run properly. Django will ask
you for creating a superuser account. type yes and create the
account. You will need it to connect to the admin page.</p>
<p>Then run the migrations, migrations are a way to update the structure
of databases tables when it is needed.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">python</span> <span class="n">manage</span><span class="o">.</span><span class="n">py</span> <span class="n">migrate</span>
</pre></div>
</div>
</div>
<div class="section" id="get-a-twitter-connect">
<h2>Get a twitter connect<a class="headerlink" href="#get-a-twitter-connect" title="Permalink to this headline"></a></h2>
<p>To make request on the twitter API, you need an application (created
above) and a user authorizing the application. To authorize the
application with your account, the simplest thing to do is to run the
development server :</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">python</span> <span class="n">manage</span><span class="o">.</span><span class="n">py</span> <span class="n">runserver</span>
</pre></div>
</div>
<p>And open your browser on <a class="reference external" href="http://localhost:8000/">http://localhost:8000/</a></p>
<p>And follow the instructions on the pages.</p>
<p>Once you authorize your application, you can go to :</p>
<p><a class="reference external" href="http://localhost:8000/admin/twitteruser/">http://localhost:8000/admin/twitteruser/</a></p>
<p>And add a twitter user you want to lookup.</p>
<p>You can then close your &#8220;runserver&#8221;</p>
</div>
<div class="section" id="launch-celery">
<h2>Launch Celery<a class="headerlink" href="#launch-celery" title="Permalink to this headline"></a></h2>
<p>Fetching all followers for a particular account can be time
consuming. For this reason, you might want to let eggDiscover do this
in the background. Simply launch celery and it will use your account
to fetch information about followers of each &#8220;twitter_account&#8221; you&#8217;ve
setted in the django admin site.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">python</span> <span class="n">manage</span><span class="o">.</span><span class="n">py</span> <span class="n">celeryd</span> <span class="o">-</span><span class="n">B</span> <span class="o">-</span><span class="n">l</span> <span class="n">info</span>
</pre></div>
</div>
</div>
<div class="section" id="what-to-do-next">
<h2>What to do next ?<a class="headerlink" href="#what-to-do-next" title="Permalink to this headline"></a></h2>
<p>At this point, you can either configure apache to run your project or
simply use the development server for personnal use :</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">python</span> <span class="n">manage</span><span class="o">.</span><span class="n">py</span> <span class="n">runserver</span>
</pre></div>
</div>
<p>To fetch twitter, eggDiscover doesn&#8217;t need the server beeing
runing. The server is only needed to see the fetching process :</p>
<p><a class="reference external" href="http://localhost:8000/monitoring">http://localhost:8000/monitoring</a></p>
<p>And to get the result of the fetch with filters and differents
formats. Don&#8217;t forget that it is always possible to use wget to gather
auto-generated CSV files. see <a class="reference external" href="http://localhost:8000/results/">http://localhost:8000/results/</a> for
informations and uses.</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Installation</a><ul>
<li><a class="reference internal" href="#requirements">Requirements</a></li>
<li><a class="reference internal" href="#get-the-needed-modules">Get the needed modules</a></li>
<li><a class="reference internal" href="#configure-your-application">Configure your application</a></li>
<li><a class="reference internal" href="#create-a-twitter-application">Create a Twitter application</a></li>
<li><a class="reference internal" href="#get-a-twitter-connect">Get a twitter connect</a></li>
<li><a class="reference internal" href="#launch-celery">Launch Celery</a></li>
<li><a class="reference internal" href="#what-to-do-next">What to do next ?</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="index.html"
                        title="previous chapter">Welcome to EggDiscover&#8217;s documentation!</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="followerslookup.html"
                        title="next chapter">Followerslookup</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/install.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="followerslookup.html" title="Followerslookup"
             >next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Welcome to EggDiscover’s documentation!"
             >previous</a> |</li>
        <li><a href="index.html">EggDiscover 0.1 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2012, Yohann Gabory.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
    </div>
  </body>
</html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.