Skip to content

OleksandrStepanov/EcoMap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Ecomap project (by LV-164.UI)

About this project

This repository is source code of the small web project, which is named 'EcoMap'. This website allows you to publish information about ecological issues around Ukraine to dynamic map. Officials of the Ministry of Environment use this website to collect info about problems and contact with citizens, who publish info to this website.
Website's url - ecomap.org

Dependencies

We're assumming that you're using bash & you already have installed such packages:

  • apt-get
    • sudo apt-get install mysql-server

Setupping database locally

  1. Clone this repository to your local machine
  2. Open file /etc/mysql/my.conf with following command: nano /etc/mysql/my.cnf
  3. Add following options to this file:
        [mysqld]
        default-character-set = utf8
        init_connect=‘SET collation_connection = utf8_unicode_ci’
        character-set-server = utf8
        collation-server = utf8_unicode_ci
    
    [client]
    default-character-set = utf8
    </pre>
    </li>
    <li>Go to 'path/to/repo/ecomap/DB/ecomap/' directory</li>
    <li>Run mysql shell: <code>mysql -u -p</code></li>
    <li>Run following command: <code>CREATE DATABASE ecomap_db CHARACTER SET utf8 COLLATE utf8_unicode_ci;</code> - this command will create database if it's not created yet. Put the name you want instead of 'ecomap_db'</li>
    <li>Run following command: <code>USE ecomap_db;</code> - this command will set the database you've created earilier as current. 
        Instead of ecomap_db put the name you've chosen earlier</li>
    <li>Run following command: <code>SOURCE CREATE_DB.sql;</code> - this command will create all tables for database</li>
    <li>Run following command: <code>SOURCE INSERT_DATA.sql;</code> - this command will populate all data you need for the beginning of work</li>
    <li>Now you have working Database!</li>
    

Ecomap application runs on Apache Web Server v2.4

This is a short manual, which tells how to configure WSGI-Flask application and Apache server on your server or local machine.

  1. Install Apache 2 and mod_wsgi lib:
    sudo apt-get install -y apache2
    sudo apt-get install libapache2-mod-wsgi
    sudo apt-get install libapache2-mod-wsgi python-dev
  2. Enable wsgi mod:
    sudo a2enmod wsgi
  3. Edit your hosts file to create server name alias
    sudo gedit /etc/hosts
    Add this line to th your host file: 127.0.1.2 ecomap.new
  4. Run following command:
    sudo gedit /etc/apache2/sites-available/ecomap.conf
    This command will create file ecomap.conf - this is config file of your site. You can set any name you want!
    Add content from apache.conf file, which is situated in - ecomap/etc/apache.conf to /etc/apache2/sites-available/ecomap.conf.
  5. Enable your site:
    sudo a2ensite ecomap
  6. Make your own copy of ecomap.wsgi (situated in ecomap/www/ecomap.wsgi). Also read comments in that file, since they are important! This is your main wsgi script which apache will use to run application. It has already configured for our project structure. You can set your own path to templates folder and you'll see test site.
  7. views.py - this is main flask application file. All backend code will be written there. You can change everything right now!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 46.6%
  • HTML 26.1%
  • JavaScript 18.9%
  • CSS 8.4%