From 8300776314d787281af065c0a10daf5e6fa0dae9 Mon Sep 17 00:00:00 2001 From: Michael chen Date: Mon, 28 Nov 2016 18:09:40 +0800 Subject: [PATCH 1/4] fix to django 1.10.3 --- demo/demo.sqlite | Bin 0 -> 47104 bytes demo/example/__init__.pyc | Bin 0 -> 137 bytes demo/example/forms.pyc | Bin 0 -> 5529 bytes demo/example/migrations/0001_initial.py | 49 ++++++++++ demo/example/migrations/0001_initial.pyc | Bin 0 -> 1728 bytes demo/example/migrations/__init__.py | 0 demo/example/migrations/__init__.pyc | Bin 0 -> 148 bytes demo/example/models.pyc | Bin 0 -> 2017 bytes demo/example/urls.py | 108 +++++++++++++++++------ demo/example/urls.pyc | Bin 0 -> 2462 bytes demo/example/views.py | 11 +-- demo/example/views.pyc | Bin 0 -> 3548 bytes demo/settings.py | 67 ++++++++++---- demo/settings.pyc | Bin 0 -> 2460 bytes demo/templates/base.html | 12 +-- demo/urls.py | 22 ++--- demo/urls.pyc | Bin 0 -> 967 bytes 17 files changed, 200 insertions(+), 69 deletions(-) create mode 100644 demo/demo.sqlite create mode 100644 demo/example/__init__.pyc create mode 100644 demo/example/forms.pyc create mode 100644 demo/example/migrations/0001_initial.py create mode 100644 demo/example/migrations/0001_initial.pyc create mode 100644 demo/example/migrations/__init__.py create mode 100644 demo/example/migrations/__init__.pyc create mode 100644 demo/example/models.pyc create mode 100644 demo/example/urls.pyc create mode 100644 demo/example/views.pyc create mode 100644 demo/settings.pyc create mode 100644 demo/urls.pyc diff --git a/demo/demo.sqlite b/demo/demo.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..a323c7a7b58880f50cff80c2a418517589c2f8a7 GIT binary patch literal 47104 zcmeHQdu$uYdEePtlA>ijESX-*v`#DOWQiw<;*#P+_6afV>TK7~^W!cKa9FI!wagqJ zG9QkeyR=6sIG|{g0{yEf+A9JCy`ul5y#fWUNYGb+rftylh5XSVMVq#{pv@nbAV>=& zE&9#uE_aq(Qa-ikD$?+LqurVB`{tY9?Cj2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(lQlKnsj166~g{8Er@t{FA(lGmTYZ}mbV3LleQb|ZU2Rmm&mu(SAwp>NM zR@aIZ7?^71M$w}p)6wM=QR6J^unk?XWh}EY?43?pWwY*C5H*nj3Fl$gZRn~kA;C&8 zVC`G6C$y>PN|F@iB5cMDy=)7yA75u_ueM_)rK0H+c`}!vj~$w^CG~hJQ_*CS=zkG9 z<1-hsEbb5+hYBfG9=7VkbSg!(=&aIIG?5~b($JlsnQ52QQw24?0*vPT-&Y0v)gDcp iCvgNg0(%~TICzT)&t$F96*TT{?LPsZ;Ao0|3;qXdg0F4> literal 0 HcmV?d00001 diff --git a/demo/example/__init__.pyc b/demo/example/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9f03568dba2fc7821e2d00c50ea53d8664d32618 GIT binary patch literal 137 zcmZSn%*)08!a5?E0SXv_v;zPG|XHW z&Y>j%>67x>KK5(+0sWM|_XFCs_Mu2xaN(9QijbVcIrnq+UT5t!Q~KxCx#@rW=6Op7 zpK1I*!Bzat6N&KiBoRqHX?Wr>?@QuKT9QUd(y}zll1@ouO45onDy~IIl4(h2q%q_2 zWl3fwos-6#%TGx%FX3nZBIhD68VeH5j8)7I zE8df6ZmeQ{Sh1+3OA=j?@3HV35k8VqJN4wmWud-?JJTLR) zd31Md0r!RrxOdV0o^VEX^cwH0JKmS%zNA%YRADeoGc;Ir*!u&CK9K!d4PK1@g-;Eh z6g!2ao%hnBR%W)sY;2OK(AzYROj6jHi$=y4mQXl}qa)nAA+DofElT5TBedo#t#K9X zRv2sJ?5L=fkkP(-y*%o-tj_$b7nz=&N0r{0Xxp09&R*oVu&^NnIlxm~#T_I@h&%^8 zVDSPJz6ASjChlg(*l^gLyVdSDhTV-%xMC2%75&s6++DL7CP}kdqiuBW&1M#+rrES} zS_`Z66J!H!Q1_vB3OE4GJC+oWk=^|4Wz-3?qx?~HhJoVNBel4(FC&xYFU@I~b`$eb z3+vspfcCh8tKcRoUd3~R(g49#CfAs-)w`IDd*WDykEG&Rx^v7Mllwqd_&?e|;J(%H zV>=}t0xs*FTKGK-`2Vr+0%qcMVPOJzt#9-7oPM|Ft=9e>It&rt@X5YlMR4u~?txvBF#{3?wu#i@1j$?#pN+WaCgEAt9-Hc5@+wbWl@P3+#P+xvX4Mc&Yz>xJ zwdT|w=BI4IZaU21Bp1~3-rhk3wok=OcamE z<4xRyDCbKIPfXGHpMptXXYyxp4@swZ-1)X|dS~@rN~S;w`s ziZ^#hx#e2GPcjPpxY1%NYxs+4scMmvu@uiS!on? z(Q*`*3X`-gJA}O>7iYgY;qAzn6NQc281W%41+sXngRp@TQCyBW(M7o^Z(-%+{(wFR zIKXHPdN;S%O z4u<~(RZ8xFA~CjioM%Q4>Q;EFC7Wp&Ct9+$y`v>x*f9B~V7Sw}$G;B`521zF{Y7}3 z=NgCC^9&LOcxvZcZ`4Acqq$Kn1ToW5F$3)f@PqbQ0^oz8d@Y&Qk{KQkGpi+Yq%1`) z0ns|n)+8H6xpOJzjID?ITEh_#KK?cL_i=En9~b1&H3+I}981cJ}lfF?^B zbv3dD459&r&&bmg9b1*`JhwV_fB}`3q%!L*`72(HmKrgml6LS5lqpncI>j9yZ4{4z z!h(YqHtgAEgbF!6ZUL{0{_MPaa3MXd zjfu*AlbDuuXXvuv9IJZ`wWMc7?GxNM)J7l|UksQ9m;me$W)WaPE2W{*RH#yXDoD@y za9$xeXD~>yheQ?NmxWPr`1OBSF$q*50>aiZEl!*@8CORIm^9+(osp4OOjM;VE z^bkb>6PNvnStc&~F|$lumWv6PxU6c0%VFPD{gf@4)E*#F>FC}YkhMfZqs!M-cQ~#h zp9h4Llc41JL8BJLLoYt8hkQ3vAH1@0{KaTJYSj*uq4`!}@Ghe6Ui<`VZyG@Ll``QD zUkQ;l0fa%I8)H>=fxYybcN literal 0 HcmV?d00001 diff --git a/demo/example/migrations/0001_initial.py b/demo/example/migrations/0001_initial.py new file mode 100644 index 00000000..ce073462 --- /dev/null +++ b/demo/example/migrations/0001_initial.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.3 on 2016-11-28 17:23 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Order', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('customer', models.CharField(max_length=150)), + ('date', models.DateField(default=datetime.date.today, editable=False)), + ], + ), + migrations.CreateModel( + name='OrderedItem', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('quantity', models.PositiveSmallIntegerField()), + ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ordered_items', to='example.Order')), + ], + ), + migrations.CreateModel( + name='Product', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=150)), + ], + options={ + 'ordering': ('name',), + }, + ), + migrations.AddField( + model_name='ordereditem', + name='product', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orders', to='example.Product'), + ), + ] diff --git a/demo/example/migrations/0001_initial.pyc b/demo/example/migrations/0001_initial.pyc new file mode 100644 index 0000000000000000000000000000000000000000..039027e52776d90814ea90d25eba65b0903c0bd8 GIT binary patch literal 1728 zcmb_cO^+Kz5UrW9z204KcJs9%gz%9|d?3~$q#P22FuPf4g#wY60~kxAS$BETW`_m3cTK%luc|xxV{hk|Kc9X#r}h`&{RM?o{{X|_ z2`D4V1DXaD$ULMhq-m&o5oHnO9h!D1@6xop@#xWXi%f^OL(4ub0y16tmFNx8_tU<_ zI3M;9-~NT)Fo5L_F!;jGOT%$y9al+Ke?1IkYX?Ja(<*VcENUko=5Whuw+-|8<<2Gr z3H7C<@H-+i33CSJh*H?#)TL#wO$|&;M7$*|g)XLD9ec#vWROE2q&o|&Z>!r589cjK z3}kVji@Rj@hzGRXqvbU+*W}wb6v82m#JED-m)y<2L_E;o`-nh-bzP?iWNr{&r{xV= zg7!^X-Xe384944J4&fZV1^3Q>!F}f~nWi9cmn;hT5t(=CF<>MsK;9$so~n7D%=`aH z@dKs!p-{w=qHPXoaz1>3a=8wMBFWizVSG~=uC&ez%bBUYw1G8lfLG#O8P6+D92>Wb zg;izqq*}*6@>=_$=E^3S{h8JM6;~H!&9TOoFlQ&ekJsGSuFQd=&6T{4GcHp1(*A}$ zFJue=+?E);NPOm;e8tAP@*3DqwiUh2dguxt{3J7kbB9(dWW>q9TZNW7PUoIzU;T;znRC@$t)~YSzW;1cEj* zDUsIALYz$zB|}%5WbN+4dQsNk@`}&%B+JeU$0@h5M6}bgVw)CUp_fDsvrLM#)T)>Z zO;<~aYe=;}9-kkNPoC+<*qDZdgeh0JzqBqx%;;*U$Cy5QGHU`qGHcY)&L1txDo1WJ z!+AMtg`Ztrd9$OVqfg>i#L;R!kxN=|>W?w>Li{`1K`(q5+zuW_jkO literal 0 HcmV?d00001 diff --git a/demo/example/migrations/__init__.py b/demo/example/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/demo/example/migrations/__init__.pyc b/demo/example/migrations/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b32d8107fd3c16f0afea116cfd26786e149f862 GIT binary patch literal 148 zcmZSn%*)mA-8v$f0SXv_v;ztbT=Zi literal 0 HcmV?d00001 diff --git a/demo/example/models.pyc b/demo/example/models.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2081cebfc34f948270e2abcacc2f25d596bc1c62 GIT binary patch literal 2017 zcmb`I-)|E~5XWcl9REn6AZSseN)<0r-3KC`cxWqxN*jbKQgnG~PmxZCcWlnu^SQTc zgi)nFq<=&I#=i3hz)V}~&&*u<_WJ(dzaM^|(B_lM|3@4gIVIPldXMrwk$c33=6#wPvU~Io(K*o{`G9Qy!p5N67?K@c z*cf#iBeMH+I{r*-sNTtEY-APsGS!V`=c7CldFfVd>8dvzRXtJJGH@8k;(6QH)g=7S zx1U7sAIQW6mpGw$y7BXzOx}ZoV!BN`TSVwV$orI?j$uRCm#Hpa7mgRR@Ur?BI^6t> zL)qO1ll8XGWf5~a8>xx1=Upa`_Yg)@~wU~`% zO}ok87x9gD&?A_C5zR@MVB!{5HSmE2APLiQUNbhx2W+z(|Daetg#&`3Td z#C@7eS){~6sgXo-Ym;OnqzBH*kPtDo;IQRsxpG0_v#mn;!f^)*+!PdimL!X;?!-Jh zSs`5y{kQ(EW=$l9_)S(mG&Q%8CVsVx*X2Tm`|rruLc^IK@XC;B*-e?0+|N?1k(|~9 zJP(a6*BasD(s{l*kk{q#TQasF&DV)$oPuQgG;rPFMD!Ks6Ioou$3~S$M2}kNn=j>iEjbw@XEilr z6FssoVxNJF80^rf6DyNkT-1-c?QG=|npsMDqOX_EMZ$(Gpe1^++)uyXUm7HGp VV|+I}MD=*sf78e}IT#%b-U9`Dkk|kK literal 0 HcmV?d00001 diff --git a/demo/example/urls.py b/demo/example/urls.py index 11bbcef2..d109e86f 100644 --- a/demo/example/urls.py +++ b/demo/example/urls.py @@ -1,35 +1,89 @@ -from django.conf.urls import patterns, url, include -from example.forms import AutoCompleteOrderedItemForm, OrderedItemForm, ContactFormset, MaxFiveContactsFormset, EmptyContactFormset, EventFormset -from example.forms import AutoCompleteSelectFieldForm - -urlpatterns = patterns('example.views', - url(r'^stacked/$', 'formset', {'formset_class': ContactFormset, 'template': 'example/formset-stacked.html'}, name='example_stacked'), - url(r'^table/$', 'formset', {'formset_class': ContactFormset, 'template': 'example/formset-table.html'}, name='example_table'), - url(r'^form-template/$', 'formset_with_template', {'formset_class': EmptyContactFormset, 'template': 'example/form-template.html'}, name='example_form_template'), - url(r'^admin-widget/$', 'formset', {'formset_class': EventFormset, 'template': 'example/formset-admin-widget.html'}, name='example_admin_widget'), - url(r'^multiple-formsets/$', 'multiple_formsets', {'template': 'example/formset-multiple-formsets.html'}, name='example_multiple_formsets'), - url(r'^inline-formset/$', 'inline_formset', - {'form_class': OrderedItemForm, 'template': 'example/inline-formset.html'}, name='example_inline_formset'), - url(r'^inline-formset-autocomplete/$', 'inline_formset', - {'form_class': AutoCompleteOrderedItemForm, 'template': 'example/inline-formset-autocomplete.html'}, name='example_inline_autocomplete'), - url(r'^inline-formset-ajax-selects/$', 'inline_formset', - {'form_class': AutoCompleteSelectFieldForm, 'template': 'example/inline-formset-django-ajax-select.html'}, name='example_inline_ajax_selects'), - url(r'^autocomplete-products/$', 'autocomplete_products', name='example_autocomplete_products') -) - import django +from django.conf.urls import include, url + +from example.forms import (AutoCompleteOrderedItemForm, + AutoCompleteSelectFieldForm, ContactFormset, + EmptyContactFormset, EventFormset, + MaxFiveContactsFormset, OrderedItemForm) + +from .views import (autocomplete_products, formset, formset_with_template, + inline_formset, multiple_formsets) + +urlpatterns = [ + url(r'^stacked/$', + formset, + {'formset_class': ContactFormset, + 'template': 'example/formset-stacked.html'}, + name='example_stacked'), + + url(r'^table/$', + formset, + {'formset_class': ContactFormset, + 'template': 'example/formset-table.html'}, + name='example_table'), + + url(r'^form-template/$', + formset_with_template, + {'formset_class': EmptyContactFormset, + 'template': 'example/form-template.html'}, + name='example_form_template'), + + url(r'^admin-widget/$', + formset, + {'formset_class': EventFormset, + 'template': 'example/formset-admin-widget.html'}, + name='example_admin_widget'), + + url(r'^multiple-formsets/$', + multiple_formsets, + {'template': 'example/formset-multiple-formsets.html'}, + name='example_multiple_formsets'), + + url(r'^inline-formset/$', + inline_formset, + {'form_class': OrderedItemForm, + 'template': 'example/inline-formset.html'}, + name='example_inline_formset'), + + url(r'^inline-formset-autocomplete/$', + inline_formset, + {'form_class': AutoCompleteOrderedItemForm, + 'template': 'example/inline-formset-autocomplete.html'}, + name='example_inline_autocomplete'), + + url(r'^inline-formset-ajax-selects/$', + inline_formset, + {'form_class': AutoCompleteSelectFieldForm, + 'template': 'example/inline-formset-django-ajax-select.html'}, + name='example_inline_ajax_selects'), + + url(r'^autocomplete-products/$', autocomplete_products, + name='example_autocomplete_products') +] + major, minor = django.VERSION[:2] if major >= 1 and minor >= 2: # These examples require Django 1.2 and above: - urlpatterns += patterns('example.views', - url(r'^max-forms/$', 'formset', {'formset_class': MaxFiveContactsFormset, 'template': 'example/max-forms.html'}, name='example_max_forms'), - url(r'^empty-form/$', 'formset', {'formset_class': EmptyContactFormset, 'template': 'example/empty-form.html'}, name='example_empty_form'), - ) + urlpatterns += [ + url(r'^max-forms/$', + formset, + {'formset_class': MaxFiveContactsFormset, + 'template': 'example/max-forms.html'}, + name='example_max_forms'), + url(r'^empty-form/$', + formset, + {'formset_class': EmptyContactFormset, + 'template': 'example/empty-form.html'}, + name='example_empty_form'), + ] -if major >=1 and minor >= 7: +if major >= 1 and minor >= 7: from example.forms import MinTwoContactsFormset # These examples require Django 1.7 and above: - urlpatterns += patterns('example.views', - url(r'^min-forms/$', 'formset', {'formset_class': MinTwoContactsFormset, 'template': 'example/min-forms.html'}, name='example_min_forms'), - ) \ No newline at end of file + urlpatterns += [ + url(r'^min-forms/$', + formset, + {'formset_class': MinTwoContactsFormset, + 'template': 'example/min-forms.html'}, name='example_min_forms'), + ] diff --git a/demo/example/urls.pyc b/demo/example/urls.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a23fe865ff97c8e178df06c0ac88357535aa2f48 GIT binary patch literal 2462 zcmah~ZExE)5I#w<9lzU6;->HImbUIT+xswVz%~pUiUjC~wtzAWgJ4+DEH+gt%7#hj z1z3R%{mK0S+Z`!V%1covmg&2P&po_5p1qIl#@`=*`g0EXtBs$(;#>Ud0>t?5Knf7( zwF{{O+=aje?m^&zLkJJj4d4|BD!{7{RDstZr~%)EU=w&9f;#X91P$O#2%5NO1L6v# zE#Pek+Q2&ybbxmu=mPIS&;#Cwpbrl7Ag%)IK;i>0U0_|sg4>CuXCZw9xnWr98nR^}+Xk`&tPhC;@xc0S8s9Fko{G?f_!dUEZ6S9I z!WOy-)6nboVCyLiGyx4h%!*8(_lmGDbYKZ*^vPR#tdAg37^l-gi zr9-mGJNWo*Ef>!he3>%IUaw-dV(|;f_`zbuulNsH%I5MQVQH-V9o+wXk;w>+h!;%C zEi~=(r98i6Z;}0kWfnL{n*dqur!nWTIWeVtty05@c9tt4)v~eX}U$Nj5r7;v*)J>`{TXlFAUxxm}<_ z<;Bz!fgs1sWO$V4N+9o(Vu$6ug45);3TS8`MX{)aGhJ50k2Rwbs>A7mQNNplUBv1T z)RQJB7h6Q!zsf%M^jJ<&PlY_s3bkk=Xm8vqM&Qew<)~@wX)l9h}i)mh}DV=J(JXiDWXO7c1WxuG}|AUk*XW)KU l8E#Y^&uQRa)&2ac{aIAYX?a`DuIo9L&8~XhuG6!g{{cbvbkhI; literal 0 HcmV?d00001 diff --git a/demo/example/views.py b/demo/example/views.py index 0b824bb4..f60c718a 100644 --- a/demo/example/views.py +++ b/demo/example/views.py @@ -23,8 +23,7 @@ def formset(request, formset_class, template): return display_data(request, data) else: formset = formset_class() - return render_to_response(template, {'formset': formset}, - context_instance=RequestContext(request)) + return render_to_response(template, {'formset': formset}, ) def formset_with_template(request, formset_class, template): # If you're using a Django version older than 1.2, you won't have `formset.empty_form`; @@ -41,8 +40,7 @@ def formset_with_template(request, formset_class, template): if formset.is_valid(): data = formset.cleaned_data return display_data(request, data) - return render_to_response(template, {'form': form, 'formset': formset}, - context_instance=RequestContext(request)) + return render_to_response(template, {'form': form, 'formset': formset},) def inline_formset(request, form_class, template): OrderedItemFormset = get_ordereditem_formset(form_class, extra=1, can_delete=True) @@ -62,8 +60,7 @@ def inline_formset(request, form_class, template): else: form = OrderForm(instance=order) formset = OrderedItemFormset(instance=order) - return render_to_response(template, {'form': form, 'formset': formset}, - context_instance=RequestContext(request)) + return render_to_response(template, {'form': form, 'formset': formset},) def multiple_formsets(request, template): if request.method == 'POST': @@ -74,4 +71,4 @@ def multiple_formsets(request, template): else: contact_formset, event_formset = ContactFormset(prefix='contact_form'), EventFormset(prefix='event_form') return render_to_response(template, {'contact_formset': contact_formset, 'event_formset': event_formset}, - context_instance=RequestContext(request)) + ) diff --git a/demo/example/views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ef$C^kwFjU zY3&Pt7?|`bT1Hgen0-pmJF~gfS3bVTrVdP6mVs`J%rnmEaF;%`DjscGkua}t@!vU; zo5ruxoDq}22gTtP$eNRaGW&oW|*N$>8j?XFOW<70)K3 zMRTY?C2CvPlwSO`hP}Zy68-Fj3L18U9XDy7Uc=(|u@2WdeT@DJoG+M-=!)4LZJl V4YO`W_%@UR{ts@v&=mjx literal 0 HcmV?d00001 diff --git a/demo/settings.py b/demo/settings.py index e28a1813..799b9038 100644 --- a/demo/settings.py +++ b/demo/settings.py @@ -38,7 +38,7 @@ # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = os.path.join(PROJECT_DIR, 'static') +MEDIA_ROOT = os.path.join(os.path.join(PROJECT_DIR, 'static')) # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). @@ -59,28 +59,55 @@ 'django.template.loaders.app_directories.Loader', ) -MIDDLEWARE_CLASSES = ( - 'django.middleware.common.CommonMiddleware', +# MIDDLEWARE_CLASSES = ( +# 'django.middleware.common.CommonMiddleware', +# 'django.contrib.sessions.middleware.SessionMiddleware', +# 'django.contrib.auth.middleware.AuthenticationMiddleware', +# ) + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', -) + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', -ROOT_URLCONF = 'urls' +] -TEMPLATE_DIRS = ( - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. - os.path.join(PROJECT_DIR, 'templates'), -) +ROOT_URLCONF = 'urls' -TEMPLATE_CONTEXT_PROCESSORS = ( - 'django.contrib.auth.context_processors.auth', - 'django.core.context_processors.media', - #'django.core.context_processors.i18n', - #'django.core.context_processors.request', - #'django.core.context_processors.debug', -) +# TEMPLATE_DIRS = ( +# # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". +# # Always use forward slashes, even on Windows. +# # Don't forget to use absolute paths, not relative paths. +# os.path.join(PROJECT_DIR, 'templates'), +# ) + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [os.path.join(PROJECT_DIR, 'templates')], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +# TEMPLATE_CONTEXT_PROCESSORS = ( +# 'django.contrib.auth.context_processors.auth', +# 'django.core.context_processors.media', +# #'django.core.context_processors.i18n', +# #'django.core.context_processors.request', +# #'django.core.context_processors.debug', +# ) INSTALLED_APPS = ( 'django.contrib.auth', @@ -98,3 +125,7 @@ 'search_field': 'name', } } + +STATIC_URL = '/static/' + +STATICFILES_DIRS = (os.path.join(PROJECT_DIR, 'static'),) \ No newline at end of file diff --git a/demo/settings.pyc b/demo/settings.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1d5270f05afd076ac2310e860f8f30c97f47d3bc GIT binary patch literal 2460 zcmcgt>2Kpi6o1au``F#G-L}iZA|dr44sCZsK`VqCyCqx4iINnGRbgDuBz5Z8sb|t- zzwV!m#8-GTPTEL`fDZ^C@yt7Z@0^$P?+dekDDTcZ7+h2M{Q+Ngt^g2x6bJxp01D7i zppzOd(m*rtQ4x=w1)2kU3g{Hr(?C?PXMoOtJqx}9ehLUaX(*BmkSu<3P_*ZOpzu79 zX|NZ7pztElC9s!=_)kU_Ss=6UF(qw11u_TrGa&O|uK-y9`x77qu%8222J!?53LqC* zNPiA(w6Y3h73>$_qx}~^)}S~D25lhpx`1vgKsJz(1M(7z=r;Kj$SWY90r?!-sQ4Nk z{{o6AXRiVI8tnC9a9cpOk+}opEB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/demo/templates/base.html index aa635b38..96eae367 100644 --- a/demo/templates/base.html +++ b/demo/templates/base.html @@ -1,3 +1,4 @@ +{% load i18n static %} - -{% block title %}Velkomm{% endblock %} :: Django Dynamic Formset Examples - - - -{% block extrahead %}{% endblock %} + + {% block title %}Velkomm{% endblock %} :: Django Dynamic Formset Examples + + + {% block extrahead %}{% endblock %} diff --git a/demo/urls.py b/demo/urls.py index e8a0b1a3..a82830d7 100644 --- a/demo/urls.py +++ b/demo/urls.py @@ -1,27 +1,27 @@ import django from django.conf import settings +from django.conf.urls import include, url from django.contrib import admin from django.views.generic import TemplateView -from django.conf.urls import patterns, url, include +from django.views.static import serve - -urlpatterns = patterns('', +urlpatterns = [ url(r'^$', TemplateView.as_view(template_name='index.html')), url(r'^examples/', include('example.urls')), -) +] try: import ajax_select # If django-ajax-selects is installed, include its URLs: - urlpatterns += patterns('', - url(r'^ajax-select/', include('ajax_select.urls')) - ) + urlpatterns += [ + url(r'^ajax-select/', include('ajax_select.urls')), + ] except ImportError: pass if settings.DEBUG: - urlpatterns += patterns('', - (r'^%s/(?P.*)$' % settings.MEDIA_URL[1:-1], - 'django.views.static.serve', + urlpatterns += [ + url(r'^%s/(?P.*)$' % settings.MEDIA_URL[1:-1], + serve, {'document_root': settings.MEDIA_ROOT, 'show_indexes': False}), - ) + ] diff --git a/demo/urls.pyc b/demo/urls.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9a0ab0626511f0574610e0a2bca436edd700c82d GIT binary patch literal 967 zcmZ8f+iuf96r8o4rn$9ATU8Yj4@dNZH0ji9!T;LLtMW_nGN`V)URH14JYY|zg@BgvwTk>Zgb=B~33(Vd zk*|ySPPSmC1-Wc}@2yh}F?VNf1+s}9T7_(3XXay6xTY?WkL?xCDE`IQ`!)v!vuHCT zW8!qA+n!}?l5sjrrjm@$>uH`8(h`G6syHoRo#7FwNfH_Q6w~FcNK<}6+M1ning-v@ zTsBA}MY_sNoJzXtoEw!mcuH3hJCWYj)^?6M+*)gEa2k!Ht1V3l4b8T0GGmEBK@_r< zmEG6d?dKnMCy_bd>pXh68M|k+4l)}~6{Tj7XPGg!i9XLR2ksoC+iOgi1*;oJ=_oU` zKg-TAOV4@?VQk-`?nu|SXFK#FCfDvG+EtmH lCbVbs(3?EfMN_Qv;Ge%CHhf>yJzw1Q8Y1v2!WU~iegjeg(^LQe literal 0 HcmV?d00001 From 2be469ff51f04752eeab1b12e9bfa75da6cb820f Mon Sep 17 00:00:00 2001 From: cncg51 Date: Fri, 3 Mar 2017 22:58:24 +0800 Subject: [PATCH 2/4] fix static files --- .vscode/launch.json | 168 ++++++++++++++++++++ demo/.vscode/launch.json | 168 ++++++++++++++++++++ demo/example/__init__.pyc | Bin 137 -> 149 bytes demo/example/forms.pyc | Bin 5529 -> 5721 bytes demo/example/migrations/0001_initial.pyc | Bin 1728 -> 1752 bytes demo/example/migrations/__init__.pyc | Bin 148 -> 160 bytes demo/example/models.pyc | Bin 2017 -> 2113 bytes demo/example/urls.pyc | Bin 2462 -> 2474 bytes demo/example/views.pyc | Bin 3548 -> 3632 bytes demo/settings.pyc | Bin 2460 -> 2472 bytes demo/templates/example/empty-form.html | 4 +- demo/templates/example/form-template.html | 4 +- demo/templates/example/formset-stacked.html | 4 +- demo/templates/example/formset-table.html | 4 +- demo/templates/example/inline-formset.html | 2 +- demo/templates/example/max-forms.html | 4 +- demo/urls.pyc | Bin 967 -> 979 bytes demo1/db.sqlite3 | Bin 0 -> 3072 bytes demo1/demo1/__init__.py | 0 demo1/demo1/__init__.pyc | Bin 0 -> 148 bytes demo1/demo1/settings.py | 120 ++++++++++++++ demo1/demo1/settings.pyc | Bin 0 -> 2628 bytes demo1/demo1/urls.py | 21 +++ demo1/demo1/urls.pyc | Bin 0 -> 990 bytes demo1/demo1/wsgi.py | 16 ++ demo1/demo1/wsgi.pyc | Bin 0 -> 602 bytes demo1/example/__init__.py | 0 demo1/example/admin.py | 3 + demo1/example/apps.py | 7 + demo1/example/migrations/__init__.py | 0 demo1/example/models.py | 5 + demo1/example/tests.py | 3 + demo1/example/views.py | 3 + demo1/manage.py | 22 +++ 34 files changed, 547 insertions(+), 11 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 demo/.vscode/launch.json create mode 100644 demo1/db.sqlite3 create mode 100644 demo1/demo1/__init__.py create mode 100644 demo1/demo1/__init__.pyc create mode 100644 demo1/demo1/settings.py create mode 100644 demo1/demo1/settings.pyc create mode 100644 demo1/demo1/urls.py create mode 100644 demo1/demo1/urls.pyc create mode 100644 demo1/demo1/wsgi.py create mode 100644 demo1/demo1/wsgi.pyc create mode 100644 demo1/example/__init__.py create mode 100644 demo1/example/admin.py create mode 100644 demo1/example/apps.py create mode 100644 demo1/example/migrations/__init__.py create mode 100644 demo1/example/models.py create mode 100644 demo1/example/tests.py create mode 100644 demo1/example/views.py create mode 100755 demo1/manage.py diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..7b1271fd --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,168 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Python", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config.python.pythonPath}", + "program": "${file}", + "cwd": "${workspaceRoot}", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "PySpark", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "osx": { + "pythonPath": "${env.SPARK_HOME}/bin/spark-submit" + }, + "windows": { + "pythonPath": "${env.SPARK_HOME}/bin/spark-submit.cmd" + }, + "linux": { + "pythonPath": "${env.SPARK_HOME}/bin/spark-submit" + }, + "program": "${file}", + "cwd": "${workspaceRoot}", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Python Module", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config.python.pythonPath}", + "module": "module.name", + "cwd": "${workspaceRoot}", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Integrated Terminal/Console", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config.python.pythonPath}", + "program": "${file}", + "cwd": "null", + "console": "integratedTerminal", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit" + ] + }, + { + "name": "External Terminal/Console", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config.python.pythonPath}", + "program": "${file}", + "cwd": "null", + "console": "externalTerminal", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit" + ] + }, + { + "name": "Django", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config.python.pythonPath}", + "program": "${workspaceRoot}/manage.py", + "cwd": "${workspaceRoot}", + "args": [ + "runserver", + "--noreload" + ], + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput", + "DjangoDebugging" + ] + }, + { + "name": "Flask", + "type": "python", + "request": "launch", + "stopOnEntry": false, + "pythonPath": "${config.python.pythonPath}", + "program": "fully qualified path fo 'flask' executable. Generally located along with python interpreter", + "cwd": "${workspaceRoot}", + "env": { + "FLASK_APP": "${workspaceRoot}/quickstart/app.py" + }, + "args": [ + "run", + "--no-debugger", + "--no-reload" + ], + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Flask (old)", + "type": "python", + "request": "launch", + "stopOnEntry": false, + "pythonPath": "${config.python.pythonPath}", + "program": "${workspaceRoot}/run.py", + "cwd": "${workspaceRoot}", + "args": [], + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Watson", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config.python.pythonPath}", + "program": "${workspaceRoot}/console.py", + "cwd": "${workspaceRoot}", + "args": [ + "dev", + "runserver", + "--noreload=True" + ], + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Attach (Remote Debug)", + "type": "python", + "request": "attach", + "localRoot": "${workspaceRoot}", + "remoteRoot": "${workspaceRoot}", + "port": 3000, + "secret": "my_secret", + "host": "localhost" + } + ] +} \ No newline at end of file diff --git a/demo/.vscode/launch.json b/demo/.vscode/launch.json new file mode 100644 index 00000000..7b1271fd --- /dev/null +++ b/demo/.vscode/launch.json @@ -0,0 +1,168 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Python", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config.python.pythonPath}", + "program": "${file}", + "cwd": "${workspaceRoot}", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "PySpark", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "osx": { + "pythonPath": "${env.SPARK_HOME}/bin/spark-submit" + }, + "windows": { + "pythonPath": "${env.SPARK_HOME}/bin/spark-submit.cmd" + }, + "linux": { + "pythonPath": "${env.SPARK_HOME}/bin/spark-submit" + }, + "program": "${file}", + "cwd": "${workspaceRoot}", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Python Module", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config.python.pythonPath}", + "module": "module.name", + "cwd": "${workspaceRoot}", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Integrated Terminal/Console", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config.python.pythonPath}", + "program": "${file}", + "cwd": "null", + "console": "integratedTerminal", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit" + ] + }, + { + "name": "External Terminal/Console", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config.python.pythonPath}", + "program": "${file}", + "cwd": "null", + "console": "externalTerminal", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit" + ] + }, + { + "name": "Django", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config.python.pythonPath}", + "program": "${workspaceRoot}/manage.py", + "cwd": "${workspaceRoot}", + "args": [ + "runserver", + "--noreload" + ], + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput", + "DjangoDebugging" + ] + }, + { + "name": "Flask", + "type": "python", + "request": "launch", + "stopOnEntry": false, + "pythonPath": "${config.python.pythonPath}", + "program": "fully qualified path fo 'flask' executable. Generally located along with python interpreter", + "cwd": "${workspaceRoot}", + "env": { + "FLASK_APP": "${workspaceRoot}/quickstart/app.py" + }, + "args": [ + "run", + "--no-debugger", + "--no-reload" + ], + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Flask (old)", + "type": "python", + "request": "launch", + "stopOnEntry": false, + "pythonPath": "${config.python.pythonPath}", + "program": "${workspaceRoot}/run.py", + "cwd": "${workspaceRoot}", + "args": [], + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Watson", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config.python.pythonPath}", + "program": "${workspaceRoot}/console.py", + "cwd": "${workspaceRoot}", + "args": [ + "dev", + "runserver", + "--noreload=True" + ], + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Attach (Remote Debug)", + "type": "python", + "request": "attach", + "localRoot": "${workspaceRoot}", + "remoteRoot": "${workspaceRoot}", + "port": 3000, + "secret": "my_secret", + "host": "localhost" + } + ] +} \ No newline at end of file diff --git a/demo/example/__init__.pyc b/demo/example/__init__.pyc index 9f03568dba2fc7821e2d00c50ea53d8664d32618..989ce996c07aea202980f78be1beb516213a7300 100644 GIT binary patch delta 74 zcmeBVoXW_~{F#@l?{m{cb~AH31_lQGjQreG{p5_)y!6Dpbp4bpAepb5Qkj>So0+Ve cmS2=xoLZuvlA4>ZpIVWaTac5gKQTiQ0G5jx)&Kwi delta 44 zcmbQr*vZJw{F#@F{e|^Jb~AP(1_lOKtC)!aVtg?vsk!+vsTGO21v#lP6H62U2Ad5L diff --git a/demo/example/forms.pyc b/demo/example/forms.pyc index 1164ab9a5ad1e8b47b22472d71fa5efd37384255..1c0fcd4d513c9f92974b89e9b8cf959d9ad370a9 100644 GIT binary patch delta 712 zcmbQKeN%^>`7)(i{``WgATsrtzosd?#%dFlF-1DVD6^ixuE^Yv3J z5_1c3QuQa7GCLEi^fB{EVwGNJA=cE*uB^q3L>jyKFrREmyi+@k^+6uQUrj-J45Uiy84~-z?7_hF5+Khb%t%NnCMwOrJcJYc(F}&E?$7@fp53ly?_C p`N?kl3-B2)D^QD1`{s*+g81YoOA6!j+~#${N=$gHpUf^61OQ+NncV;Y diff --git a/demo/example/migrations/0001_initial.pyc b/demo/example/migrations/0001_initial.pyc index 039027e52776d90814ea90d25eba65b0903c0bd8..f38b08a606c2eac15e6e57f6c1a5e20733d40b63 100644 GIT binary patch delta 158 zcmX@WdxMvq`7EN!F*h?= vH!Z&?w>Y&#KP5FcUq7`XF}ENmRX;Z~y(qCHGe56bfATWc?bI-4GMg>{nnO9Z delta 134 zcmcb?dw`dn`7uNS#0G*F9l>h($ diff --git a/demo/example/migrations/__init__.pyc b/demo/example/migrations/__init__.pyc index 9b32d8107fd3c16f0afea116cfd26786e149f862..1361ac0a68266f3c59c556becee5aa878fdbbcb7 100644 GIT binary patch delta 85 zcmbQjxPXzJ`7}F1$3=9nV8Tq-X`pFrodFhFH>G~;IKr&x9r7|xuH#1o` nEx#zYIJHDSB{er+KeZw;w;(4~KQ}YID6u3nKd)GSVzD9s+_)Zj delta 55 zcmZ3$IE9g&`7}Kq?3=9meRxuL;#3W-G55=%1k L^NM38)++)4(=rli diff --git a/demo/example/models.pyc b/demo/example/models.pyc index 2081cebfc34f948270e2abcacc2f25d596bc1c62..91ab7848c2928570b878f63dd185172849e65d31 100644 GIT binary patch delta 361 zcmaFJe^7v(`7?aw8Z5S9B^fU5vQ}vTGQuERi^V0PvCo+lg>8GUT=If_c zB<2?6r0P%p%@|Lt(pIJ{B9$(dVkX)Ft}Mkwn!5Qhiw@DoTCw#KY3$@rY_o|~x`SO4 E0L5i;WdHyG delta 265 zcmX>o@Q|OK`7?ax74Hy_0T&-dz2eOFq#iXR>=EtN~B<2?6q{d8UXNt!s qJ(np9kMv?YX1s=%vJ~Udy;+`B2e0-fwq88iC%duF#wRVop$P!}*G-rJ diff --git a/demo/example/urls.pyc b/demo/example/urls.pyc index a23fe865ff97c8e178df06c0ac88357535aa2f48..575e7b714fb913c1e61b97da31553332361d4d0c 100644 GIT binary patch delta 76 zcmbOyyh@mz`7>^fU5vQ}vTGQuERi^V0QGvVdg1Zc1fdVs2)# eZd!g(ZgFafeoAU?zJ6*&Vs1fBs{Uj~&ba{jXBz8GUT=If_c zB<2?6r0P#@XMRJZ(#`W&j2MYk`=EtN~B<2?6q{d91%=`wA p^yY0WMvVC6<=N)pmH)y%mkFQ#6I>VZ>7RUo=PMrVlmGCV0085@O*Q}k diff --git a/demo/settings.pyc b/demo/settings.pyc index 1d5270f05afd076ac2310e860f8f30c97f47d3bc..4458bcc837a1e69e0831f423e920a05a082da946 100644 GIT binary patch delta 51 zcmbOuyh50r`7>oLV%@`OM^fU5vQ}vTGQuERi^V0Pv|K|{6(@#mw&DWnS H&DjV5y2%jU delta 56 zcmZ1>JV%(F`7>oLlwHO!}T&-eKvJ&&s^L0}y^AdA2lXcVbi*k!oOJY(| MbMs>+t8+F20Q-s(-T(jq diff --git a/demo/templates/example/empty-form.html b/demo/templates/example/empty-form.html index 674f1c90..f469cfd5 100644 --- a/demo/templates/example/empty-form.html +++ b/demo/templates/example/empty-form.html @@ -14,13 +14,13 @@