This project is a simple Content Management System (CMS) built with Python and Flask. It allows users to create, read, update, and delete content. The CMS is styled with a modern theme using white, blue, and black colors.
- CRUD Operations: Create, read, update, and delete content entries.
- User Authentication: Basic user authentication to manage content securely.
- Responsive Design: Modern, responsive UI designed with Bootstrap and custom CSS.
- Template Inheritance: Use of template inheritance for easy customization and maintenance.
- Database Integration: SQLite database integration for storing content.
- Python 3.x
- pip (Python package installer)
-
Clone the repository:
git clone https://github.com/yourusername/flask-cms.git cd flask-cms -
Create a virtual environment:
python3 -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On MacOS/Linux:
source venv/bin/activate
- On Windows:
-
Install the dependencies:
pip install -r requirements.txt
-
Initialize the database:
flask db init flask db migrate -m "Initial migration." flask db upgrade -
Run the application:
flask run
-
Access the CMS: Open your web browser and navigate to
http://127.0.0.1:5000.
-
Creating Content:
- Log in to the CMS.
- Navigate to the "Create Content" section.
- Fill out the form and submit to create new content.
-
Updating Content:
- Go to the "Content List" page.
- Click on the "Edit" button next to the content you wish to update.
- Modify the fields and submit.
-
Deleting Content:
- Go to the "Content List" page.
- Click on the "Delete" button next to the content you wish to remove.
flask-cms/
├── app.py # Main application file
├── models.py # Database models
├── forms.py # Flask-WTF forms
├── static/
│ └── css/
│ └── style.css # Custom CSS styles
├── templates/
│ ├── base.html # Base template
│ ├── index.html # Home page template
│ ├── login.html # Login page template
│ ├── create.html # Create content template
│ ├── update.html # Update content template
│ └── content_list.html # Content list template
└── requirements.txt # Python dependencies
-
Colors and Theme: Modify the
style.cssfile located in thestatic/css/directory to change the color scheme and layout of the CMS. -
Database: By default, the CMS uses SQLite. You can configure a different database by modifying the
SQLALCHEMY_DATABASE_URIinapp.py.
Feel free to fork this repository, submit pull requests, or open issues for suggestions and improvements.
This project is licensed under the MIT License. See the LICENSE file for details.
