Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Warrick Newsgroups: comp.lang.python Subject: Re: WP-A: A New URL Shortener Date: Thu, 17 Mar 2016 17:05:47 +0100 Lines: 77 Message-ID: References: <1537bd9e261.12a0e5b4a204345.4468160629979098801@vmesel.com> <9727BC5A-67B2-49A6-9AFF-8C244A53300C@vmesel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de d2N1gd/SalXYbV2zHMnA6QSUh+z1UFwK3cZ5Lv2nzIVQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'exercise': 0.03; 'schema': 0.05; 'bootstrap': 0.07; 'formatting': 0.07; 'answering': 0.09; 'corrections': 0.09; 'git': 0.09; 'imports': 0.09; 'sql,': 0.09; 'sqlite': 0.09; 'statements': 0.09; 'url:github': 0.09; '\xe2\x80\x94': 0.09; 'python': 0.10; 'django': 0.13; 'commit': 0.15; '2016': 0.16; 'chris,': 0.16; 'git.': 0.16; 'guys,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'said.': 0.16; 'sees': 0.16; 'stored.': 0.16; 'subject:URL': 0.16; 'ugly.': 0.16; 'wrote:': 0.16; 'contribute': 0.16; 'string': 0.17; 'version.': 0.18; 'programmer': 0.18; '>>>': 0.20; 'hey': 0.20; 'to:2**1': 0.21; 'written': 0.24; 'header:In-Reply-To:1': 0.24; 'script': 0.25; 'chris': 0.26; 'checking': 0.27; 'coding': 0.27; 'message- id:@mail.gmail.com': 0.27; 'said,': 0.27; 'bad.': 0.29; 'project:': 0.29; "i'm": 0.30; 'url:mailman': 0.30; 'code': 0.30; 'at:': 0.31; 'everyone': 0.31; 'source': 0.33; 'url:python': 0.33; 'message.': 0.33; "i'll": 0.33; 'url:listinfo': 0.34; 'add': 0.34; 'list': 0.34; 'received:google.com': 0.35; 'stable': 0.35; 'quite': 0.35; 'something': 0.35; 'received:74.125.82': 0.35; 'community': 0.36; 'should': 0.36; 'project': 0.36; 'url:org': 0.36; 'framework': 0.36; 'projects.': 0.36; 'urls': 0.36; 'to:addr :python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'thanks': 0.37; 'wanted': 0.37; 'mean': 0.38; 'subject:-': 0.39; 'url:mail': 0.40; 'to:addr:python.org': 0.40; 'some': 0.40; 'software': 0.40; 'future': 0.60; 'your': 0.60; 'share': 0.61; 'avoid': 0.61; 'replying': 0.61; 'show': 0.62; 'great': 0.63; 'march': 0.64; 'url:co': 0.65; 'mar': 0.65; 'today': 0.65; 'decided': 0.66; 'yourself': 0.73; '(hint:': 0.84; 'find.': 0.84; 'hour,': 0.84; 'meu': 0.84; 'working,': 0.84; '1:18': 0.91; 'different.': 0.91; 'you\xe2\x80\x99re': 0.91; 'ipad': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-transfer-encoding; bh=v6772SGTtyd+VvOax3ZYL/10YmErLjv8T3Uc7qjFsbE=; b=zmRUGDUm7scn6xlP/5fodwP/NHNa/wDKOMfel3pBjrULa4+xL/OmrYhnZ5sNXVWTRK ICAhkjJxT8ImXC14nkAB3mcuxNHTxn0On8NBZdvQkRhFmL4zE50mEp4fydczUpbPw4LF t5L7J9MxnKCgr+jwXMYnCK94QcTUJTND/0hogMoJejV19bBKtX9pKE7SlXsoMJ+BPAnT DFiyhZwnOlRU15MXtcvhO29wcooAw8OlBP6fkZQrZz9jIYFYIwrag/FIOT76LapjtTYN AzbWglQ/ixKow74Fid5CqWJJ55fSljsSbMcJral+znfmEGZUxts9r11R5PKXSV+C+Rzc 1mdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-transfer-encoding; bh=v6772SGTtyd+VvOax3ZYL/10YmErLjv8T3Uc7qjFsbE=; b=lYVSqsfw1BYbPFEs7Eswx4i97BZLSUJyYnGkFAsmv5IxZzpr/R2NaTE6paXj8HKg5m PVbWV3GNtRVTO+j7OFtrie0L/XaCtYUvM1SLIQODL6YJbhHEw/Jpp1UC1t3Wny7/dvXS wCcLmFe8QcWx3hnBXu5wo8OcTDrYG2Ak8rUQ3GFco43raJ2qxZcC1Mx8Tav6no8jTAVu nzXkXzqQE/vxHJXTiy5whBqXHZCgjPz+qxdR9D9Em7qvFTHb/doAoqhvSlh/DRjsvKd4 mQOUkRIvxg06ymmsH/BDB08V0w/Jv88FipNatvFPOtwY3LngxJKL+QuXko0wZmXMCPoM 6ulw== X-Gm-Message-State: AD7BkJIYtt6dnZs7t/8NbEjDv1IhEFb7cF7HzR024MzGbd6cMXQRVktdShp4mekl5hDwnx4nCFXtxsErIRWgew== X-Received: by 10.28.133.14 with SMTP id h14mr12149580wmd.100.1458230747391; Thu, 17 Mar 2016 09:05:47 -0700 (PDT) In-Reply-To: <9727BC5A-67B2-49A6-9AFF-8C244A53300C@vmesel.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:105105 Please use reply-all in the future so that the list sees your message. On 17 March 2016 at 11:38, Vinicius wrote: > Thanks for replying Chris, > > Enviado do meu iPad > >> Em 16 de mar de 2016, =C3=A0s 1:18 PM, Chris Warrick escreveu: >> >>> On 15 March 2016 at 20:56, Vinicius Mesel wrote: >>> Hey guys, >>> >>> I'm a 16 year old Python Programmer that wanted to do something differe= nt. >>> But, like we know, ideas are quite difficult to find. >>> So I decided to develop a URL Shortener to help the Python community ou= t and share my coding knowledge, and today the project was launched with it= s first stable version. >>> So if you want to see the software working, go check it out at: http://= wp-a.co/ >>> Or if you want to see the source code to contribute and help the projec= t: https://github.com/vmesel/WP-A.CO >>> >>> >>> Hugs, >>> Vinicius Mesel >>> Brazilian and Portuguese Speaker >>> http://www.vmesel.com >>> >>> >>> >>> -- >>> https://mail.python.org/mailman/listinfo/python-list >> >> This is a great exercise =E2=80=94 however, your code is bad. You use st= ring >> formatting to create SQL, which leads to SQL injection >> vulnerabilities. Please educate yourself on what those mean and how to >> avoid that in Python (hint: prepared statements). Also, you should not >> commit your sqlite database to git. >> > Thanks for checking out my code and answering me, I will do the correctio= ns for the SQL Injection vulnerabilities with prepared statements like you = said. > > The database in the git is to show to everyone how the URL is stored. You can show people a schema and write a small script that imports it. You may add some demo URLs if you insist. >> That said, an URL shortener can be written in Django in less than an >> hour, and it will be even neater. >> > > I did not make it in Django because I was in need to learn flask for othe= r projects. > > >> (PS. the page=E2=80=99s really ugly. Consider using Bootstrap or some ot= her >> existing framework if you=E2=80=99re not good at designing pretty things= .) > > I'll consider it. > >> -- >> Chris Warrick >> PGP: 5EAAEA16 > > @vmesel --=20 Chris Warrick PGP: 5EAAEA16