Skip to content

krishnagopal596/urlslicer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Slicer - A Basic URL Shortener

This is a simple URL shortener built using the Python web framework Flask and an SQLite database.

Steps to Run Locally (Windows)

  1. Clone the repository:

    git clone https://github.com/krishnagopal596/urlslicer.git
    cd urlslicer
  2. Create a virtual environment:

    python -m venv venv
  3. Activate the virtual environment:

    .\venv\Scripts\Activate

    (You should see (venv) at the start of your prompt.)

  4. Install required packages:

    pip install -r requirements.txt
  5. Initialize the database:

    python urlslicer\init_db.py
  6. Create a .env file in the urlslicer folder (where app.py is located):

    FLASK_APP=app
    FLASK_ENV=development
    
  7. Run the Flask application from your project root folder:

    python -m flask run
  8. Open http://localhost:5000 in your browser to use the app.


Notes:

  • All commands after step 3 must be executed while the virtual environment is activated.
  • If you deploy to production, change FLASK_ENV=production in your .env file.
  • If you encounter issues with flask run, always try python -m flask run.

Usage

  • Enter a long URL in the input box and press Submit.
  • The shortened URL will appear below. Press Copy URL to copy it and paste it in another browser window.

Enjoy using URL Slicer!

About

A simple url shortener with Flask and Sqlite

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published