<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: tmotagam</title>
    <description>The latest articles on DEV Community by tmotagam (@tmotagam).</description>
    <link>https://dev.to/tmotagam</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F999935%2F7c12135c-fa90-4ee2-8e4d-87ae25450c8a.png</url>
      <title>DEV Community: tmotagam</title>
      <link>https://dev.to/tmotagam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tmotagam"/>
    <language>en</language>
    <item>
      <title>Tino Wizard: The GUI Setup Creator Linux Has Been Missing</title>
      <dc:creator>tmotagam</dc:creator>
      <pubDate>Tue, 14 Jul 2026 14:22:35 +0000</pubDate>
      <link>https://dev.to/tmotagam/tino-wizard-the-gui-setup-creator-linux-has-been-missing-3o29</link>
      <guid>https://dev.to/tmotagam/tino-wizard-the-gui-setup-creator-linux-has-been-missing-3o29</guid>
      <description>&lt;h2&gt;
  
  
  The Problem Every Linux Developer Knows
&lt;/h2&gt;

&lt;p&gt;You've built a great application. It works. Your users love it. Now you need to ship it.&lt;/p&gt;

&lt;p&gt;On Windows, you fire up Inno Setup or NSIS and produce a polished .exe installer in minutes. On macOS, you drag an .app into a .dmg. On Linux? You learn the intricacies of dpkg-deb, wrestle with RPM spec files, consider Flatpak manifests, debate Snap confinement, or simply hand users a tarball and a README that says "extract and run install.sh."&lt;/p&gt;

&lt;p&gt;None of those options give you what Inno Setup gives Windows developers: &lt;strong&gt;a visual, wizard-driven tool&lt;/strong&gt; that turns your finished application into a self-contained, branded, graphical installer — complete with license acceptance, uninstaller, .desktop integration, and localization — without requiring you to learn a single packaging spec.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That's the gap &lt;a href="https://github.com/Tino-Setup" rel="noopener noreferrer"&gt;Tino Wizard&lt;/a&gt; fills.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Tino Wizard?
&lt;/h2&gt;

&lt;p&gt;Tino Wizard is an &lt;strong&gt;open-source (GPLv3) GUI application&lt;/strong&gt; that generates professional Linux installers &lt;strong&gt;and&lt;/strong&gt; uninstallers for your apps — whether they're GUI applications or CLI tools. It's written in Python with Tkinter, and the output is a single, self-extracting executable that guides end users through installation with a familiar wizard experience.&lt;/p&gt;

&lt;p&gt;Think of it as &lt;strong&gt;Inno Setup for Linux&lt;/strong&gt;, but designed from the ground up around Linux conventions: &lt;code&gt;.desktop&lt;/code&gt; files, &lt;code&gt;/usr/local/bin&lt;/code&gt; symlinks, privilege elevation via &lt;code&gt;pkexec&lt;/code&gt;, and XDG-compliant icon paths.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;Tino Wizard is available on &lt;a href="https://github.com/Tino-Setup/Tino-Wizard/releases/tag/1.0.0" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;Download, click on single file executable and install the wizard.&lt;/p&gt;

&lt;p&gt;Then create a project, point it at your application files, configure your options through the GUI, and generate your installer. The output is a single executable that works on any Linux distribution with a display server.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works — A Developer's Walkthrough
&lt;/h2&gt;

&lt;p&gt;Tino Wizard is itself a wizard. When you launch it, you step through a sequence of pages that collect everything the tool needs to generate your installer.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Project Setup
&lt;/h3&gt;

&lt;p&gt;Start by creating a new &lt;code&gt;.tino&lt;/code&gt; project file or importing an existing one. The project file is a structured JSON document that stores your entire configuration — you can version-control it alongside your source code.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Application Information
&lt;/h3&gt;

