+
    Tjb<                         ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t
 ^ RIt^ RIHt ^ RIHtHt ^ RIHtHtHt ^ RIHtHt ^ RIHt ^ R	IHt ^ R
IHt  ! R R]4      tR# )    N)	find_spec)build_opener)settings)BaseCommandCommandError)find_formattershandle_extensionsrun_formatters)ContextEngine)archive)parse_header_parameters)get_docs_versionc                   x   a  ] tR t^t o Rt. t. ROtRtR tRR lt	R t
RR ltR tR tR	 tR
 tR tR tRtV tR# )TemplateCommanda  
Copy either a Django application layout template or a Django project
layout template into the specified directory.

:param style: A color style object (see django.core.management.color).
:param app_or_project: The string 'app' or 'project'.
:param name: The name of the application or project.
:param directory: The directory to which the template should be copied.
:param options: The additional variables passed to project or app templates
c           
     $   VP                  R RR7       VP                  RRRR7       VP                  RRR7       VP                  R	R
RRR.RR7       VP                  RRRR. RR7       VP                  RRR\        P                  RRRR7       R# )namez#Name of the application or project.)help	directory?z?Optional destination directory, this will be created if needed.)nargsr   z
--templatez*The path or URL to load the template from.z--extensionz-e
extensionsappendpyztThe file extension(s) to render (default: "py"). Separate multiple extensions with commas, or use -e multiple times.)destactiondefaultr   z--namez-nfilesz_The file name(s) to render. Separate multiple file names with commas, or use -n multiple times.z	--excludez-x zbThe directory name(s) to exclude, in addition to .git and __pycache__. Can be used multiple times.)r   r   r   constr   N)add_argumentargparseSUPPRESS)selfparsers   &&U/var/www/idalgo/venv/lib/python3.14/site-packages/django/core/management/templates.pyadd_argumentsTemplateCommand.add_arguments.   s    F)NOR 	 	

 	K 	 	
 	F! 	 		
 	5 	 	
 	%%; 	 	
    Nc                r   Wn         VR 8X  d   RMRV n        . V n        VR,          V n        V P	                  V4       VfL   \
        P                  P                  \
        P                  ! 4       V4      p \
        P                  ! V4       M\
        P                  P                  \
        P                  P                  V4      4      pVR 8X  d0   V P	                  \
        P                  P                  V4      R4       \
        P                  P!                  V4      '       g    \
        P                  ! V4       \#        4       p\%        \'        VR,          4      4      p. p	RR	.p
VR
,           F.  pV	P)                  \+        R VP-                  R4      4      4       K0  	  VP/                  R4      ;p'       d)   V F"  pV
P1                  VP3                  4       4       K$  	  V P                  ^8  de   V P4                  P7                  RV: RRP                  V4      : 24       V P4                  P7                  RV: RRP                  V	4      : 24       RV,          pRV,          pRV,          pRV,          pRP                  R VP9                  4        4       4      p\;        / VCWVVVVR\=        4       R\>        P@                  /CRR7      p\B        PD                  '       g+   \B        PF                  ! 4        \>        PH                  ! 4        V PK                  VR,          V4      p\M        V4      ^,           p\
        PN                  ! V4       EF  w  pppVVR pVPQ                  W4      pV'       d9   \
        P                  P                  VV4      p\
        P                  ! VRR7       VR,           FW  pRV9  d4   VPS                  R 4      '       g   VR	8X  d   VPU                  V4       K;  K=  VV
