Giter Site home page Giter Site logo

tornado's Introduction

Tornado project

Author: Mohammad Hadi Hajihosseini

A RESTful api created using tornado.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

  • python
  • mysql
sudo apt install python mysql

Requirement

You need to install these packages to run the server.py file.

  • tornado
  • hexlify (to generate random token)
pip install tornado hexlify

Installing

Step0 : Cloning

First of All Clone the Project :

$ git clone https://github.com/hadiMh/tornado.git
$ cd tornado

Step1 : Connect to MySQL and create a database

Connect to MySQL as a user that can create databases and users:

$ mysql -u root

Create a database named "ticketsapp":

mysql> CREATE DATABASE ticketsapp;

Allow the "myAadmin" user to connect with the password "myAdmin":

mysql> GRANT ALL PRIVILEGES ON myAadmin.* TO 'myAadmin'@'localhost' IDENTIFIED BY 'myAadmin';

Step2 : Create the tables in your new database

open the whole project file in the PyCharm IDE and connect the IDE to mysql database for this project. Then create two tables in it, first the users table, and second the tickets table.

Then now you Must Put Database information in mydb.py from line 5 10

notice that I used an environmental variable to store the databese password. If you wanna publish your code or show it to some people it is better to make secret and sensitive information as env variables to make them secure.

Step3 : Run the ticketsapp project

With the default user, password, and database you can just run:

$ python server.py

I wish you enjoy this code.

License

  • MIT license
  • Copyright 2019 © TicketsApp Project.

tornado's People

Contributors

hadimh avatar

Stargazers

Sina Lalebakhsh avatar elhamgholami1995 avatar

Watchers

James Cloos avatar

Forkers

shabnammrz

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.