<?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: Haradhan Sharma</title>
    <description>The latest articles on DEV Community by Haradhan Sharma (@haradhansharma).</description>
    <link>https://dev.to/haradhansharma</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%2F814072%2Fd09554df-afc5-401b-b75f-b8340a87ba54.png</url>
      <title>DEV Community: Haradhan Sharma</title>
      <link>https://dev.to/haradhansharma</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/haradhansharma"/>
    <language>en</language>
    <item>
      <title>Why Forward-Thinking Enterprises are Replacing ChatGPT Enterprise with Sovereign AI in 2026</title>
      <dc:creator>Haradhan Sharma</dc:creator>
      <pubDate>Thu, 03 Sep 2026 11:13:50 +0000</pubDate>
      <link>https://dev.to/haradhansharma/why-forward-thinking-enterprises-are-replacing-chatgpt-enterprise-with-sovereign-ai-in-2026-1fa1</link>
      <guid>https://dev.to/haradhansharma/why-forward-thinking-enterprises-are-replacing-chatgpt-enterprise-with-sovereign-ai-in-2026-1fa1</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://hrdnsh.com/blog/sovereign-ai-vs-chatgpt-enterprise/" rel="noopener noreferrer"&gt;hrdnsh.com&lt;/a&gt; by &lt;a href="https://hrdnsh.com" rel="noopener noreferrer"&gt;Haradhan Sharma&lt;/a&gt;, Senior Enterprise Architect &amp;amp; Sovereign AI Consultant.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Your organization's proprietary data is its most critical competitive asset. Yet in 2026, thousands of companies still route sensitive financial ledgers, legal contracts, proprietary codebases, and customer records through third-party AI APIs.&lt;/p&gt;

&lt;p&gt;While &lt;strong&gt;ChatGPT Enterprise&lt;/strong&gt; offers a quick-start interface, forward-thinking engineering leaders and regulated enterprises are pivoting to &lt;strong&gt;Sovereign AI&lt;/strong&gt;—self-hosted, private intelligence running completely within their own virtual private clouds (VPC) or bare-metal data centers.&lt;/p&gt;

&lt;p&gt;In this guide, we break down the architectural reality, real-world total cost of ownership (TCO), and the exact engineering blueprint to deploy your own private AI infrastructure.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. SaaS AI vs Sovereign AI: Architectural Comparison
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dimension&lt;/th&gt;
&lt;th&gt;ChatGPT Enterprise / Public SaaS&lt;/th&gt;
&lt;th&gt;Sovereign AI (Self-Hosted)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Data Boundary&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Encrypted in transit, decrypted in third-party memory&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;100% on-premise or VPC (Zero data leaves)&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Pricing Model&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;$60 / user / month (Scales linearly with headcount)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Fixed hardware / compute cost (Infinite users)&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Knowledge Grounding&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Generic public corpus + vector search&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Private RAG over internal PostgreSQL/pgvector&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Model Customization&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Prompt wrappers &amp;amp; superficial fine-tuning&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Full weight control, LoRA adapters, model swapping&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Vendor Lock-in&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;High (OpenAI API dependencies)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Zero (vLLM, Ollama, LLaMA 3, Mistral, DeepSeek)&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  2. The Total Cost of Ownership (TCO) Breakdown
&lt;/h2&gt;

&lt;p&gt;Let's look at real-world numbers for a mid-sized organization with &lt;strong&gt;100 knowledge workers&lt;/strong&gt;:&lt;/p&gt;

