Skip to content

Commit

Permalink
Merge pull request #15 from Rezuanul-Islam-Fahim/master
Browse files Browse the repository at this point in the history
Add additional files (README, LICENSE, requirements, setup, MANIFEST)
  • Loading branch information
Rezuanul-Islam-Fahim authored Sep 23, 2020
2 parents 86e198f + db2eda1 commit 90ea513
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
venv/
simple_blog_site.egg-info/

*.pyc
__pycache__/
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Rezuanul Islam Fahim

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include schema.sql
graft static
graft templates
global-exclude *.pyc
98 changes: 98 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Simple Blog Site

A simple blog website for blog posting. This website has authentication, database, post-create, post-update,
post-delete features. `Sqlite3` is used as the database for this website.

## Installation

* [Clone Repository](#clone-repository)
* [Create Virtual Environment and Activate it](#create-virtual-environment-and-activate-it)
* [Set Flask app and environment](#set-flask-app-and-environment)
* [Initialize Database](#initialize-database)
* [Run app](#run-app)

### Clone Repository

```bash
# Clone the repository
$ git clone https://github.com/Rezuanul-Islam-Fahim/simple-blog-site

# Navigate to the project folder
$ cd simple-blog-site
```

### Create Virtual Environment and Activate it

For `macOS` and `linux`:

```bash
$ python3 -m venv venv
$ . venv/bin/activate
```

Or for `windows` PC:

```bash
$ py -3 -m venv venv
$ venv\Scripts\activate.bat
```

### Set Flask app and environment

For `macOS` and `linux`:

```bash
$ export FLASK_APP=app
$ export FLASK_ENV=development
```

Or for `windows` PC:

```bash
$ set FLASK_APP=app
$ set FLASK_ENV=development
```

### Initialize Database

To initialize database run this command:

```bash
$ flask init-db
```

### Run app

After initializing database, run this command to run app in a `local` server:

```bash
$ flask run
```

To view this app, open http://127.0.0.1:5000 or http://localhost:5000 in your browser.

## License

```bash
MIT License

Copyright (c) 2020 Rezuanul Islam Fahim

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
5 changes: 3 additions & 2 deletions blog.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,16 @@ def update(id):

return redirect(url_for('blog.index'))

if (error): flash(error)
if error:
flash(error)

return render_template('blog/update.html', post=post)


@bp.route('/delete/<int:id>', methods=['POST'])
@login_required
def delete(id):
""" A function for deleting post """
""" Function for deleting post """

get_post(id)
db = get_db()
Expand Down
15 changes: 15 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
astroid==2.4.2
click==7.1.2
colorama==0.4.3
Flask==1.1.2
isort==4.3.21
itsdangerous==1.1.0
Jinja2==2.11.2
lazy-object-proxy==1.4.3
MarkupSafe==1.1.1
mccabe==0.6.1
pylint==2.5.3
six==1.15.0
toml==0.10.1
Werkzeug==1.0.1
wrapt==1.12.1
11 changes: 11 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from setuptools import find_packages, setup

# Setup information
setup(
name='simple-blog-site',
version='1.0.0',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=['flask'],
)

0 comments on commit 90ea513

Please sign in to comment.