Giter VIP home page Giter VIP logo

urlshortener's Introduction

📎UrlShortener

This is an UrlShortener built with Flask and Postgresql.

portfolio-9

👨‍💻Installation

📄Pre-Requirements

  • Python Installed (Recommended version 3.8 or above)
  • Pip Package Manager (pip)

⚙️How to use it?

  1. Download this repository with git clone or by clicking the download as archive on this page

    git clone https://github.com/Fer-Bar/UrlShortener.git
    

    Go to the project directory.

    cd url_shortener
    
  2. Create a virtual environment:

    🪟Windows:

    py -m venv venv
    

    Once created you can activate it.

    venv\Scripts\activate.bat
    

    🐧Unix or MacOS:

    pip install virtualenv
    virtualenv venv
    

    Once created you can activate it.

    source venv/bin/activate
    
  3. Install dependencies with pip install -r requirements.txt. Make sure everything is installed properly with pip freeze.

  4. The last step is run the main.py file, if you want you can change the host and the port. For example:

    app.run(host='localhost', port=9000, debug=True)
    

🧪 Tests

  • To run tests, run the following command:

    python -m pytest -v
    

🔃Migrations

  • To run the migrations, just run the following commands:

    This command adds a migrations directory in the root of your project. This is a directory where all the migration scripts are going to be stored.

    flask db init
    

    The next step in the process is to create an initial migration, using the migrate command:

    flask db migrate -m "Initial migration."
    

    Then you can apply the migration to the database:

    flask db migrate -m "Initial migration."
    

😎 Author

👤 Fernando Barrientos

urlshortener's People

Contributors

fer-bar 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.