title: How do I change 'example.com' in my code?
body: <p>I built a <code>a.py</code> in my mysite file,</p>
  
  <p>a.py:</p>
  
  <pre><code>from django.core.management import setup_environ
  from mysite import settings
  
  setup_environ(settings)
  
  from django.contrib.sites.models import Site
  domain = Site.objects.get_current().domain
  print domain
  </code></pre>
  
  <p>It prints:</p>
  
  <blockquote>
    <p>:example.com</p>
  </blockquote>
  
  <p>How do I change the 'domain' to 127.0.0.1:8000?</p>
  
  <hr>
  
  <pre><code>from django.core.management import setup_environ
  from register import settings
  setup_environ(settings)
  
  
  from django.contrib.sites.models import Site
  #domain = Site.objects.get_current().domain
  #print domain
  
  from django.contrib.auth.models import User 
  obj=Site.objects.get(id=1).update(name='sss')
  print obj
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "D:\zjm_code\register\a.py", line 13, in &lt;module&gt;
      obj=Site.objects.get(id=1).update(name='sss')
  AttributeError: 'Site' object has no attribute 'update'
  </code></pre>