<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="http://jekyllrb.com" version="3.3.1">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2017-02-23T20:32:13+00:00</updated><id>/</id><title type="html">SmartCities LivingLab UdeG</title><subtitle>Descripción de ejemplo de la página de GitHub de SmartCities LivingLab
</subtitle><entry><title type="html">SmartCheckIn</title><link href="/livinglab/web/checkin/2017/02/22/SmartCities-CheckIn.html" rel="alternate" type="text/html" title="SmartCheckIn" /><published>2017-02-22T20:27:16+00:00</published><updated>2017-02-22T20:27:16+00:00</updated><id>/livinglab/web/checkin/2017/02/22/SmartCities-CheckIn</id><content type="html" xml:base="/livinglab/web/checkin/2017/02/22/SmartCities-CheckIn.html">&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#smart-check-in&quot; id=&quot;markdown-toc-smart-check-in&quot;&gt;Smart Check In&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#instalación&quot; id=&quot;markdown-toc-instalación&quot;&gt;Instalación&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;smart-check-in&quot;&gt;Smart Check In&lt;/h1&gt;

&lt;p&gt;Proyecto para Smart Check In del CICI en CUCEA&lt;/p&gt;

&lt;h2 id=&quot;instalación&quot;&gt;Instalación&lt;/h2&gt;
&lt;p&gt;Es necesario contar con Python2.7, pip, npm y bower instalado.&lt;br /&gt;
Las bases de datos necesarias son PostgreSQL y MongoDB, para conectar a Python con PostgreSQL (&lt;code class=&quot;highlighter-rouge&quot;&gt;$ sudo apt-get update &amp;amp; sudo apt-get install -y postgresql postgresql-contrib&lt;/code&gt;) es necesario tener instalado &lt;code class=&quot;highlighter-rouge&quot;&gt;python-psycopg2&lt;/code&gt;, además del motor de geometría &lt;code class=&quot;highlighter-rouge&quot;&gt;postgis&lt;/code&gt;.&lt;br /&gt;
Además se puede usar &lt;code class=&quot;highlighter-rouge&quot;&gt;virtualenv&lt;/code&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo apt-get install python-psycopg2 libpq-dev postgis&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Ahora es necesario crear un usuario y una base de datos:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;El nombre de la base de datos y el usuario tienen que estar en minúsculas, ejemplo db: &lt;code class=&quot;highlighter-rouge&quot;&gt;prueba_flask&lt;/code&gt; usuario: &lt;code class=&quot;highlighter-rouge&quot;&gt;mi_usuario&lt;/code&gt;, y de igual manera en el archivo de configuración.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo -u postgres psql postgres&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-psql&quot; data-lang=&quot;psql&quot;&gt;postgres=# CREATE DATABASE tu_base_de_datos;
postgres=# CREATE ROLE nombre_usuario LOGIN PASSWORD 'tu_password';
postgres=# GRANT ALL PRIVILEGES ON DATABASE tu_base_de_datos TO nombre_usuario;
postgres=# \q&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo -u postgres psql tu_base_de_datos&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-psql&quot; data-lang=&quot;psql&quot;&gt;tu_base_de_datos=# CREATE EXTENSION postgis;
tu_base_de_datos=# \q&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Ahora se tiene que editar el archivo &lt;code class=&quot;highlighter-rouge&quot;&gt;app/config_sample.py&lt;/code&gt;, y cambiar los datos de la base de datos que nosotros creamos, y lo guardamos como &lt;code class=&quot;highlighter-rouge&quot;&gt;app/config.py&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Después es necesario instalar las dependencias:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;npm install
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;virtualenv env
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;source &lt;/span&gt;env/bin/activate
&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;env&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;pip install -r requirements.txt&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Por último se corre la aplicación, se pueden ver las opciones de ejecución con el siguiente comando:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python run.py -h
usage: run.py &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;-h] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;--debug DEBUG] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;--host HOST] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;--port PORT] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;--threaded THREADED]

optional arguments:
  -h, --help            show this &lt;span class=&quot;nb&quot;&gt;help &lt;/span&gt;message and &lt;span class=&quot;nb&quot;&gt;exit&lt;/span&gt;
  --debug DEBUG, -d DEBUG
                        True &lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;you want to debug your app
  --host HOST, -H HOST  The host where you want to run your app
  --port PORT, -p PORT  The port where you want to serve your app
  --threaded THREADED, -t THREADED
                        Only &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;developer mode&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content><author><name></name></author><summary type="html"></summary></entry></feed>