&lt;h3&gt;
  
  
  Scenario A: ChatGPT Enterprise
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cost per seat:&lt;/strong&gt; $60/month&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monthly spend:&lt;/strong&gt; $6,000/month&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3-Year Total Spend:&lt;/strong&gt; &lt;strong&gt;$216,000 USD&lt;/strong&gt; (Ongoing, non-asset expenditure)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Scenario B: Sovereign AI Infrastructure (Dedicated GPU Compute)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Compute:&lt;/strong&gt; 1x Dedicated NVIDIA A100 (80GB) or 2x RTX 4090 Cloud instance (~$2.20/hour spot/reserved = ~$1,600/month)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open-Source Stack:&lt;/strong&gt; vLLM inference engine + PostgreSQL (pgvector) + FastAPI gateway + Open WebUI&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One-Time Implementation &amp;amp; Hardening:&lt;/strong&gt; ~$8,000 – $15,000&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3-Year Total Spend:&lt;/strong&gt; ~$65,000 – $75,000 USD&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Net Savings:&lt;/strong&gt; &lt;strong&gt;Over $140,000 (65%+ reduction)&lt;/strong&gt; with 100% data ownership.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. Production Architecture Blueprint
&lt;/h2&gt;

&lt;p&gt;A production Sovereign AI stack consists of 4 isolated layers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ Internal Enterprise Users / ERP / CRM ]
                    │ (Authenticated HTTPS / JWT)
                    ▼
       [ FastAPI Reverse Proxy Gateway ]
                    │
         ┌──────────┴──────────┐
         ▼                     ▼
[ PostgreSQL (pgvector) ]   [ vLLM Inference Engine ]
• Document Embeddings       • LLaMA 3.3 70B / Mistral
• Hybrid BM25 + Vector      • Token streaming (sub-50ms TTFT)
• Row-Level Security (RLS)  • Zero external internet access
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Key Python RAG Orchestration Snippet
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;psycopg&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pgvector.psycopg&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;register_vector&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;httpx&lt;/span&gt;

&lt;span class="c1"&gt;# 1. Connect to private pgvector store
&lt;/span&gt;&lt;span class="n"&gt;conn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;psycopg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;dbname=enterprise_ai user=admin host=127.0.0.1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;register_vector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;retrieve_grounded_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query_embedding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;top_k&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Retrieve private enterprise documentation without external SaaS leaks.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
            SELECT content, 1 - (embedding &amp;lt;=&amp;gt; %s::vector) AS similarity
            FROM company_documents
            WHERE department_access = &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;finance&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;
            ORDER BY embedding &amp;lt;=&amp;gt; %s::vector
            LIMIT %s;
        &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="n"&gt;query_embedding&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;query_embedding&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;top_k&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

        &lt;span class="n"&gt;rows&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fetchall&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;rows&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;query_sovereign_llm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Query self-hosted vLLM engine running inside local VPC.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;payload&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;model&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;meta-llama/Llama-3.3-70B-Instruct&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;messages&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="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&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;system&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;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Answer strictly using this verified internal context:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="si"&gt;}&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;role&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;user&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;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;prompt&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;temperature&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.1&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;with&lt;/span&gt; &lt;span class="n"&gt;httpx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AsyncClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;30.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://vllm-cluster:8000/v1/chat/completions&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;choices&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&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;content&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;h2&gt;
  
  
  4. When Does Sovereign AI Make Sense?
&lt;/h2&gt;

&lt;p&gt;Sovereign AI is mandatory if your business operates under:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Regulated Compliance:&lt;/strong&gt; HIPAA, GDPR, SOC 2 Type II, ISO 27001, or defense/ITAR restrictions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Proprietary IP:&lt;/strong&gt; Garment manufacturing designs, pharmaceutical formulas, algorithmic trading models, or legal briefs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;High Volume at Scale:&lt;/strong&gt; When user count exceeds 30 seats, paying SaaS per-seat taxes becomes financially irresponsible.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Conclusion &amp;amp; Next Steps
&lt;/h2&gt;

