Simple Flask Blog is a blog written with flask & jinja
First of all fill all required ENV for Dockerfile
ENV SECRET_KEY='YOUR SECRETKEY'
ENV SQLALCHEMY_DATABASE_URI='sqlite:///site.db'
ENV MAIL_SERVER='SMTP MAIL SERVER'
ENV SMTP_PORT='SMTP PORT'
ENV MAIL_USERNAME='SMTP USER'
ENV MAIL_PASSWORD='SMTP PASS'
Save Dockerfile . then build image
docker build -t flask-app:1.0 .
Now run image :
docker run -p 80:80 flask-app:1.0
First you need to Create a VENV for the Project Open a Terminal in Project Directory and use Below line to Create VENV:
python3 -m venv venv
Now you have to Activate VENV
For Activating VENV use below line :
source venv/bin/activate
venv/Scripts/activate.ps1
After Activating VENV you have to install requirements.txt
pip3 install -r requirements.txt
export SECRET_KEY='Your Secret Key'
export SQLALCHEMY_DATABASE_URI='sqlite:///site.db'
export MAIL_SERVER='SMTP Server URL'
export SMTP_PORT='SMTP PORT'
export MAIL_USERNAME='SMTP USERNAME'
export MAIL_PASSWORD='SMTP PASSWORD'
save above exports to .bashrc for holding the values to your default shell.
python3 dbinit.py
Before using above command make sure to edit dbinit.py for changing blogname , navbar and admin information to your needs.
Enter this command in the terminal to run the project :
python3 -m flask run --port 80
Now enter the given address in the URL bar of your browser:
http://127.0.0.1:80/
Default admin username and password are :
Email : admin@gmail.com
Password : admin
Open app/config.py with you desired editor.
if you want to disallow anyone to register and write post change :
USER_REGISTER = Trueto False.
This Project are still in development so i wrote a todo list to track the Progress
- Better Structure of Application
- Add Database to Application
- Add A Way To Create,Update,Delete Posts with Privileged User
- User Account , Profile Picture
- User Password Encryption (brcypt method used)
- A Better Post Edit Section with Markdown or JS
- Code Refactoring & Cleaner Code
- Blueprints
- Custom Error Pages
- Cache Exeptions to Show Error Pages
- Dockerfile