9   g   KF  VPU                  V4       KY  	  V EF  pVPW                  R+4      '       d   K  \
        P                  P                  VV4      p\
        P                  P                  VVVPQ                  W4      4      pV PX                   F7  w  p p!VPW                  V 4      '       g   K  VP[                  V 4      V!,           p M	  \
        P                  P!                  V4      '       d"   \        V: R!V P                  : R"V: R#24      hVPW                  V4      '       g   VV	9   d   \]        VR$R%7      ;_uu_ 4       p"V"P_                  4       p#RRR4       \a        4       Pc                  X#4      p$V$Pe                  V4      p#\]        VR&R$R%7      ;_uu_ 4       p%V%P7                  V#4       RRR4       M\f        Ph                  ! VV4       V P                  ^8  d#   V P4                  P7                  R'V,          4        V Pk                  VV4       V Pm                  V4       EK  	  EK  	  V P                  '       d   V P                  ^8  d   V P4                  P7                  R)4       V P                   FV  p&\
        P                  Pu                  V&4      '       d   \
        PT                  ! V&4       K@  \f        Pv                  ! V&4       KX  	  \y        V.3/ VBR*V Pn                  /B  R#   \         d    \        RT,          4      h\         d   p\        T4      hRp?ii ; i  \         d   p\        T4      hRp?ii ; i  + '       g   i     EL; i  + '       g   i     EL; i  \         d=    T Pn                  P7                  R(T,          T Pp                  Pr                  4        EK  i ; i),appana	verbosityNz'%s' already existsr   r   z.git__pycache__r   c                 "    V P                  4       # N)strip)xs   &r&   <lambda>(TemplateCommand.handle.<locals>.<lambda>{   s
    QWWYr)   ,excludez
Rendering z! template files with extensions: z, z  template files with filenames: z%s_namez%s_templatez%s_directoryzcamel_case_%s_namer   c              3   6   "   T F  qR 8w  g   K  Vx  K  	  R# 5i)_N ).0r3   s   & r&   	<genexpr>)TemplateCommand.handle.<locals>.<genexpr>   s     "Gl3h11ls   
docs_versiondjango_versionF)
autoescapetemplateT)exist_ok:NNN.z already exists. Overlaying  z< into an existing directory won't replace conflicting files.zutf-8)encodingwzCreating %szkNotice: Couldn't set permission bits on %s. You're probably using an uncommon filesystem setup. No problem.zCleaning up temporary files.stderr)z.pyoz.pycz	.py.class)=app_or_projecta_or_anpaths_to_remover.   validate_nameospathjoingetcwdmakedirsFileExistsErrorr   OSErrorabspath
expanduserbasenameexistsr   tupler	   extendmapsplitgetr   r2   stdoutwritetitler   r   django__version__r   
configured	configuresetuphandle_templatelenwalkreplace
startswithremoveendswithrewrite_template_suffixesremovesuffixopenreadr   from_stringrendershutilcopyfileapply_umaskmake_writeablerG   styleNOTICEisfilermtreer
   )'r$   rH   r   targetoptionstop_direformatter_pathsr   extra_filesexcluded_directoriesfiler7   r   	base_namebase_subdirbase_directorycamel_case_namecamel_case_valuecontexttemplate_dirprefix_lengthrootdirsr   	path_restrelative_dir