&lt;p&gt;Fill in the basics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Application Name, Version, Author, Description, Homepage URL&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;License File&lt;/strong&gt; — displayed to the user during installation for acceptance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pre/Post Install Information Files&lt;/strong&gt; — shown before and after installation (release notes, getting-started guides, etc.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Installer &amp;amp; Uninstaller Icons&lt;/strong&gt; — custom branding for the setup wizards&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compression Algorithm&lt;/strong&gt; — choose between &lt;strong&gt;gzip&lt;/strong&gt;, &lt;strong&gt;bz2&lt;/strong&gt;, or &lt;strong&gt;lzma (xz)&lt;/strong&gt; with configurable compression levels (0–9)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Files &amp;amp; Folders
&lt;/h3&gt;

&lt;p&gt;Add the files and directories that make up your application. Tino Wizard recursively collects folder contents, validates symlinks for safety (escaping project directories is blocked), and bundles everything into a compressed tarball.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Installer Options
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;App Type&lt;/strong&gt; — GUI Application or CLI Tool (determines whether &lt;code&gt;.desktop&lt;/code&gt; files and icon symlinks are generated)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destination Path&lt;/strong&gt; — where the app installs (e.g., &lt;code&gt;/opt/myapp&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Executable Source &amp;amp; Target&lt;/strong&gt; — pick which bundled file becomes the main binary, and where its symlink lands (e.g., &lt;code&gt;/usr/local/bin/myapp&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Icon Source &amp;amp; Target&lt;/strong&gt; — map your icon to &lt;code&gt;/usr/share/icons/myapp.png&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;.desktop&lt;/code&gt; File Configuration
&lt;/h4&gt;

&lt;p&gt;For GUI applications, Tino Wizard generates and &lt;strong&gt;validates&lt;/strong&gt; a &lt;code&gt;.desktop&lt;/code&gt; file (using &lt;code&gt;desktop-file-validate&lt;/code&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Comment, Categories, custom key-value pairs&lt;/li&gt;
&lt;li&gt;Desktop Actions (e.g., "New Window", "Open Recent")&lt;/li&gt;
&lt;li&gt;Executable arguments&lt;/li&gt;
&lt;li&gt;Full XDG compliance&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Scripts &amp;amp; Tasks
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pre-install script&lt;/strong&gt; — runs before extraction (environment checks, dependency setup)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Post-install script&lt;/strong&gt; — runs after extraction (database migrations, config generation)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pre-uninstall script&lt;/strong&gt; — runs before removal (graceful shutdown, backup prompts)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Post-uninstall script&lt;/strong&gt; — runs after removal (cleanup)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Additional Tasks&lt;/strong&gt; — optional user-selectable tasks shown during installation (e.g., "Add to PATH", "Create desktop shortcut for all users")&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. Localization
&lt;/h3&gt;

&lt;p&gt;Tino Wizard has &lt;strong&gt;built-in internationalization support&lt;/strong&gt;. Your installer can ship with translations for multiple languages — the generated installer presents a language selection dialog at launch. Built-in locale support includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🇺🇸 English (en_US)&lt;/li&gt;
&lt;li&gt;🇪🇸 Spanish (es_ES)&lt;/li&gt;
&lt;li&gt;🇫🇷 French (fr_FR)&lt;/li&gt;
&lt;li&gt;🇮🇳 Hindi (hi_IN)&lt;/li&gt;
&lt;li&gt;🇨🇳 Chinese Simplified (zh_CN)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Per-language overrides include: application name, description, license file, pre/post install info files, and additional task labels.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Build &amp;amp; Generate
&lt;/h3&gt;

&lt;p&gt;Click &lt;strong&gt;Generate Installer&lt;/strong&gt; and Tino Wizard executes a 4-stage build pipeline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Stage 1/4: Building Uninstaller...
Stage 2/4: Creating Archive...
Stage 3/4: Preparing Installer Configuration...
Stage 4/4: Building Installer...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output is a &lt;strong&gt;single self-contained executable&lt;/strong&gt; — &lt;code&gt;"YourApp setup"&lt;/code&gt; — that you can distribute directly. No runtime dependencies for end users.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Technical Details
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Built with:&lt;/strong&gt; Python 3, Tkinter, Pydantic (data validation), PyInstaller (binary generation)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Project format:&lt;/strong&gt; &lt;code&gt;.tino&lt;/code&gt; JSON files — version-controllable, human-readable&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Installer engine:&lt;/strong&gt; Separate &lt;code&gt;Engine.py&lt;/code&gt; module with callback-driven architecture — UI and business logic are cleanly decoupled&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compression:&lt;/strong&gt; &lt;code&gt;tarfile&lt;/code&gt; module with support for gzip, bz2, and lzma with configurable levels&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Elevation:&lt;/strong&gt; &lt;code&gt;pkexec&lt;/code&gt;-based privilege elevation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Desktop files:&lt;/strong&gt; Generated and validated with &lt;code&gt;desktop-file-validate&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rollback:&lt;/strong&gt; File-level tracking via insertion-ordered dictionary — reversed for precise cleanup&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I18n:&lt;/strong&gt; gettext-based with &lt;code&gt;.po&lt;/code&gt;/&lt;code&gt;.mo&lt;/code&gt; locale files for installer/uninstaller UI&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What the End User Sees
&lt;/h2&gt;

&lt;p&gt;When a user runs the generated installer, they get a complete wizard experience:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Language Selection&lt;/strong&gt; — if multiple translations are configured&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Welcome Page&lt;/strong&gt; — branded with your app icon&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;License Agreement&lt;/strong&gt; — with mandatory acceptance checkbox&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pre-Install Information&lt;/strong&gt; — release notes, system requirements&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Additional Tasks&lt;/strong&gt; — user-selectable options&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ready to Install&lt;/strong&gt; — summary with destination path&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Installation Progress&lt;/strong&gt; — real-time progress bar with file-by-file status&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Post-Install Information&lt;/strong&gt; — getting-started guide&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Finish&lt;/strong&gt; — clean completion&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If installation fails at any point, the installer &lt;strong&gt;automatically rolls back&lt;/strong&gt; — removing extracted files, symlinks, desktop files, and the installation directory itself. The rollback is tracked at the file level for precision.&lt;/p&gt;

&lt;p&gt;The generated &lt;strong&gt;uninstaller&lt;/strong&gt; provides an equally clean GUI experience for removal, with pre/post-uninstall script support.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Privilege elevation&lt;/strong&gt; is handled automatically via &lt;code&gt;pkexec&lt;/code&gt; when installing to system directories like &lt;code&gt;/opt&lt;/code&gt; or &lt;code&gt;/usr/local/bin&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔗 Links:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/Tino-Setup/" rel="noopener noreferrer"&gt;GitHub Organization&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.gnu.org/licenses/gpl-3.0.html" rel="noopener noreferrer"&gt;License: GPLv3&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Have you tried Tino Wizard?&lt;/strong&gt; Share your experience in the comments below. And if you're a contributor, check out the GitHub organization — the project is open source and welcoming contributions.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>python</category>
      <category>devtools</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Introducing Secweb security headers for FastAPI and Starlette frameworks</title>
      <dc:creator>tmotagam</dc:creator>
      <pubDate>Sun, 01 Jan 2023 15:21:36 +0000</pubDate>
      <link>https://dev.to/tmotagam/introducing-secweb-security-headers-for-fastapi-and-starlette-framework-4ohl</link>
      <guid>https://dev.to/tmotagam/introducing-secweb-security-headers-for-fastapi-and-starlette-framework-4ohl</guid>
      <description>&lt;h2&gt;
  
  
  UPDATE
&lt;/h2&gt;

&lt;p&gt;Secweb now supports CSP report-only header, Removed the Expect-CT header, added Clear-Site-Data and Cache-Control headers, added an easier way to write headers, and added types for improved developer experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Secweb?
&lt;/h2&gt;

&lt;p&gt;Secweb is a library of middlewares that helps you in setting security headers in FastAPI and Starlette frameworks. It uses ASGI Middleware implementation which improves performance and has very little overhead. Implements recommendations from MDN and OWASP. This allows the library to stay up to date with all the newer standards and best practices.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use Secweb?
&lt;/h2&gt;

&lt;p&gt;Secweb makes it easy to add security headers or to change the parameters of those headers without you having to get your hands into the intricacies of the Starlette framework so you can write your business logic without any worries and it also secures all of your APIs.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Use Secweb
&lt;/h2&gt;

&lt;p&gt;First we will install the library using the pip command. You can use any package manager you like, e.g., poetry, conda, pipenv, etc.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;pip&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Secweb&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can import it into any of your existing or new FastAPI or Starlette projects. For this blog, I am creating a new dummy FastAPI project.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;Secweb&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SecWeb&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nc"&gt;SecWeb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nd"&gt;@app.get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;root&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Hello World&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now your API is secured by Secweb. It is this easy to add Secweb to your projects. All the important headers are activated by default (e.g., Content Security Policy (CSP), Strict Transport Security (HSTS), etc.). If you want you can even change all the parameters of those headers according to your needs. Don't worry—all the other headers are also activated with their default settings so that you don't unnecessarily increase security risk of your APIs.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;Secweb&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SecWeb&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nc"&gt;SecWeb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Option&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;hsts&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;max-age&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;432000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;preload&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;

&lt;span class="nd"&gt;@app.get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;root&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Hello World&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All the headers are also available as standalone in the library for you to use. Remember that using only the standalone headers will only activate those headers, others will remain deactivated.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;Secweb.ContentSecurityPolicy&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ContentSecurityPolicy&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ContentSecurityPolicy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Option&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;default-src&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"'&lt;/span&gt;&lt;span class="s"&gt;self&lt;/span&gt;&lt;span class="sh"&gt;'"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;style-src&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"'&lt;/span&gt;&lt;span class="s"&gt;self&lt;/span&gt;&lt;span class="sh"&gt;'"&lt;/span&gt;&lt;span class="p"&gt;]})&lt;/span&gt;
&lt;span class="c1"&gt;# report-only mode
# app.add_middleware(ContentSecurityPolicy, Option={'default-src': ["'self'"], 'style-src': ["'self'"]}, report_only=True)
&lt;/span&gt;
&lt;span class="nd"&gt;@app.get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;root&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Hello World&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more information on all the headers provided by the Secweb library you can go to &lt;a href="https://github.com/tmotagam/secweb#readme" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; to read the detailed documentation.&lt;/p&gt;

&lt;p&gt;Hope this helps you in your projects 👋 Bye.&lt;/p&gt;

</description>
      <category>fastapi</category>
      <category>python</category>
      <category>security</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