&lt;p&gt;Sovereign AI is not about rejecting commercial AI models—it is about &lt;strong&gt;data sovereignty, cost containment, and engineering resilience&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you are planning to deploy self-hosted RAG, open-source LLM clusters, or private agent gateways for your enterprise:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read the full technical documentation at &lt;a href="https://hrdnsh.com/services/agentic-ai-rag-orchestration/" rel="noopener noreferrer"&gt;hrdnsh.com/services/agentic-ai-rag-orchestration/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Or schedule a strategic advisory discovery session at &lt;a href="https://hrdnsh.com/consultation/" rel="noopener noreferrer"&gt;hrdnsh.com/consultation/&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>devops</category>
      <category>python</category>
      <category>architecture</category>
    </item>
    <item>
      <title>How to deploy Python Scripts to bereveal.com</title>
      <dc:creator>Haradhan Sharma</dc:creator>
      <pubDate>Sat, 12 Feb 2022 12:57:49 +0000</pubDate>
      <link>https://dev.to/haradhansharma/how-to-deploy-python-scripts-to-berevealcom-20fe</link>
      <guid>https://dev.to/haradhansharma/how-to-deploy-python-scripts-to-berevealcom-20fe</guid>
      <description>&lt;p&gt;&lt;b&gt;How to deploy Python to bereveal.com.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt; Here is a tutorial on how to deploy a Django project. You can also use other Python frameworks in the same way.&lt;/p&gt;

&lt;p&gt;Currently they have two packages for Python on their site. Buy any one from here.&lt;/p&gt;

&lt;blockquote&gt;
  1. &lt;a href="https://bereveal.com/django-hosting-basic.html"&gt;Django Hosting Basic&lt;/a&gt;&lt;br&gt;

  2. &lt;a href="https://bereveal.com/linux-website-hosting/premier/"&gt;Premier Web hosting plan&lt;/a&gt;&lt;br&gt;
                  3. &lt;a href="https://bereveal.com/linux-website-hosting/value/"&gt;Value Web hosting plan&lt;/a&gt;&lt;br&gt;
                  4. &lt;a href="https://bereveal.com/linux-website-hosting/advanced/"&gt;Advanced Web hosting plan&lt;/a&gt;&lt;br&gt;
                  5. &lt;a href="https://bereveal.com/linux-website-hosting/basic/"&gt;Basic Web hosting plan&lt;/a&gt;&lt;br&gt;
&lt;/blockquote&gt;

&lt;p&gt;Needless to say, all of plans are suitable for Python hosting. But SSH is automatically unlocked when you buy the plan mentioned for Python, but you have to buy SSH separately in other plans.&lt;/p&gt;

&lt;p&gt;SSH remains locked during the trial period. So you have to buy SSH separately during the trial period. You can also buy for a month if you want.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;            &amp;lt;p&amp;gt; They says, Following the feedback of web developers, we’ve added a new functionality to the Advanced section of the&amp;nbsp;Control Panel&amp;nbsp;- the Python Settings.&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;The new Python &lt;span&gt;Settings&lt;/span&gt; will allow you to edit the current Python version and to enable Python-compatible applications for your projects.&lt;/p&gt;

&lt;p&gt;Located right next to PHP Settings, it gives you one-click access to various Python management options.&lt;/p&gt;

&lt;h2&gt;What is Python about?&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.python.org/"&gt;Python&lt;/a&gt; is one of the most important application development languages and has been around for a long time now.&lt;/p&gt;

&lt;p&gt;Its standard library supports many Internet protocols, including JSON, FTP, IMAP, HTML and XML.&lt;/p&gt;

&lt;p&gt;There are different types of Python-based software:&lt;/p&gt;