target_dirdirnamefilenameold_pathnew_path
old_suffix
new_suffixtemplate_filecontentrA   new_filepath_to_removes'   &&&&,                                  r&   handleTemplateCommand.handleX   s    ,-6tC! -4  >ggll299;5G&G$ ggoobgg&8&8&@AG&""277#3#3G#<kJ77>>'***KK( *+,W\-BCD
 &6G$$Ds#6

3HI %kk),,7,$	$++IOO,=> %>>QKK!499Z#8: KK!499[#9; .	#n4'.8.?77"Gdjjl"GG!1 0 2 &"4"4 

 """ LLN++GJ,?ML)A-!#!6D$]^,I$,,Y=LWW\\'<@
J677G+))#..']2JG, 3K 44KK( # "$$%BCC77<<h777<<\8+;+;I+L /3.L.L*J
((44#+#8#8#Dz#Q /M
 77>>(++& % LL*  $$Z00H4Kh99]"/"4"4"6 :%x33G<H&oog6Ghg>>( w/ ?> OOHh7>>Q&KK%%mh&>?	$$Xx8''1Q " "7~ ~~"!!"@A"&"6"677>>.11IIn-MM.1	 #7 	yHOHDKKHK # D"#87#BCC &"1o%&  *&q/)*v :99 ?>>  KK%%#%-. 

))	 sa   5[/ $\) ]	]	#]//%\&\&\!!\&)]4\??]]],/A^65^6c                   Vf7   \         P                  P                  \        P                  ^ ,          RV4      # VP                  R4      p\         P                  P                  V4      p\         P                  P                  V4      p\         P                  P                  V4      '       d   V# V P                  V4      '       d   V P                  V4      pM\         P                  P                  V4      p\         P                  P                  V4      '       d   V P                  V4      # \        RV P                  : RV: R24      h)z
Determine where the app or project templates are.
Use django.__path__[0] as the default because the Django install
directory isn't known.
confzfile://zcouldn't handle z
 template rC   )rL   rM   rN   r_   __path__removeprefixrT   normpathisdiris_urldownloadrS   rV   extractr   rH   )r$   rA   subdirexpanded_templateabsolute_paths   &&&  r&   rd   TemplateCommand.handle_template   s     77<< 2FFCC,,Y7H " 2 28 < " 0 01B Cww}}.//(({{8$$ $h 7 "0A Bww~~m,,||M22151D1DhO
 	
r)   c           	     f   Vf1   \        RP                  V P                  V P                  R7      4      hVP	                  4       '       g(   \        RP                  VV P                  VR7      4      h\        V4      e3   \        RP                  VV P                  V P                  VR7      4      hR # )Nz you must provide {an} {app} name)r,   r+   zX'{name}' is not a valid {app} {type}. Please make sure the {type} is a valid identifier.)r   r+   typez'{name}' conflicts with the name of an existing Python module and cannot be used as {an} {app} {type}. Please try another {type}.)r   r,   r+   r   )r   formatrI   rH   isidentifierr   )r$   r   name_or_dirs   &&&r&   rK   TemplateCommand.validate_name  s    <299||++ :     ""006++$ 17 1  T?&""(&||++$	 #) #	 	 'r)   c           	        R pRV P                   ,          p\        P                  ! VRR7      pV P                  P	                  V4       V! V4      w  rVV P
                  ^8  d#   V P                  P                  RV,          4       \        P                  P                  WE4      p\        4       pRR\        P                   23.Vn         VP                  V4      ;_uu_ 4       p	\        VR4      ;_uu_ 4       p
V	P!                  4       pV
P                  V	P#                  4       4       R	R	R	4       R	R	R	4       TP)                  R4      R,          pXR,          pT'       d+   \+        T4      w  ppTP-                  R4      ;'       g    TpMTpT P/                  T4      ^,          pTR,          pT'       g0   T'       d(   \0        P2                  ! T4      pT'       d
   TT,          pTT8w  d:   \        P                  P                  TT4      p\4        P6                  ! TT4       T# T#   + '       g   i     EL; i  + '       g   i     EL; i  \$         d   p\'        R
T: RT: RT: 24      hR	p?ii ; i)z2
Download the given URL and return the file name.
c                     V P                  R 4      pVP                  R 4      R,          pV P                  R 4      '       d   VR ,           pW#3# T pW#3# )/)rstriprZ   rj   )urltmpr   display_urls   &   r&   cleanup_url-TemplateCommand.download.<locals>.cleanup_url*  sT    **S/Cyy~b)H||C  !Ci (( "((r)   django_%s_template_	_downloadprefixsuffixzDownloading %sz
User-AgentzDjango/wbNzcouldn't download URL  to : r   zcontent-dispositionr   zcontent-typer   )rH   tempfilemkdtemprJ   r   r.   r\   r]   rL   rM   rN   r   r_   r`   
addheadersrm   inforn   rR   r   rZ   r   r[   splitext	mimetypesguess_extensionrq   move)r$   r   r   r   tempdirr   r   the_pathopenersourcery   headersr|   	used_namecontent_dispositionr9   paramsguessed_filenameextcontent_typeguessed_paths   &&                   r&   r   TemplateCommand.download%  s   
	) ')<)<<""&E##G, +C 0>>QKK.<=77<<2*gf6H6H5I,JKL	S!!VT(D-A-AV ++-V[[]+ .B! NN3'+	 &&;</0CDIAv%zz*5BB( mm,-a0~.|++L9C C'  ((77<<1ABLKK,/ E .B-A-A!!!  	8;XqI 	sN   I %H=:0H)	*H=2I )H:4	H==I	I I I8I33I8c                    \         P                  ! V4      w  r#VP                  4       P                  R4      '       d   VRR V,           pVRR pW#3# )z0
Like os.path.splitext, but takes off .tar, too
z.tarN)	posixpathr   lowerrj   )r$   r   baser   s   &&  r&   r   TemplateCommand.splitextc  sO     &&x0	::<  ((rs)c/C9Dyr)   c           	        RV P                   ,          p\        P                  ! VRR7      pV P                  P	                  V4       V P
                  ^8  d#   V P                  P                  RV,          4        \        P                  ! W4       V#   \        P                  \        3 d   p\        RT: RT: RT: 24      hRp?ii ; i)	zr
Extract the given file to a temporary directory and return
the path of the directory with the extracted content.
r   _extractr   zExtracting %szcouldn't extract file r   r   N)rH   r   r   rJ   r   r.   r\   r]   r   r   ArchiveExceptionrR   r   )r$   r   r   r   r|   s   &&   r&   r   TemplateCommand.extractm  s    
 ')<)<<""&D##G,>>QKKo89	OOH.N(('2 	8@'1M 	s   ;B C
.CC
c                ~    RV9  d   R# VP                  R^4      ^ ,          P                  4       pW P                  9   # )z)Return True if the name looks like a URL.:F)rZ   r   url_schemes)r$   rA   schemes   && r&   r   TemplateCommand.is_url  s:    hQ'*002))))r)   c                   \         P                  ! ^ 4      p\         P                  ! V4       \        P                  ! \         P                  ! V4      P                  4      p\         P
                  ! W$V( ,          4       R# )r   N)rL   umaskstatS_IMODEst_modechmod)r$   r   r   current_umaskcurrent_modes   &&&  r&   rs   TemplateCommand.apply_umask  sK    
||BGGH$5$=$=>
=.89r)   c                "   \         P                  ! V\         P                  4      '       gd   \         P                  ! V4      p\        P                  ! VP
                  4      \        P                  ,          p\         P                  ! W4       R# R# )zJ
Make sure that the file is writeable.
Useful if our source is read-only.
N)rL   accessW_OKr   r   r   S_IWUSRr   )r$   r   stnew_permissionss   &&  r&   rt   TemplateCommand.make_writeable  sS    
 yy277++"B"ll2::6EOHHX/ ,r)   )rI   rH   rJ   r.   )httphttpsftp))z.py-tplz.pyr1   )r   )__name__
__module____qualname____firstlineno____doc__requires_system_checksr   rk   r'   r   rd   rK   r   r   r   r   rs   rt   __static_attributes____classdictcell__)__classdict__s   @r&   r   r      s[     	  *K!
(
TRIh
4><|$*:0 0r)   r   )r"   r   rL   r   rq   r   r   importlib.utilr   urllib.requestr   r_   django.confr   django.core.management.baser   r   django.core.management.utilsr   r	   r
   django.templater   r   django.utilsr   django.utils.httpr   django.utils.versionr   r   r:   r)   r&   <module>r     sO      	     $ '    A 
 ,   5 1{0k {0r)   