
0_c           @   sk   d  Z  d d l m Z d d l m Z d d l m Z d d l m	 Z	 m
 Z
 m Z d e e	 e d  Z d S(	   s"   
Creates the default Site object.
i(   t   apps(   t   settings(   t   no_style(   t   DEFAULT_DB_ALIASt   connectionst   routeri   c   
      K   s  y | j  d d  } Wn t k
 r* d  SXt j | |  sA d  S| j j |  j   s| d k rm d GHn  | d t t d d  d d	 d
 d	  j	 d |  t
 | j j t   | g  } | r| d k r d GHn  t
 | j   % } x | D] }	 | j |	  q WWd  QXqn  d  S(   Nt   sitest   Sitei   s    Creating example.com Site objectt   pkt   SITE_IDi   t   domains   example.comt   namet   usings   Resetting sequence(   t	   get_modelt   LookupErrorR   t   allow_migrate_modelt   objectsR   t   existst   getattrR   t   saveR   t   opst   sequence_reset_sqlR   t   cursort   execute(
   t
   app_configt	   verbosityt   interactiveR   R    t   kwargsR   t   sequence_sqlR   t   command(    (    sA   /tmp/pip-unpacked-wheel-BAJOf3/django/contrib/sites/management.pyt   create_default_site   s"    1N(   t   __doc__t   django.appsR    t   global_appst   django.confR   t   django.core.management.colorR   t	   django.dbR   R   R   t   TrueR   (    (    (    sA   /tmp/pip-unpacked-wheel-BAJOf3/django/contrib/sites/management.pyt   <module>   s
   