Giter VIP home page Giter VIP logo

engvocab's Introduction

Engvocab

A website to use during idle moments to learn the Italian translation of some English terms and expressions.

Created with Django and MySQL.

Local installation

  1. Clone the repository
  2. Install the dependencies
  3. Setup environment variables file template.env
  4. Setup MySQL database
  5. Run the server

2) Dependencies

You need to install the following packages:

Debian

  • Python

      $ sudo apt install python3 python3-pip
    
  • MySQL

      $ sudo apt install default-libmysqlclient-dev build-essential pkg-config mysql-server mysql-client
    
  • Python packages Go in the root directory of the project and run

      $ pip3 install -r requirements.txt
    

    If you get an error involving metadata warning like "WARNING: Generating metadata for package mysqlclient produced metadata for project name unknown." or "Requested unknown from https://... has inconsistent name: filename has 'mysqlclient', but metadata has 'unknown'"

    then you need to update pip:

      $ pip install --upgrade pip
    

Fedora

  • Python

      $ sudo dnf install python3 python3-pip python3-devel
    
  • MySQL

      $ sudo dnf install community-mysql-server community-mysql-devel
    
  • Python packages Go to the root directory of the project and run

      $ pip3 install -r requirements.txt
    

3) Environment variables file

Fill the template.env file. This is an example:

DB_ENGINE=django.db.backends.mysql
DB_NAME=mydatabase
DB_USER=django
DB_PASSWORD=''
DB_HOST=127.0.0.1
DB_PORT=3306
DB_SECRET_KEY="i02$0g@6q!3gx%v2zzorh#7k&5!vk=&%k$jm!jr^a7e8d)e*0%9"
DB_DEBUG=1

Note that the value given to DB_NAME, DB_USER, DB_PASSWORD must match with the corresponding field when we will configure the database.

Rename template.env to simply .env

4) Setup MySQL database

Start the MySQL server with one of the following command based on your system:

  • op1:

      $ sudo systemctl start mysqld
    
  • op2:

      $ sudo service mysql start
    

Then open a MySQL monitor with the following command:

$ sudo mysql -u root -p

and enter your root password.

Now in the MySQL command line run the following three commands:

> create user '<username>'@'localhost' identified by '<password>';

Note: the username and the password must be the same as the ones specified the the environment variables file, in this case, for example must be:

> create user 'django'@'localhost' identified by '';

then grant all the privileges to the user just created:

> grant usage on *.* to 'django'@'localhost';
> grant all privileges on *.* to 'django'@'localhost';

always remember to use the right username.

Now let's create the database:

> create database mydatabase;

Even in this case the may must match the one given in the environment variables file.

Make Django create the tables: Go to the root directory of the project and run:

$  python3 manage.py migrate

Finally fill the tables with some stuff from the db_example.sql file:

$ sudo mysql -u root -p mydatabase < db_example.sql

5) Run the server

Run the server with the following command:

$ python3 manage.py runserver

Future updates (if time permits)

  • make the shell interactive
  • add the possibility to change username and password
  • allow users to report errors in the expressions
  • Show confidence progress for each expressions

engvocab's People

Contributors

gabritorre avatar dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.