title: How to use iframe in Django for Production?
body: <p>I have been using WordPress since 2005 now in the process of switching all my websites to Django Projects.  This is my first Django Project which will have multiple web apps.</p>
  
  <p>I am using Visual Studio Preview 2017 to create my Django Project.
  In my project I setup a main web app that holds the projects urls.py, view.py, model.py and templates folder that holds the main html pages.  This main web app will connect to the other web apps within the project.  </p>
  
  <p>I know the objective of web app development is to keep a person on the web app.  With that said I need to add blogs and affiliate pages to my project.  The only way I know how to do this is iframe.  </p>
  
  <p>I found one option on this site but it did not make any sense except for adding | safe to the url.       [1]: <a href="https://stackoverflow.com/questions/43432537/generate-iframe-from-django-tag">generate iframe from django tag</a></p>
  
  <p>I looked at the above link and the question I have if I need to use serializer in my code for my project web app?   </p>
  
  <p>My code is :</p>
  
  <p>Affi web app </p>
  
  <p>web_host_python.html</p>
  
  <pre><code>     &lt;html&gt;
  &lt;head&gt;&lt;title&gt;Web Host Python Hosting&lt;/title&gt;&lt;/head&gt;
  
  &lt;body&gt;
  
  {{ whpaff.html | safe }}
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>whpaff.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;html lang="en" xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;iframe src=" https://www.webhostpython.com/billing/aff.php?aff=69" 
                    style="border:0px #ffffff none;" name="web_host_python" 
                    scrolling="no" frameborder="1" marginheight="0px" 
                    marginwidth="0px" 
                    height="100%" width="100%" allowfullscreen&gt;&lt;/iframe&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>urls_affi.py</p>
  
  <pre><code>from django.conf.urls import url
  from . import views
  
  urlpattens = [
      url(r'^$', views.home),
      ]
  </code></pre>
  
  <p>view_affi.py</p>
  
  <pre><code>from django.shortcuts import render, HttpResponse
  
  # Create your views here.
  def web_host_python(request):
      return render(request, 'affi/web_host_python.html')
  </code></pre>
  
  <p>Project Main App</p>
  
  <p>url.py</p>
  
  <pre><code>   """
  Definition of urls for affiliate_sites.
  """
  
  from datetime import datetime
  from django.conf.urls import url
  import django.contrib.auth.views
  
  import app.forms
  import app.views
  
  # Uncomment the next lines to enable the admin:
  # from django.conf.urls import include
  # from django.contrib import admin
  # admin.autodiscover()
  
  urlpatterns = [
      # Examples:
      url(r'^affi$', views_affi.web_host_python, name='web_host_python),
      url(r'^$', app.views.home, name='home'),
      url(r'^contact$', app.views.contact, name='contact'),
      url(r'^about', app.views.about, name='about'),
      url(r'^login/$',
          django.contrib.auth.views.login,
          {
              'template_name': 'app/login.html',
              'authentication_form': app.forms.BootstrapAuthenticationForm,
              'extra_context':
              {
                  'title': 'Log in',
                  'year': datetime.now().year,
              }
          },
          name='login'),
      url(r'^logout$',
          django.contrib.auth.views.logout,
          {
              'next_page': '/',
          },
          name='logout'),
  
      # Uncomment the admin/doc line below to enable admin documentation:
      # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
  
      # Uncomment the next line to enable the admin:
      # url(r'^admin/', include(admin.site.urls)),
  </code></pre>
  
  <p>view.py</p>
  
  <pre><code>   """
  Definition of views.
  """
  
  from django.shortcuts import render
  from django.http import HttpRequest
  from django.template import RequestContext
  from datetime import datetime
  
  def web_host_python(request):
      """Renders the home page."""
      assert isinstance(request, HttpRequest)
      return render(
          request,
          'affi/web_host_python.html'
          {
              'title':'affi/web_host_python.html',
              'year':datetime.now().year,
          }
      )
  
  def home(request):
      """Renders the home page."""
      assert isinstance(request, HttpRequest)
      return render(
          request,
          'app/index.html',
          {
              'title':'Home Page',
              'year':datetime.now().year,
          }
      )
  
  def contact(request):
      """Renders the contact page."""
      assert isinstance(request, HttpRequest)
      return render(
          request,
          'app/contact.html',
          {
              'title':'Contact',
              'message':'Your contact page.',
              'year':datetime.now().year,
          }
      )
  
  def about(request):
      """Renders the about page."""
      assert isinstance(request, HttpRequest)
      return render(
          request,
          'app/about.html',
          {
              'title':'About',
              'message':'Your application description page.',
              'year':datetime.now().year,
          }
      )
  </code></pre>
  
  <p>Is any of this correct what I did?</p>
  
  <p>Or is there an alternative and easier way to do iframe in Django?</p>
  
  <p>Thank you for all of your advice. </p>
  
  <p>Marcus</p>