&lt;p&gt;for web development purposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;frameworks such as Django and &lt;a href="http://www.pylonsproject.org/"&gt;Pyramid&lt;/a&gt;; micro-frameworks such as Flask and Bottle;&lt;/li&gt;
&lt;li&gt;advanced content management systems such as Plone and django CMS;&lt;/li&gt;
&lt;li&gt;asynchronous networking libraries like &lt;a href="http://www.tornadoweb.org/en/stable/"&gt;Tornado&lt;/a&gt;, which is perfect for long polling, WebSockets and other applications that require a long-lived connection to each user;&lt;/li&gt;
&lt;li&gt;full-stack frameworks (like web2py) for rapid development of fast and portable web-based, database-driven apps;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;for scientific and numerical computing purposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;open-source packages like &lt;a href="http://www.scipy.org/"&gt;SciPy&lt;/a&gt;, Matplotlib and NumPy, which are used in mathematics, science and engineering;&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://pandas.pydata.org/"&gt;Pandas&lt;/a&gt; - a BSD-licensed library for high-performance data analysis and modeling;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://ipython.org/"&gt;iPython&lt;/a&gt; - a powerful command shell for easier editing and recording of work sessions that supports interactive data visualization and parallel computing;&lt;/li&gt;
&lt;li&gt;Software Carpentry Course, which teaches the basics of scientific computing and provides open-access teaching materials;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;for software development purposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://buildbot.net/"&gt;Buildbot&lt;/a&gt; and Apache Gump, which are used for automating software build, test and release processes;&lt;/li&gt;
&lt;li&gt;Roundup and Trac - issue tracking and project management tools;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;for system administration purposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.ansible.com/"&gt;Ansible&lt;/a&gt; - an easy-to-deploy IT automation engine that automates configuration management, application deployment and cloud provisioning;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://saltstack.com/"&gt;Salt&lt;/a&gt; - a powerful open-source platform for IT automation and orchestration;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.openstack.org/"&gt;OpenStack&lt;/a&gt; - a high-performance computing, storage and networking platform;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Python is easy to learn and use, no matter if you're new to programming or an experienced developer.&lt;/p&gt;

&lt;p&gt;It is backed up by a large community, which &lt;a href="https://www.python.org/community/workshops/"&gt;organizes conferences and workshops&lt;/a&gt;, collaborates on code development projects, supports &lt;a href="http://docs.python.org/"&gt;an extensive Python documentation&lt;/a&gt; to help newbies along the way and maintains mailing lists to keep users up to date.&lt;/p&gt;

&lt;h2&gt;How do I use the Python Manager?&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bTh24DtP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.cloudlogin.co/imgs/python-settings-control-panel.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bTh24DtP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.cloudlogin.co/imgs/python-settings-control-panel.png" alt="" width="683" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the Python Manager section of the Control Panel, you’ll be able to set the Python version for your account.&lt;/p&gt;

&lt;p&gt;You can choose between Python 2.7, Python 3.1 and the latest version - Python 3.5.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--acwn6o2V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.cloudlogin.co/imgs/python-settings-change-version.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--acwn6o2V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.cloudlogin.co/imgs/python-settings-change-version.png" alt="" width="668" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;How to install a Python-based CMS on our platform (tutorial)?&lt;/h2&gt;

&lt;p&gt;To give you a better idea of how Python-based applications work on our servers, we’ll show you how to install the Django framework-powered &lt;a href="http://mezzanine.jupo.org/"&gt;Mezzanine CMS&lt;/a&gt; on our platform via SSH.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Create a virtual environment&amp;nbsp;(venv) in the root folder of your account, in our case:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/usr/local/python-3.5/bin/virtualenv /home/venv/&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Enter the newly created virtual environment using the following command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;source /home/venv/bin/activate&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Go to the "www"&amp;nbsp;folder of your hosting account:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd /home/www/&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Install the Mezzanine CMS binaries along with the corresponding modules fastcgi support and flup6.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;pip install git+https://github.com/NetAngels/django-fastcgi
pip install flup6
pip install mezzanine&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Make sure you disable the “Outgoing Connections” option or the installation of the modules will fail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt; Set up the Mezzanine project In a selected custom directory, in our case mydjangocms:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;mezzanine-project mydjangocms&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step 6:&lt;/strong&gt; Create a domain or subdomain for the newly installed CMS.&lt;/p&gt;

&lt;p&gt;Keep in mind that the Jail host option needs to be deactivated in order for the installed modules to function properly.&lt;/p&gt;

&lt;p&gt;Point your newly created domain or subdomain to the path of your project. In our example, the path is "/www/mydjangocms".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XTzeq_xQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.cloudlogin.co/imgs/python-settings-tutorial.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XTzeq_xQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.cloudlogin.co/imgs/python-settings-tutorial.jpg" alt="" width="685" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7:&lt;/strong&gt; Go to the newly created Mezzanine CMS folder:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd mydjangocms&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step 8:&lt;/strong&gt; Set up a database for your CMS. In our case, we’ll use the sqlite3 database for the sake of ease (alternatively, you could set up a MySQL/PostgreSQL database by applying the necessary settings to the Python setup file:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;python manage.py createdb&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You will see the following message:&lt;/p&gt;

&lt;pre&gt;A site record is required.
Please enter the domain and optional port
in the format 'domain:port'. For example 'localhost:8000' or 'www.example.com'.

&lt;span&gt;Hit enter to use the default (127.0.0.1:8000):

Use the default option for the SQL host. You will then be asked to enter your username, email and password. 
These are the login credentials for the CMS system and not the database. 
&lt;/span&gt;&lt;span&gt;In the end, you can choose if you want to have some demo content inserted.&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step 9:&lt;/strong&gt; Set up an .htaccess file in the folder of your project with the following entries:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.fcgi/$1 [QSA,L]&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step 10:&lt;/strong&gt; Set up an index.fcgi file in the folder of your project using the following code&amp;nbsp;(it will serve as an entry point for all requests to the CMS).&lt;/p&gt;

&lt;p&gt;Don't forget to replace "&lt;em&gt;mydjangocms&lt;/em&gt;" with the name of your project.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/home/venv/bin/python3.5
# -*- coding: utf-8 -*-
import os
import sys
activate_this = '/home/venv/bin/activate_this.py'
exec(open(activate_this).read(), dict(__file__=activate_this))
cms_path = '/home/www/mydjangocms/'
sys.path.insert(0, cms_path)
os.chdir(cms_path)
# Set the DJANGO_SETTINGS_MODULE environment variable.
os.environ['DJANGO_SETTINGS_MODULE'] = "mydjangocms.settings"
from django_fastcgi.servers.fastcgi import runfastcgi
from django.core.servers.basehttp import get_internal_wsgi_application
wsgi_application = get_internal_wsgi_application()
runfastcgi(wsgi_application, method="prefork", daemonize="false", minspare=1, maxspare=1, maxchildren=1)&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step 11:&lt;/strong&gt; You'll need to make the index.fcgi file executable using this command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;chmod +x index.fcgi&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step 12:&lt;/strong&gt; Edit the settings file located inside "mydjangocms/local_settings.py" and replace&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ALLOWED_HOSTS = []&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;With your actual host name:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ALLOWED_HOSTS = ['mydjangocms.my-best-domain.net']&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step 13:&lt;/strong&gt; Run the following command to collate the static files:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;python manage.py collectstatic&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You are now ready and your site should be up and running.&lt;/p&gt;

&lt;p&gt;In our example, the newly installed Mezzanine CMS will resolve to:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://mydjangocms.my-best-domain.net/"&gt;http://mydjangocms.my-best-domain.net/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a rel="attachment wp-att-12245" href="https://blog.resellerspanel.com/wp-content/uploads/2016/11/django-cms-mezzanine-insllation-complete.jpg"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DQA4uENK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.resellerspanel.com/wp-content/uploads/2016/11/django-cms-mezzanine-insllation-complete.jpg" alt="Django CMS Mezzanine - insllation complete" width="880" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can log into your Mezzanine CMS Admin Panel using the login details set&amp;nbsp;in step 8 above and kickstart&amp;nbsp;a new blog, for example:&lt;/p&gt;

&lt;p&gt;&lt;a rel="attachment wp-att-12247" href="https://blog.resellerspanel.com/wp-content/uploads/2016/11/django-cms-mezzanine-admin-panel.jpg"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--p3qMR9bb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.resellerspanel.com/wp-content/uploads/2016/11/django-cms-mezzanine-admin-panel.jpg" alt="Django CMS Mezzanine - Admin Panel" width="880" height="372"&gt;&lt;/a&gt;&lt;/p&gt;         

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

</description>
    </item>
  </channel>
</rss>
