text stringlengths 1 3.55k | source stringlengths 24 207 | emb listlengths 1.02k 1.02k |
|---|---|---|
rearchitecting the system. because the engineering team needs to know different programming languages for different layers, there may be some internal resistance to this, and it may be tempting to go around a layer to make a quick fix. essentially, making sure that the architecture of the web platform is understood and... | openstax_introduction_to_computer_science_-_web | [
-0.011889190413057804,
-0.0006606272654607892,
-0.013403287157416344,
-0.023059453815221786,
-0.04093027487397194,
0.0339885875582695,
-0.034907016903162,
-0.024146439507603645,
0.018333785235881805,
0.027429936453700066,
-0.017681846395134926,
-0.010797945782542229,
-0.003787203459069133,
... |
of a web page. when a web page is loaded into the browser, the browser creates a dom of the page. the dom structure is a hierarchical treelike structure that organizes the elements of the page as objects. the model used by the dom enables dynamic access and facilitates the manipulation of content, structure, and style ... | openstax_introduction_to_computer_science_-_web | [
-0.026652866974473,
-0.02503056451678276,
-0.0005823325482197106,
-0.01971062272787094,
0.030134880915284157,
0.0310941394418478,
-0.0194901954382658,
0.0065299468114972115,
0.024897757917642593,
0.029601914808154106,
0.016593072563409805,
-0.0033629094250500202,
0.004878522828221321,
0.00... |
11. 1 • modern web applications architectures 571 figure 11. 6 this illustrates a user ’ s interaction with a single - page application ( spa ). ( attribution : copyright rice university, openstax, under cc by 4. 0 license ) the more sophisticated spas required large amounts of javascript on the client side. many end u... | openstax_introduction_to_computer_science_-_web | [
-0.00693175382912159,
-0.0034076343290507793,
-0.035644736140966415,
0.0016757557168602943,
-0.019149385392665863,
0.0363425649702549,
-0.02527203969657421,
-0.06758979707956314,
0.02486722730100155,
0.06321801245212555,
0.010856389999389648,
0.010260621085762978,
-0.010801530443131924,
-0... |
to notifications from the model and will send events to the view if needed. because the view binds to the viewmodel, the viewmodel doesn ’ t know anything about the view. the viewmodel can work with a local model in the browser, a remote model, or 572 11 • web applications development access for free at openstax. org b... | openstax_introduction_to_computer_science_-_web | [
-0.02081107348203659,
0.011485198512673378,
-0.024448063224554062,
-0.017669033259153366,
-0.03348268195986748,
0.005285876337438822,
-0.0012110845418646932,
-0.07292100787162781,
0.03509130701422691,
0.07843239605426788,
0.0010802660835906863,
0.0026951739564538,
0.008338439278304577,
0.0... |
regardless of these flaws, early browser - based frameworks proved the value of creating rich client - side apps. web standards evolved, and newer frameworks emerged that adhered to the newer standards and solved many of the problems of their predecessors. popular spa frameworks include angular, ember. js, react, and v... | openstax_introduction_to_computer_science_-_web | [
-0.006134056486189365,
-0.008819309994578362,
0.012478752993047237,
0.006465981248766184,
-0.02478506974875927,
-0.0036952937953174114,
-0.018664438277482986,
-0.04249965399503708,
0.026481233537197113,
0.02296791784465313,
-0.008632340468466282,
-0.001438730861991644,
0.02476658672094345,
... |
11. 1 • modern web applications architectures 573 architectures more scalable. think it through framework selection given that many web and native application frameworks are available today, is there a process that facilitates the selection of these frameworks? native mobile applications native mobile applications are ... | openstax_introduction_to_computer_science_-_web | [
0.009600182995200157,
-0.013586506247520447,
-0.054291702806949615,
-0.00417381152510643,
-0.008409067057073116,
0.04804624989628792,
-0.021847812458872795,
-0.01876506768167019,
0.05221860855817795,
0.04882916808128357,
-0.0070135039277374744,
0.010637115687131882,
0.000585511326789856,
-... |
##s such as revenue and customer retention. developers will likely write software in java, kotlin, or c + +. java was historically the primary language for android development. it runs on the java virtual machine ( jvm ), which allows for creating platform - independent software. kotlin is the preferred android develop... | openstax_introduction_to_computer_science_-_web | [
-0.011953902430832386,
-0.008584442548453808,
-0.04936067387461662,
-0.03029976412653923,
-0.001435334444977343,
0.02233463153243065,
0.016570651903748512,
-0.01055785920470953,
0.006110518239438534,
0.018221383914351463,
-0.01645752228796482,
0.01168326660990715,
-0.012630614452064037,
-0... |
the united states due to its simple, intuitive touch screen interface based on the success of its music player, the ipod, contributed to its popularity. the ios operating system runs apple ’ s device ecosystem, which includes iphones, apple tvs, apple watches, and more. xcode is the primary ide used for all apple devic... | openstax_introduction_to_computer_science_-_web | [
-0.018342744559049606,
-0.0184247475117445,
-0.007511941250413656,
-0.00812487956136465,
-0.022242948412895203,
0.020674439147114754,
0.012183577753603458,
-0.025225074961781502,
0.013961910270154476,
0.03789789229631424,
-0.0011783448280766606,
-0.02855159528553486,
-0.0159689262509346,
-... |
is possible with frameworks ( e. g., flutter, kotlin multiplatform mobile ), allowing developers to code in a single language and run solutions on both platforms. web apps can also run in a browser on mobile devices. they have the distinct advantage of responsiveness and can run on various screen sizes — thus allowing ... | openstax_introduction_to_computer_science_-_web | [
-0.0007305638282559812,
-0.023632045835256577,
-0.06195997819304466,
-0.02654166705906391,
-0.007537079509347677,
0.05762723460793495,
-0.009464814327657223,
-0.032715991139411926,
0.056927382946014404,
0.04035395383834839,
0.0051498557440936565,
0.0109561737626791,
0.019809899851679802,
-... |
11. 1 • modern web applications architectures 575 concepts in practice software patterns and frameworks as discussed in chapter 9 software engineering and chapter 10 enterprise and solution architectures management, architectural styles, architectural patterns, and design patterns are typically used to enforce the qual... | openstax_introduction_to_computer_science_-_web | [
0.03397383540868759,
0.005771608557552099,
-0.019666500389575958,
-0.0003990972472820431,
-0.016189949586987495,
0.03915729373693466,
-0.037518639117479324,
-0.06070247292518616,
0.02969333529472351,
0.06472864747047424,
-0.012474650517106056,
-0.02751113288104534,
0.006252671126276255,
0.... |
expected to be around a web that is decentralized, permissionless, and trusted. web 3. 0 sees a shift from the more traditional client - server model to a peer - to - peer networking model. a peer - to - peer network is one in which devices connect and can share data and processing without needing a centralized server.... | openstax_introduction_to_computer_science_-_web | [
0.03034340590238571,
-0.009157724678516388,
-0.021606581285595894,
-0.006758484523743391,
0.016912413761019707,
0.019219854846596718,
-0.032452162355184555,
-0.03400026634335518,
0.011945227161049843,
0.07258934527635574,
-0.04025132954120636,
0.0019487865502014756,
0.04943172633647919,
0.... |
of dlt. let ’ s compare a traditional web 2. 0 application with a 3. 0 dapp. in web 2. 0, if you created a website for users to post pictures and make comments on them, you would need functionality for authenticating users, 576 11 • web applications development access for free at openstax. org authorizing their actions... | openstax_introduction_to_computer_science_-_web | [
0.013771828263998032,
0.002202685922384262,
-0.009302959777414799,
-0.030197175219655037,
-0.010680034756660461,
0.0025448950473219156,
-0.043383244425058365,
-0.007323391269892454,
-0.00680881179869175,
0.07173561304807663,
-0.031167056411504745,
-0.008810807950794697,
0.035478074103593826,... |
to as a “ world computer. ” ethereum blockchain transactions are calls to methods that are implemented in smart contracts. these method calls result in change to the data ( aka, state ) that is maintained by the contracts within the blockchain. the ethereum blockchain records transactions into blocks that are added to ... | openstax_introduction_to_computer_science_-_web | [
0.0006893191020935774,
0.009937074035406113,
-0.037620410323143005,
0.0012785015860572457,
0.001226158463396132,
0.005037285853177309,
-0.01620553806424141,
-0.033991698175668716,
-0.011504164896905422,
0.035310547798871994,
-0.005460071377456188,
0.008824010379612446,
0.019357262179255486,
... |
11. 1 • modern web applications architectures 577 figure 11. 9 here is a traditional web 2. 0 website with back - end components replaced with a dapp. ( attribution : copyright rice university, openstax, under cc by 4. 0 license ) in the figure, the web server talks to a node of the blockchain, referred to as a full no... | openstax_introduction_to_computer_science_-_web | [
0.029084352776408195,
0.004166280385106802,
-0.0014397214399650693,
-0.0041011325083673,
0.050414375960826874,
-0.0014763945946469903,
-0.03249819576740265,
-0.032555874437093735,
0.0013400162570178509,
0.028342587873339653,
0.0017326156375929713,
-0.012483106926083565,
0.045586492866277695,... |
the data on the blockchain, a cost - effective approach would be to store the data using the interplanetary file system ( ipfs ) protocol. ipfs is a peer - to - peer distributed file - sharing protocol. you can go through a provider like pinata to get a hash value for the data ( i. e., a fixed length digest of the data... | openstax_introduction_to_computer_science_-_web | [
0.011404803954064846,
0.03724978491663933,
0.006662747357040644,
0.003254752838984132,
0.013851884752511978,
0.034233223646879196,
-0.018425066024065018,
-0.0034695661161094904,
0.02700093947350979,
0.025776386260986328,
-0.0050263251177966595,
0.02209577150642872,
0.02333861030638218,
-0.... |
4. 0 license ) up to this point, we ’ ve kept the front - end logic on a web server hosted in a centralized location. this is a good temporary approach for an organization that wants to transition a legacy solution to a dapp over time. because ipfs will host some of the data of the dapp, let ’ s move the front - end ht... | openstax_introduction_to_computer_science_-_web | [
0.019325165078043938,
-0.0032885391265153885,
-0.031174886971712112,
-0.009312482550740242,
-0.027331620454788208,
0.03360886126756668,
-0.036893293261528015,
-0.015252511948347092,
0.03858469799160957,
0.015680452808737755,
-0.027692915871739388,
0.012521599419414997,
0.03719865158200264,
... |
11. 1 • modern web applications architectures 579 figure 11. 11 the front - end web page has been moved to ipfs, and graphing query capabilities have been added. ( attribution : copyright rice university, openstax, under cc by 4. 0 license ) this results in a web 3. 0 application ; however, there are problems with this... | openstax_introduction_to_computer_science_-_web | [
0.030833445489406586,
0.0321231335401535,
0.012912590056657791,
0.02070700004696846,
-0.01690029725432396,
0.02305721677839756,
-0.02026256173849106,
-0.03871039301156998,
-0.007120662834495306,
0.06616558879613876,
-0.009266849607229233,
-0.010895194485783577,
0.004854287952184677,
0.0087... |
to 100. a zero - knowledge rollup ( zk - rollup ) is a protocol that bundles transactions into batches that are executed off the mainnet. for every batch, a zk - rollup operator submits a summary of required changes once the transactions in the batch have been executed. operators have also produced validity proofs that... | openstax_introduction_to_computer_science_-_web | [
0.04707686975598335,
-0.01940673217177391,
0.01704147271811962,
0.02429565228521824,
-0.02720353752374649,
-0.02168535441160202,
-0.014128613285720348,
-0.02045435458421707,
-0.020622296258807182,
0.07082526385784149,
0.013753608800470829,
0.0213399026542902,
0.037459153681993484,
0.006608... |
11. 1 • modern web applications architectures 581 this architecture focused on blockchains and used ethereum as the principal implementation. however, there are other dlt solutions. hashgraph is an approach where only selected nodes store the entire blockchain, and voting mechanisms are introduced to validate if the bl... | openstax_introduction_to_computer_science_-_web | [
0.022857269272208214,
0.005778916645795107,
-0.0036364335101097822,
0.00922385510057211,
-0.01979888789355755,
0.01273147203028202,
-0.033174436539411545,
-0.049308840185403824,
0.023647340014576912,
0.06309590488672256,
-0.03966287523508072,
-0.017044343054294586,
0.04875107482075691,
0.0... |
” to the digital artwork a person generates. ai models are trained to recognize existing artwork ( e. g., paintings available via the wikiart. org api ) that may be copyrighted — so ownership is still being determined in the courts. here, the term ownership is used to attribute ai image creation and nothing more. while... | openstax_introduction_to_computer_science_-_web | [
0.00604443671181798,
0.025737203657627106,
-0.027546260505914688,
-0.007904608733952045,
0.0408770814538002,
-0.06085143983364105,
-0.013971204869449139,
-0.01815561205148697,
-0.0013977147173136473,
0.0415492057800293,
-0.014859793707728386,
0.00806845910847187,
0.04389836639165878,
0.001... |
user ’ s interaction with a hybrid web 2. 0 / 3. 0 application. ( attribution : copyright rice university, openstax, under cc by 4. 0 license ) this model still has a centralized web 2. 0 server for artwork generation and account management ; however, portions that deal with nft ownership and selling of that ownership ... | openstax_introduction_to_computer_science_-_web | [
0.012543573044240475,
0.0093898456543684,
-0.020140139386057854,
0.0029032977763563395,
0.02023710310459137,
-0.030988404527306557,
-0.047855641692876816,
-0.032174330204725266,
0.018361780792474747,
0.04375418648123741,
-0.041287269443273544,
0.033558279275894165,
0.04363304004073143,
0.0... |
11. 2 sample responsive wad with bootstrap and django learning objectives by the end of this section, you will be able to : • create a todo web application with bootstrap and django • create a django project • create and register a todo app • define the todo model • set up the django rest apis • create the user interfa... | openstax_introduction_to_computer_science_-_web | [
-0.0054511260241270065,
0.002149492735043168,
-0.028073366731405258,
-0.040283918380737305,
-0.026562312617897987,
0.036411769688129425,
-0.009733710438013077,
0.007377380970865488,
0.029623040929436684,
0.08323463797569275,
-0.06369702517986298,
-0.019672419875860214,
0.01359764114022255,
... |
3. 9. 4. • figure 11. 14 shows adding python and its scripts subfolder to your path environment data ( on windows, the path updates might be : c : \ users \ your _ username \ appdata \ local \ programs \ python \ python39 and c : \ users \ your _ username \ appdata \ local \ programs \ python \ python39 \ scripts ). 58... | openstax_introduction_to_computer_science_-_web | [
0.030925309285521507,
0.019974952563643456,
-0.035962220281362534,
-0.02096083015203476,
-0.042884666472673416,
0.017871811985969543,
0.014240878634154797,
-0.007455074694007635,
-0.013462763279676437,
0.07845607399940491,
-0.045935820788145065,
0.027399078011512756,
0.010741216130554676,
... |
11. 2 • sample responsive wad with bootstrap and django 585 figure 11. 15 this screenshot displays the sequence of steps needed to install the python environment. ( used with permission from microsoft ) creating the django project the first step to building a django web application is to create a django project, which ... | openstax_introduction_to_computer_science_-_web | [
0.0006666654953733087,
0.015815623104572296,
-0.043130386620759964,
-0.03281007707118988,
-0.018747983500361443,
0.021625515073537827,
-0.020318172872066498,
0.019670039415359497,
0.004327838309109211,
0.07010148465633392,
-0.07655147463083267,
-0.014078336767852306,
0.02281060442328453,
0... |
11. 17 shows the django page. figure 11. 17 once the django project setup is successfully completed, this page should appear at http : / / localhost : 8000. ( credit : django is a registered trademark of the django software foundation. ) | openstax_introduction_to_computer_science_-_web | [
-0.012735947035253048,
-0.00738135538995266,
-0.044293638318777084,
-0.01600397750735283,
-0.05766815319657326,
0.0038564696442335844,
-0.020057355985045433,
-0.00831435527652502,
-0.001834709895774722,
0.040185313671827316,
-0.035216815769672394,
0.016768893226981163,
0.021862449124455452,
... |
11. 2 • sample responsive wad with bootstrap and django 587 link to learning django ( https : / / openstax. org / r / 76django ) is a free and open - source python web framework that can make web development more efficient and less time - consuming. with an emphasis on streamlining web development and making it easier ... | openstax_introduction_to_computer_science_-_web | [
-0.021312691271305084,
0.007258113473653793,
-0.04149117320775986,
-0.026134157553315163,
-0.031730033457279205,
0.023802151903510094,
-0.015428383834660053,
-0.007573287468403578,
0.01646541990339756,
0.0907350704073906,
-0.061708252876996994,
0.0052903806790709496,
0.024961337447166443,
... |
‘ rest _ framework ’ and ‘ todo ’. ( rendered in django, a registered trademark of the django software foundation ; attribution : copyright rice university, openstax, under cc by 4. 0 license ) define the todo model once you register and install the todo web application, you will be able to create todo tasks, which can... | openstax_introduction_to_computer_science_-_web | [
-0.011129038408398628,
-0.0022734038066118956,
-0.042366549372673035,
-0.06861133873462677,
-0.008630971424281597,
0.02584948018193245,
0.01571742445230484,
-0.0009886730695143342,
0.04656669870018959,
0.07905738800764084,
-0.04123278707265854,
-0.007719974499195814,
0.02572421170771122,
0... |
11. 2 • sample responsive wad with bootstrap and django 589 the category and todolist python classes describe the properties for the models for category and todolist tables, respectively. the todolist model contains a foreignkey field to the category model. each todo item will be associated with one category. after cre... | openstax_introduction_to_computer_science_-_web | [
-0.014999253675341606,
0.021696653217077255,
-0.026490231975913048,
-0.012751470319926739,
0.019123263657093048,
0.004633007571101189,
0.013723817653954029,
0.02720925584435463,
0.024533970281481743,
0.058277830481529236,
-0.027315545827150345,
-0.012559479102492332,
0.022426865994930267,
... |
true ) ), ('created ', models. datefield ( default ='2022 - 01 - 30') ), ('due _ date ', models. datefield ( default ='2022 - 01 - 30') ), ('category ', models. foreignkey ( default ='general ', on _ delete = django. db. models. deletion. do _ nothing, to ='todo. category') ), ], options = {'ordering': ['- created'], 5... | openstax_introduction_to_computer_science_-_web | [
-0.013553466647863388,
-0.0030326039995998144,
-0.04647422209382057,
-0.045628622174263,
-0.02455889992415905,
0.03715205565094948,
0.008110973984003067,
0.019087746739387512,
0.03597244247794151,
0.07281900942325592,
-0.045463770627975464,
-0.015850285068154335,
0.013740425929427147,
0.02... |
site. register ( models. category, categoryadmin ) the next step is to create a superuser account that allows access to the admin interface. to do this, run the following command and follow the prompts to enter a username, email address, and password for the superuser. $ python manage. py createsuperuser once this step... | openstax_introduction_to_computer_science_-_web | [
0.013140557333827019,
-0.02868911810219288,
-0.03649643808603287,
-0.036565788090229034,
0.0315084382891655,
0.006744750775396824,
-0.002676910487934947,
0.009253235533833504,
0.025737037882208824,
0.06344756484031677,
-0.010405593551695347,
-0.022715210914611816,
0.03173849359154701,
-0.0... |
11. 2 • sample responsive wad with bootstrap and django 591 figure 11. 20 the admin interface is where superusers can create, edit, and delete categories and todo items in the todo web application. ( rendered in django, a registered trademark of the django software foundation ; attribution : copyright rice university, ... | openstax_introduction_to_computer_science_-_web | [
-0.013567549176514149,
0.01716487854719162,
-0.02408055029809475,
-0.022623300552368164,
0.005357300862669945,
0.016560902819037437,
-0.016425780951976776,
-0.013126177713274956,
0.04684727266430855,
0.09780963510274887,
-0.05187316611409187,
-0.0202072374522686,
0.011388537473976612,
0.03... |
the category 592 11 • web applications development access for free at openstax. org serializer and the todo serializer. to do this, open todo / views. py and add the code shown in the code snippet that follows. the viewsets class, which provides a default implementation of the crud operations, is imported from rest _ f... | openstax_introduction_to_computer_science_-_web | [
-0.034116439521312714,
0.010610740631818771,
-0.023699913173913956,
-0.01707213558256626,
0.0035920492373406887,
0.016438454389572144,
-0.002534085651859641,
-0.008217062801122665,
0.034337881952524185,
0.09727340936660767,
-0.048118896782398224,
-0.011079084128141403,
0.0377395860850811,
... |
='todos') urlpatterns = [ path ('', index, name = " todolist " ), path ( r'api / ', include ( router. urls ) ), ] once you complete this step, launch the django server using the following command : $ python manage. py runserver to access the api, launch a browser and navigate to http : / / 127. 0. 0. 1 : 8000 / api /. ... | openstax_introduction_to_computer_science_-_web | [
-0.009358320385217667,
0.015633005648851395,
-0.03792041912674904,
-0.038991622626781464,
-0.010851112194359303,
0.01280765701085329,
-0.003231356618925929,
0.02188709005713463,
0.0696842148900032,
0.09188728779554367,
-0.05272696539759636,
0.02349800057709217,
0.03592284396290779,
0.03575... |
11. 2 • sample responsive wad with bootstrap and django 593 figure 11. 21 once the url paths for the api are created, two api paths are listed — one path for categories and the other for todo. ( rendered in django, a registered trademark of the django software foundation ; attribution : copyright rice university, opens... | openstax_introduction_to_computer_science_-_web | [
-0.021816562861204147,
0.011679681949317455,
-0.03212201967835426,
0.0044946372509002686,
-0.021021705120801926,
0.016984673216938972,
0.004997185431420803,
-0.005819037090986967,
0.038674838840961456,
0.10913941264152527,
-0.006780189462006092,
0.0008095400989986956,
0.012676337733864784,
... |
this category is pulled up on the category instance page, the delete button is visible at the top to delete the category. if the category needs to be updated, the put button visible near the bottom can be used for updates. figure 11. 24 the category instance page provides delete and put buttons, which, respectively, ca... | openstax_introduction_to_computer_science_-_web | [
-0.022482404485344887,
-0.008249914273619652,
-0.028322305530309677,
-0.010142232291400433,
-0.021066902205348015,
-0.008652856573462486,
-0.000709784624632448,
-0.014161057770252228,
0.04604935646057129,
0.07606510072946548,
0.020647773519158363,
-0.007479219697415829,
0.010162727907299995,... |
11. 2 • sample responsive wad with bootstrap and django 595 item has a category field that appears as a drop - down list of categories. the crud operations also can be performed on the todolist table. this will be done next through the user interface via templates. figure 11. 25 after the routers are created, a todo it... | openstax_introduction_to_computer_science_-_web | [
-0.02089592069387436,
0.00215025432407856,
-0.0137576749548316,
-0.023270459845662117,
-0.010933483019471169,
0.02784697338938713,
0.002141786739230156,
0.029571209102869034,
0.03446165472269058,
0.09047560393810272,
-0.04118529334664345,
-0.012604332529008389,
0.023533504456281662,
0.0399... |
trademark of the django software foundation ; attribution : copyright rice university, openstax, under cc by 4. 0 license ) after adding the css and js files to the static / directory, the next step is to open the todoapp / settings. py file, navigate to the bottom of the file, and add the path variables shown in the f... | openstax_introduction_to_computer_science_-_web | [
-0.0006957871373742819,
0.01800559088587761,
0.007160831708461046,
-0.004750402178615332,
-0.04840748384594917,
0.010754120536148548,
-0.008922711946070194,
0.03223313018679619,
0.0430462509393692,
0.07852178812026978,
-0.03799375891685486,
-0.0005761946085840464,
0.028431223705410957,
0.0... |
post [ " description " ] # title date = str ( request. post [ " date " ] ) # date category = request. post [ " category _ select " ] # category content = title + " - - " + date + " " + category # content todo = todolist ( title = title, content = content, due _ date = date, | openstax_introduction_to_computer_science_-_web | [
-0.0009776208316907287,
-0.011198943480849266,
-0.01587357185781002,
-0.036548834294080734,
-0.024904480203986168,
-0.016507498919963837,
0.01858905702829361,
0.013748559169471264,
0.07217326015233994,
0.06953220069408417,
-0.0005113588413223624,
-0.03260991722345352,
0.0069180987775325775,
... |
11. 2 • sample responsive wad with bootstrap and django 597 category = category. objects. get ( name = category ) ) todo. save ( ) # save todo item return redirect ( " / " ) # reload page if " taskdelete " in request. post : # check if request is to delete a todo checkedlist = request. post [ " checkedbox " ] # checked... | openstax_introduction_to_computer_science_-_web | [
-0.030685443431138992,
-0.020973803475499153,
-0.00404716981574893,
-0.015922896564006805,
-0.028192581608891487,
0.0019173120381310582,
-0.005403497721999884,
0.012809711508452892,
0.04727202281355858,
0.07386130094528198,
-0.04917200282216072,
0.0004158961237408221,
0.024276455864310265,
... |
, 0, 0. 2 ) ; box - shadow : 0 0 2px rgba ( 0, 0, 0, 0. 2 ) ; }. row { display : block ; padding : 10px ; text - align : center ; width : 100 % ; clear : both ; overflow : hidden ; 598 11 • web applications development access for free at openstax. org }. half { width : 50 % ; float : left ; }. content { background : # ... | openstax_introduction_to_computer_science_-_web | [
0.009661073796451092,
0.000025992263545049354,
0.036243606358766556,
0.01842089183628559,
-0.03980203717947006,
-0.028803901746869087,
0.05852168798446655,
0.004099366255104542,
0.011883910745382309,
0.0503263957798481,
0.026987630873918533,
0.04502349719405174,
-0.030865279957652092,
0.00... |
11. 2 • sample responsive wad with bootstrap and django 599 height : 100 % ; width : 100 % ; padding : 0 20px ; position : absolute ; top : 0 ; vertical - align : middle ; display : inline - block ; border : none ; border - radius : none ; font - size : 13px ; color : # 777 ; margin : 0 ; font - family : " open sans ",... | openstax_introduction_to_computer_science_-_web | [
-0.007465716451406479,
-0.012256314046680927,
0.017516717314720154,
0.029750632122159004,
-0.050189584493637085,
0.029403937980532646,
0.035455185920000076,
0.036693453788757324,
0.012967731803655624,
0.06885305047035217,
-0.020784085616469383,
0.008837663568556309,
-0.003015651134774089,
... |
##5a6 ; font - weight : bold ; }. inputcontainer label { padding : 5px 20px ; font - size : 11px ; font - weight : 600 ; text - transform : uppercase ; color : # 777 ; display : block ; position : absolute ; } button { font - family : " open sans ", sans - serif ; background : transparent ; border - radius : 2px ; bord... | openstax_introduction_to_computer_science_-_web | [
-0.02726958878338337,
-0.03588973730802536,
0.03380296751856804,
0.014325366355478764,
-0.023619474843144417,
0.01179077010601759,
0.05440151318907738,
0.01997874118387699,
0.031650591641664505,
0.021241523325443268,
-0.008587663061916828,
0.0014810730936005712,
0.009568252600729465,
-0.00... |
11. 2 • sample responsive wad with bootstrap and django 601 }. taskadd : hover { background : # 303030 ; }. taskdelete { background : # e74c3c ; padding - left : 30px ; }. taskdelete : hover { background : # c0392b ; } / * task styles * /. tasklist { list - style : none ; padding : 0 20px ; }. taskitem { border - top :... | openstax_introduction_to_computer_science_-_web | [
-0.013796648010611534,
-0.04226383939385414,
0.026466546580195427,
0.024586033076047897,
-0.03301924094557762,
0.018671944737434387,
0.04025628790259361,
0.024306315928697586,
0.03113286942243576,
0.05031030252575874,
-0.009020249359309673,
0.006690528709441423,
0.010733121074736118,
0.025... |
- transform : uppercase ; margin - right : 20px ; }. category - { background : transparent ; }. category - personal { background : # 2980b9 ; }. category - work { background : # 8e44ad ; }. category - school { background : # f39c12 ; }. category - cleaning { background : # 16a085 ; }. category - other { background : # ... | openstax_introduction_to_computer_science_-_web | [
0.0014573739608749747,
-0.013304204680025578,
0.03708067163825035,
-0.00021667442342732102,
0.01099202036857605,
-0.005674806889146566,
0.060595106333494186,
0.005831329617649317,
-0.010043298825621605,
0.04087582975625992,
0.051052458584308624,
0.009267622604966164,
0.04210488498210907,
0... |
11. 2 • sample responsive wad with bootstrap and django 603 font - weight : 600 ; text - transform : uppercase ; color : # 777 ; } footer a { color : # f39c12 ; } / * custom checkboxes * /. taskcheckbox { - webkit - appearance : none ; appearance : none ; - webkit - transition : all 0. 3s ; transition : all 0. 3s ; dis... | openstax_introduction_to_computer_science_-_web | [
-0.02323629893362522,
-0.046311382204294205,
0.046737149357795715,
0.022011002525687218,
-0.03613933175802231,
0.02550756372511387,
0.012346570380032063,
0.030767682939767838,
0.008284509181976318,
0.0478532649576664,
-0.0040982794016599655,
-0.004350405186414719,
0.017875390127301216,
0.0... |
; outline : none ; padding : 0 100px ; } the first template file is base. html, which is the file that includes links to bootstrap and jquery. to illustrate these links, a snippet of the base. html file is shown in the code. the bootstrap navigation bar is implemented in this file. <! doctype html > < html > < head > <... | openstax_introduction_to_computer_science_-_web | [
-0.0021655599121004343,
-0.009328842163085938,
0.021457618102431297,
-0.015926657244563103,
0.00478342454880476,
-0.014997614547610283,
0.00008892274490790442,
0.010736408643424511,
0.010895523242652416,
0.06452538818120956,
-0.03873978555202484,
0.004179104696959257,
0.00513783423230052,
... |
11. 2 • sample responsive wad with bootstrap and django 605 <! - - bootstrap core javascript - - > < script type = " text / javascript " src = " { % static'js / bootstrap. bundle. min. js'% } " > < / script > < script < / head > < body > < nav class = " navbar navbar - dark bg - dark justify - content - between " > < a... | openstax_introduction_to_computer_science_-_web | [
-0.03324032574892044,
-0.002217579632997513,
-0.008736314252018929,
0.004737474024295807,
-0.023370901122689247,
0.005115977488458157,
-0.0009032736998051405,
0.030391788110136986,
0.02070501819252968,
0.08633989840745926,
-0.037941113114356995,
0.010771912522614002,
0.004989358596503735,
... |
< / h1 > <! - - < p class = " tagline " > django todo app < / p > - - > < form action = " " method = " post " > { % csrf _ token % } <! - - csrf token for basic security - - > < div class = " inputcontainer " > < input type = " text " id = " description " class = " taskname " placeholder = " what do you need to do? " n... | openstax_introduction_to_computer_science_-_web | [
-0.03257577493786812,
-0.015579765662550926,
-0.017595121636986732,
0.0062910630367696285,
-0.03597431629896164,
0.0048911189660429955,
0.022221043705940247,
0.02062089741230011,
0.05343462526798248,
0.07825380563735962,
-0.02684842422604561,
0.028405185788869858,
0.01751401275396347,
0.02... |
" > < i class = " fa fa - plus icon " > < / emphasis > add task < / button > < button class = " taskdelete " name = " taskdelete " formnovalidate = " " type = " submit " onclick = " $ ('input # sublist'). click ( ) ; " > < i class = " fa fa - trash - o icon " > < / emphasis > delete tasks < / button > < / div > < ul cl... | openstax_introduction_to_computer_science_-_web | [
-0.04458862543106079,
-0.017047801986336708,
-0.0007174373604357243,
0.0076139383018016815,
-0.04188019037246704,
-0.002135441405698657,
0.02686445228755474,
0.035291559994220734,
0.04327008128166199,
0.05771404877305031,
-0.009326879866421223,
0.029371408745646477,
0.03515641391277313,
0.... |
< / div > <! - - container - - > < / div > | openstax_introduction_to_computer_science_-_web | [
-0.01928679086267948,
0.004748007282614708,
0.0035541020333766937,
-0.01731334626674652,
-0.02273496240377426,
-0.0024028506595641375,
0.025849053636193275,
0.02250847779214382,
0.03622974455356598,
0.04508429765701294,
0.022255977615714073,
0.04016122594475746,
0.02959061786532402,
-0.001... |
11. 2 • sample responsive wad with bootstrap and django 607 { % endblock % } the first step to access the todo django web application is to restart the django server using the following command : $ python manage. py runserver next, launch a browser and navigate to http : / / localhost : 8000. the page highlighted in fi... | openstax_introduction_to_computer_science_-_web | [
-0.03560439497232437,
0.007119849324226379,
-0.020393436774611473,
0.0009925721678882837,
-0.0236818790435791,
0.013127824291586876,
-0.017756300047039986,
0.014346255920827389,
0.03473189100623131,
0.08038125187158585,
-0.0694071352481842,
0.013999146409332752,
0.034498054534196854,
0.051... |
11. 3 sample responsive wad with bootstrap / react and node learning objectives by the end of this section, you will be able to : • create a todo web application with bootstrap, react, and node • create a node back end • build the controller • set up the rest api • create the react front end • connect the react front e... | openstax_introduction_to_computer_science_-_web | [
-0.033918485045433044,
-0.008641542866826057,
-0.020862214267253876,
-0.032541826367378235,
0.00387299875728786,
0.018727578222751617,
-0.032218124717473984,
-0.0026925888378173113,
0.04610655829310417,
0.06794071197509766,
-0.059939801692962646,
-0.024209894239902496,
0.017650114372372627,
... |
back end several steps are needed to build the node application back end required for the todo application. this section will explain each of these steps. link to learning node ( https : / / openstax. org / r / 76nodejs ) is a javascript runtime environment that provides users with the tools to develop web applications... | openstax_introduction_to_computer_science_-_web | [
-0.006533375475555658,
0.0028974299784749746,
-0.026752687990665436,
-0.04011092334985733,
0.006249591242522001,
0.01651393249630928,
-0.048044975847005844,
-0.018903976306319237,
0.06439022719860077,
0.05737091228365898,
-0.04039086401462555,
-0.004796973895281553,
0.02611570805311203,
-0... |
11. 3 • sample responsive wad with bootstrap / react and node 611 after the node application initialization is completed, a package. json file is generated, as shown in the following code. { " name " : " nodebackend ", " version " : " 1. 0. 0 ", " description " : " todo web application with bootstrap, reactjs and nodej... | openstax_introduction_to_computer_science_-_web | [
-0.006279232911765575,
0.011292876675724983,
-0.0009738819790072739,
-0.02306801825761795,
-0.042035460472106934,
0.012631918303668499,
-0.019519267603754997,
0.004458295647054911,
0.00796930305659771,
0.044054191559553146,
-0.043669648468494415,
-0.03842306137084961,
0.026961298659443855,
... |
bodyparser = require ( " body - parser " ) ; const cors = require ( " cors " ) ; const app = express ( ) ; var corsoptions = { origin : " http : / / localhost : 8081 " } ; 612 11 • web applications development access for free at openstax. org app. use ( cors ( corsoptions ) ) ; / / parse requests of content - type - ap... | openstax_introduction_to_computer_science_-_web | [
0.0047629233449697495,
-0.002309654373675585,
-0.01054409146308899,
-0.003715731203556061,
-0.02423282526433468,
0.028320975601673126,
-0.020172685384750366,
-0.009756247512996197,
0.04827467352151871,
0.0668957531452179,
-0.04272083938121796,
-0.003462793305516243,
0.021541805937886238,
-... |
. figure 11. 31 once the express web server is started, this page should appear at http : / / localhost : 8080 /. ( rendered in node ; attribution : copyright rice university, openstax, under cc by 4. 0 license ) configuring the mongodb database and mongoose after the express web server is created, the next step is to ... | openstax_introduction_to_computer_science_-_web | [
-0.009475006721913815,
0.0197378471493721,
0.0016206250293180346,
-0.04978335276246071,
-0.019856076687574387,
0.01525084488093853,
-0.03147769719362259,
-0.013097885996103287,
0.02716030366718769,
0.05595255643129349,
-0.04249302297830582,
0.0032339703757315874,
0.0389985628426075,
0.0075... |
11. 3 • sample responsive wad with bootstrap / react and node 613 once the mongodb connection url is configured, the next step is to add code to connect to the database using mongoose. to do this, in the nodebackend / directory, create the models / directory. in the models / directory, create the index. js file and add... | openstax_introduction_to_computer_science_-_web | [
-0.021549809724092484,
0.025676889345049858,
-0.0184574443846941,
-0.026099178940057755,
-0.0019056376768276095,
0.020504463464021683,
-0.007226014509797096,
-0.00888141430914402,
0.021431051194667816,
0.07496339827775955,
-0.025201871991157532,
-0.023272065445780754,
0.016714032739400864,
... |
##goose schema for the todos model, which results in the creation of a todos collection in the mongodb database. module. exports = mongoose = > { var schema = mongoose. schema ( { title : { type : string, required : true, }, content : { type : string, required : false, }, created : { type : string, default : date. now ... | openstax_introduction_to_computer_science_-_web | [
-0.009466134011745453,
0.019370293244719505,
0.007918508723378181,
-0.06318502128124237,
-0.01594449020922184,
-0.006555045954883099,
-0.008657513186335564,
0.011978932656347752,
0.03097379207611084,
0.0784638449549675,
-0.006095676217228174,
-0.02259059250354767,
0.01595001108944416,
0.01... |
res. status ( 400 ). send ( { message : " title can not be empty! " } ) ; return ; } if (! req. body. category ) { res. status ( 400 ). send ( { message : " category can not be empty! " } ) ; return ; } if (! req. body. due _ date ) { res. status ( 400 ). send ( { message : " due date can not be empty! " } ) ; return ;... | openstax_introduction_to_computer_science_-_web | [
-0.027699826285243034,
-0.01675872504711151,
-0.014950411394238472,
0.0010844208300113678,
-0.01000997330993414,
-0.03281848132610321,
0.007708039600402117,
0.028918685391545296,
0.04016486555337906,
0.07046022266149521,
-0.0015942186582833529,
-0.011983925476670265,
0.03338037431240082,
-... |
11. 3 • sample responsive wad with bootstrap / react and node 615 / / save the todo item in the database todo. save ( todo ). then ( data = > { res. send ( data ) ; } ). catch ( err = > { res. status ( 500 ). send ( { message : err. message | | " an error occurred while creating the todo item. " } ) ; } ) ; } ; / / ret... | openstax_introduction_to_computer_science_-_web | [
-0.03467636927962303,
-0.0018320282688364387,
-0.00803856085985899,
0.0232992023229599,
-0.032049115747213364,
-0.029777295887470245,
-0.015729932114481926,
0.006334027275443077,
0.06598880141973495,
0.07437611371278763,
-0.012556447647511959,
-0.0020442672539502382,
0.019913800060749054,
... |
. org exports. update = ( req, res ) = > { if (! req. body ) { return res. status ( 400 ). send ( { message : " specify a todo item to update. todo item cannot be empty! " } ) ; } const id = req. params. id ; todos. findbyidandupdate ( id, req. body, { usefindandmodify : false } ). then ( data = > { if (! data ) { res.... | openstax_introduction_to_computer_science_-_web | [
-0.033087339252233505,
-0.017592716962099075,
-0.016786906868219376,
0.008652715012431145,
-0.032108601182699203,
-0.040944602340459824,
-0.022374117746949196,
-0.00010632719931891188,
0.06604965031147003,
0.08428692072629929,
0.006337125785648823,
-0.003437172854319215,
0.020787226036190987... |
; / / delete all todo items from the database exports. deleteall = ( req, res ) = > { todos. deletemany ( { } ) | openstax_introduction_to_computer_science_-_web | [
-0.031021270900964737,
0.006799610797315836,
0.023182548582553864,
-0.0007102171657606959,
-0.04964810609817505,
-0.05888332426548004,
-0.002094845287501812,
0.0220034122467041,
0.06212665140628815,
0.09487637132406235,
0.0006775431684218347,
0.005455739330500364,
0.01198557484894991,
-0.0... |
11. 3 • sample responsive wad with bootstrap / react and node 617. then ( data = > { res. send ( { message : ` $ { data. deletedcount } all todo items were deleted successfully! ` } ) ; } ). catch ( err = > { res. status ( 500 ). send ( { message : err. message | | " an error occurred while deleting all todo items. " }... | openstax_introduction_to_computer_science_-_web | [
-0.029976408928632736,
0.01141874399036169,
0.003985709045082331,
-0.0023996939416974783,
-0.042656153440475464,
-0.016891812905669212,
-0.03110148198902607,
-0.0016844859346747398,
0.05322515591979027,
0.11069352179765701,
-0.042507290840148926,
0.0042995186522603035,
0.014285271055996418,
... |
router. delete ( " / : id ", todos. delete ) ; / / delete all todo items router. delete ( " / ", todos. deleteall ) ; app. use ( " / api / todos ", router ) ; } ; the next step is to update nodebackend / server. js to import the routes shown in the following code. / / routes app. get ( " / ", ( req, res ) = > { 618 11 ... | openstax_introduction_to_computer_science_-_web | [
-0.01599426195025444,
0.016873667016625404,
0.005860757548362017,
-0.0074919736944139,
-0.040756307542324066,
-0.009783048182725906,
-0.035225097090005875,
0.0049583325162529945,
0.07369524240493774,
0.10145657509565353,
-0.04200028255581856,
0.021082716062664986,
0.01833273097872734,
-0.0... |
localhost : 8080 / api / todos to test creating a todo item. • in the data input frame, select “ body. ” • select “ raw ” and “ json ” for the data format. • enter a json object representing a todo item to be created as shown. • click send. after you follow these steps, the bottom frame should receive a response with s... | openstax_introduction_to_computer_science_-_web | [
-0.049214646220207214,
-0.01636926643550396,
-0.026245737448334694,
-0.04254643991589546,
-0.020917842164635658,
-0.010053234174847603,
-0.005894018337130547,
-0.0007546409615315497,
0.09311573207378387,
0.06882304698228836,
-0.03241880610585213,
0.014708404429256916,
0.040936484932899475,
... |
11. 3 • sample responsive wad with bootstrap / react and node 619 creating the react app to create the react app, the first step is to run the following command. this should be done in a directory that is outside and separate from the nodebackend / directory. $ npx create - react - app reactfrontend once you run the co... | openstax_introduction_to_computer_science_-_web | [
-0.02363765984773636,
-0.009245357476174831,
-0.02126481756567955,
-0.01989399828016758,
0.02343345806002617,
0.0023182774893939495,
-0.03486736863851547,
0.013794369995594025,
0.024503536522388458,
0.05787069723010063,
-0.041726697236299515,
-0.030924681574106216,
0.04478416591882706,
-0.... |
bootstrap4 css file into the react application. to do this, open reactfrontend / src / index. js and add the following bootstrap import. import react from'react'; import reactdom from'react - dom'; import'bootstrap / dist / css / bootstrap. css'; import '. / index. css'; import app from '. / app'; import reportwebvital... | openstax_introduction_to_computer_science_-_web | [
-0.01988622546195984,
-0.01811915449798107,
-0.02272234670817852,
-0.02149028331041336,
0.040769148617982864,
0.0355832614004612,
-0.02498423308134079,
0.009368200786411762,
0.023934567347168922,
0.056892190128564835,
-0.028303980827331543,
-0.03383610025048256,
0.04159935563802719,
-0.017... |
, { component } from " react " ; import modal from ". / components / modal " ; import nav from ". / components / navcomponent " ; import axios from " axios " ; import { button, form, formgroup, label, input } from'reactstrap'; to compare with the django web application in 11. 2 sample responsive wad with bootstrap and ... | openstax_introduction_to_computer_science_-_web | [
-0.005472129676491022,
-0.03619399666786194,
-0.01085678767412901,
0.00454792520031333,
0.029273057356476784,
0.02642849087715149,
-0.02584497630596161,
0.011586073786020279,
0.006297641899436712,
0.08002400398254395,
-0.02123948372900486,
-0.0008342664805240929,
0.03077283874154091,
-0.02... |
11. 3 • sample responsive wad with bootstrap / react and node 621 class app extends component { constructor ( props ) { super ( props ) ; this. state = { todochecked : false, todolist : [ ], categories : [ ], description : " ", modal : false, activeitem : { title : " ", description : " ", completed : false, }, } ; } th... | openstax_introduction_to_computer_science_-_web | [
-0.034140270203351974,
-0.02252691425383091,
-0.0024752519093453884,
-0.014691582880914211,
-0.0007709685596637428,
-0.014054453000426292,
-0.005239272024482489,
-0.011048429645597935,
0.04699625074863434,
0.05581778660416603,
-0.013467924669384956,
-0.00957729946821928,
0.040165022015571594... |
label htmlfor = " description " > due date < / label > < input type = " text " id = " description " name = " description " placeholder = " due date ( mm / dd / yyyy ) " value = { this. state. description } / > < / formgroup > < / div > < div classname = " row " > < button classname = " taskadd " name = " taskadd " type... | openstax_introduction_to_computer_science_-_web | [
-0.07438839972019196,
-0.045548632740974426,
-0.03052804060280323,
-0.011045476421713829,
-0.022132650017738342,
0.01933819055557251,
-0.030024785548448563,
-0.024011844769120216,
0.05325227230787277,
0.04762711003422737,
-0.03701116517186165,
-0.007818333804607391,
0.036887165158987045,
0... |
. 1. 0 ", " private " : true, " proxy " : " http : / / localhost : 8080 ", " dependencies " : { the next step is to create a service on the front end to send http requests to the back end. this process uses axios and is similar to how routes were created on the back - end side. the service will export crud functions an... | openstax_introduction_to_computer_science_-_web | [
-0.05077574402093887,
0.013723017647862434,
-0.02372395433485508,
-0.009890547022223473,
-0.012573854066431522,
-0.0006785496370866895,
-0.0713743194937706,
-0.009926811791956425,
0.05854197219014168,
0.068037249147892,
-0.02161979489028454,
-0.0023556258529424667,
0.038039665669202805,
-0... |
11. 3 • sample responsive wad with bootstrap / react and node 623 } ; const removeall = ( ) = > { return axios. delete ( ` / api / todos ` ) ; } ; export default { getall, get, create, update, remove, removeall } ; finally, to complete this step, update reactfrontend / app. js to the following to call the services. han... | openstax_introduction_to_computer_science_-_web | [
-0.04725707694888115,
0.00006454013782786205,
0.000980151817202568,
-0.003513622796162963,
-0.012578943744301796,
-0.02166101336479187,
-0.03283267840743065,
-0.005019719712436199,
0.055014900863170624,
0.0748247355222702,
-0.038328398019075394,
-0.001228446839377284,
0.025154870003461838,
... |
applications development access for free at openstax. org. catch ( ( err ) = > console. log ( err ) ) ; } once this is completed, run both the express web server and the react app using the following commands : $ node server. js $ npm start when this is done, use the form shown in figure 11. 34 to create a new todo ite... | openstax_introduction_to_computer_science_-_web | [
-0.040023867040872574,
-0.02392910234630108,
-0.037790171802043915,
-0.018588818609714508,
0.02169749327003956,
-0.010265600867569447,
-0.04137058183550835,
-0.005109245423227549,
0.07147203385829926,
0.056319963186979294,
-0.05519826337695122,
0.022333253175020218,
0.057197704911231995,
-... |
11. 4 sample responsive wad with bootstrap / react and django learning objectives by the end of this section, you will be able to : • update the todo web application with bootstrap, react, and django • extend the django back end to support the react front end • connect the react front end to the django back end previou... | openstax_introduction_to_computer_science_-_web | [
-0.035323210060596466,
-0.012454720214009285,
-0.04770742356777191,
-0.029938610270619392,
-0.017783816903829575,
0.01856709085404873,
-0.021965043619275093,
-0.0008026477298699319,
0.032234448939561844,
0.07846466451883316,
-0.06944602727890015,
-0.006632025353610516,
0.030007466673851013,
... |
11. 4 • sample responsive wad with bootstrap / react and django 625 prerequisites to build this version of the todo application, you need python v3. 9. 4, pip v21. 3. 1, django v4. 0. 1, django rest framework v3. 13. 1, bootstrap v4. 5. 0, django - cors - headers v3. 11. 0, react v17. 0. 2, and axios v0. 21. 0. to begi... | openstax_introduction_to_computer_science_-_web | [
-0.03822070732712746,
-0.024144425988197327,
-0.0351763479411602,
-0.011914658360183239,
-0.009509804658591747,
0.0158707108348608,
-0.02737569436430931,
0.0024850943591445684,
0.03758770227432251,
0.07131226360797882,
-0.08105223625898361,
-0.0036878040991723537,
0.029424181208014488,
0.0... |
' django. contrib. contenttypes ','django. contrib. sessions ','django. contrib. messages ','django. contrib. staticfiles ','corsheaders ','rest _ framework ','todo ', ] by configuring the django project with cors, the django application will be allowed to accept in - browser requests that come from other origins. to a... | openstax_introduction_to_computer_science_-_web | [
-0.032701391726732254,
-0.01369011402130127,
-0.021383248269557953,
-0.001525403931736946,
-0.006044985260814428,
0.009584852494299412,
-0.05403214320540428,
0.0017195501131936908,
-0.005571927409619093,
0.07115860283374786,
-0.041411224752664566,
0.005587042309343815,
0.02348400093615055,
... |
clean, efficient syntax to manage promises, and works well with node, as well as browser environments. visit this page on axios ( https : / / openstax. org / r / 76axios ) to learn more. connecting the react front end to the django back end next, the react application must be configured so it can make requests to the a... | openstax_introduction_to_computer_science_-_web | [
-0.06108878180384636,
-0.01778656803071499,
-0.07014371454715729,
0.004331611562520266,
-0.012789561413228512,
0.021944327279925346,
-0.04123611003160477,
-0.015955638140439987,
0.019830884411931038,
0.07007233798503876,
-0.03129275515675545,
0.0030773887410759926,
0.004697989672422409,
-0... |
##ios to make requests to the django api endpoints to create and delete todo items. handlesubmit = ( item ) = > { this. toggle ( ) ; | openstax_introduction_to_computer_science_-_web | [
-0.04709610715508461,
-0.02275657467544079,
-0.0294987540692091,
-0.009283403865993023,
-0.041962068527936935,
-0.01924217864871025,
-0.012938406318426132,
0.032052718102931976,
0.04840191453695297,
0.08149805665016174,
-0.058247365057468414,
0.013682558201253414,
-0.011060637421905994,
0.... |
11. 4 • sample responsive wad with bootstrap / react and django 627 if ( item. id ) { axios. put ( ` / api / todos / $ { item. id } / `, item ). then ( ( res ) = > this. refreshlist ( ) ) ; return ; } axios. post ( " / api / todos / ", item ). then ( ( res ) = > this. refreshlist ( ) ) ; } ; handledelete = ( item ) = >... | openstax_introduction_to_computer_science_-_web | [
-0.0476350337266922,
0.0058051906526088715,
-0.03874361887574196,
0.006620076950639486,
-0.03650660067796707,
0.01670403592288494,
-0.024330828338861465,
-0.005380650050938129,
0.03134623169898987,
0.0993170365691185,
-0.05753783881664276,
0.005306935869157314,
0.017323557287454605,
0.0198... |
11. 2 sample responsive wad with bootstrap and django. click on the categories api path to enter two categories, as seen in figure 11. 35. figure 11. 35 after navigating to http : / / localhost : 8000 / api / and following the instructions provided, this page will appear to allow access to the django rest api. ( render... | openstax_introduction_to_computer_science_-_web | [
-0.03163029998540878,
-0.011422358453273773,
-0.02842344529926777,
-0.0241670124232769,
-0.013389111496508121,
0.013672356493771076,
-0.009261034429073334,
-0.0006798671674914658,
0.035352688282728195,
0.0870104730129242,
-0.061966292560100555,
-0.013545269146561623,
0.03633681312203407,
0... |
11. 5 sample native wad with react native and node or django learning objectives by the end of this section, you will be able to : • create a todo native mobile application with react native or node • create a react native app and its components • connect the front - end native app with the back - end node app in the p... | openstax_introduction_to_computer_science_-_web | [
-0.023747442290186882,
-0.00886512640863657,
-0.044458482414484024,
-0.0419050008058548,
-0.006933670025318861,
0.0056530325673520565,
-0.01913967914879322,
-0.0062850480899214745,
0.05145750939846039,
0.08061623573303223,
-0.05319271981716156,
-0.011605912819504738,
0.028692692518234253,
... |
v14. 17. 5, expressjs v4. 17. 2, mongoosejs v6. 1. 9, and axios v0. 21. 0. this todo application will run using the android emulator and will use android studio v2021. 1. 1. link to learning xcode ( https : / / openstax. org / r / 76xcode ) is the ide for the apple platform. for apple, react native provides developers ... | openstax_introduction_to_computer_science_-_web | [
-0.011966975405812263,
0.020674709230661392,
-0.04977821558713913,
-0.03325671702623367,
-0.011194249615073204,
-0.0011386198457330465,
0.010796995833516121,
-0.012139368802309036,
0.04305708780884743,
0.032124582678079605,
-0.038229309022426605,
-0.004965525586158037,
0.015841130167245865,
... |
11. 5 • sample native wad with react native and node or django 631 figure 11. 38 this shows how to set up the android emulator. ( android studio is a trademark of google llc. ) once the image has been created, it will appear in the device manager. next, click on the start button to launch the emulator. when the emulato... | openstax_introduction_to_computer_science_-_web | [
-0.039189938455820084,
0.02551441267132759,
-0.045805878937244415,
-0.04181757569313049,
0.020158177241683006,
-0.023887086659669876,
-0.010130741633474827,
-0.0052392263896763325,
0.027759596705436707,
0.055406998842954636,
-0.043161388486623764,
0.008519335649907589,
0.05579950287938118,
... |
11. 5 • sample native wad with react native and node or django 633 figure 11. 40 when the react native app is created, it will generate the react native application files in the reactnativefrontend / directory. ( rendered in react native, under mit license ; attribution : copyright rice university, openstax, under cc b... | openstax_introduction_to_computer_science_-_web | [
-0.031068746000528336,
-0.012425205670297146,
-0.06118277087807655,
-0.03875112906098366,
0.02337990142405033,
-0.009696433320641518,
-0.04068973660469055,
-0.006337663624435663,
0.06702052801847458,
0.04835869371891022,
-0.05394081398844719,
0.010599357075989246,
0.054879363626241684,
-0.... |
11. 5 • sample native wad with react native and node or django 635 figure 11. 42 this code should appear in the second terminal when the react native application is successfully built. ( attribution : copyright rice university, openstax, under cc by 4. 0 license ) figure 11. 43 shows how the native application should a... | openstax_introduction_to_computer_science_-_web | [
-0.013423734344542027,
-0.002146642655134201,
-0.04254467785358429,
-0.03038117289543152,
0.004458872601389885,
-0.002798343077301979,
-0.0358007475733757,
0.008857096545398235,
0.04553823545575142,
0.058608103543519974,
-0.06045512482523918,
-0.004464298021048307,
0.021280236542224884,
-0... |
11. 5 • sample native wad with react native and node or django 637 import react, { usestate, useeffect } from'react'; import { view, text, stylesheet, textinput, flatlist, touchableopacity, dimensions, statusbar, alert, } from'react - native'; import axios from'axios'; import { colors } from '.. / utils / colors'; impo... | openstax_introduction_to_computer_science_-_web | [
-0.045598261058330536,
-0.011728884652256966,
-0.019737452268600464,
0.008218547329306602,
-0.01854463666677475,
-0.019982773810625076,
-0.023190684616565704,
-0.022169392555952072,
0.05590981990098953,
0.0632004365324974,
-0.03070225566625595,
-0.007736843544989824,
0.029073497280478477,
... |
? styles. completedstyle : styles. text } > { item. title } < / text > < touchableopacity style = { styles. deletetodo } onpress = { ( ) = > deletetodo ( item. _ id ) } > < text style = { { color : colors. white } } > x < / text > < / touchableopacity > < / view > ) } / > < / view > < touchableopacity style = { styles.... | openstax_introduction_to_computer_science_-_web | [
-0.031531721353530884,
-0.021775605157017708,
0.0047409189864993095,
0.01636282354593277,
-0.006111156195402145,
-0.013827372342348099,
0.020133640617132187,
-0.01022355817258358,
0.0797937884926796,
0.03468150272965431,
-0.032177459448575974,
-0.006879828404635191,
0.03144528716802597,
-0... |
. createbtntext } > create task < / text > < / touchableopacity > < / view > < / modal > < / view > ) ; the following code creates the modal pop - up screen that is used to create a todo list. < modal isvisible = { modalactive } animationin = {'slideinup'} animationout = {'slideindown'} > < view style = { styles. modal... | openstax_introduction_to_computer_science_-_web | [
-0.042600199580192566,
-0.020713521167635918,
-0.029233109205961227,
-0.012325303629040718,
0.0068906936794519424,
-0.014952785335481167,
-0.017946600914001465,
0.0018977742874994874,
0.0665360763669014,
0.039945296943187714,
-0.047821320593357086,
-0.027175813913345337,
0.030502647161483765... |
. / src / screens / todolist'; const stack = createnativestacknavigator ( ) ; const app = ( ) = > { return ( < navigationcontainer > < stack. navigator > < stack. screen name = " todolist " component = { todolist } options = { { headershown : false } } / > < / stack. navigator > < / navigationcontainer > ) ; } ; export... | openstax_introduction_to_computer_science_-_web | [
-0.002423658035695553,
-0.027655508369207382,
-0.034222282469272614,
-0.028844688087701797,
0.014079932123422623,
-0.016771268099546432,
-0.03293831646442413,
0.008961981162428856,
0.07903379946947098,
0.03431708738207817,
-0.034716155380010605,
-0.0013965294929221272,
0.0342094711959362,
... |
11. 5 • sample native wad with react native and node or django 639 $ npx react - native run - android next, create a todo item ( figure 11. 44 ). figure 11. 44 after relaunching the metro bundler and deploying the native application, this screen allows users to create a todo item. ( android studio is a trademark of goo... | openstax_introduction_to_computer_science_-_web | [
-0.036347344517707825,
-0.009721926413476467,
-0.045479368418455124,
-0.019619343802332878,
0.010419907048344612,
-0.012559733353555202,
-0.019997233524918556,
-0.021636005491018295,
0.06213695928454399,
0.054763149470090866,
-0.06675733625888824,
0.020747603848576546,
0.01868186518549919,
... |
rest api provided via the express web server to interact with the mongodb database. | openstax_introduction_to_computer_science_-_web | [
0.009559613652527332,
0.036252427846193314,
-0.035858236253261566,
-0.010381135158240795,
-0.032544150948524475,
0.037750206887722015,
-0.01931469887495041,
-0.008614429272711277,
0.059010379016399384,
0.05435246229171753,
-0.013513029552996159,
0.004473519511520863,
-0.0060317013412714005,
... |
11. 5 • sample native wad with react native and node or django 641 const [ todos, settodos ] = usestate ( [ ] ) ; const [ modalactive, setmodalactive ] = usestate ( false ) ; const [ newtodo, setnewtodo ] = usestate ('' ) ; useeffect ( ( ) = > { gettodos ( ) ; }, [ todos ] ) ; const gettodos = ( ) = > { axios. get ( ` ... | openstax_introduction_to_computer_science_-_web | [
-0.07159280776977539,
-0.025706229731440544,
-0.004732808563858271,
0.0015110435197129846,
-0.027004489675164223,
-0.028662322089076042,
-0.012264786288142204,
-0.017841119319200516,
0.042768288403749466,
0.06921280175447464,
-0.021783670410513878,
0.007595033384859562,
0.04381147772073746,
... |
const addtodo = async ( ) = > { if ( newtodo = ='' ) { alert. alert ('error! ','please enter a task first!') ; return ; } else { 642 11 • web applications development access for free at openstax. org await axios. post ( ` $ { api _ base } / todo / new `, { text : newtodo, } ). then ( function ( response ) { const data ... | openstax_introduction_to_computer_science_-_web | [
-0.07172828912734985,
-0.013488063588738441,
-0.031060898676514626,
-0.01062830165028572,
-0.018870314583182335,
-0.029192481189966202,
-0.033279307186603546,
0.01743415556848049,
0.06373164057731628,
0.07950642704963684,
-0.00915735773742199,
0.019211113452911377,
0.030940935015678406,
-0... |
11. 6 sample ethereum blockchain web 2. 0 / web 3. 0 application learning objectives by the end of this section, you will be able to : • build a hybrid ethereum blockchain web 3. 0 application • create the react app and install dependencies • create the smart contract • create the front - end react components • add web... | openstax_introduction_to_computer_science_-_web | [
0.02156791463494301,
0.017753172665834427,
-0.04045321047306061,
-0.036399275064468384,
-0.025212755426764488,
0.005302187521010637,
-0.03043271042406559,
-0.016051141545176506,
0.051836684346199036,
0.052530545741319656,
-0.026405831798911095,
-0.01872391626238823,
0.07853613048791885,
-0... |
. 0, node v14. 17. 5, web 3. js v1. 2. 2, truffle v5. 0. 2, and solidity v0. 8. 11. in addition, ganache is used as the personal blockchain for development. to begin, do the following : | openstax_introduction_to_computer_science_-_web | [
0.037456266582012177,
-0.007069128565490246,
-0.02549120783805847,
0.011905907653272152,
-0.06470159441232681,
0.01891099102795124,
0.015640320256352425,
-0.02513009123504162,
0.0361124724149704,
0.03109222836792469,
0.015925584360957146,
-0.003504366148263216,
0.05244847387075424,
-0.0101... |
11. 6 • sample ethereum blockchain web 2. 0 / web 3. 0 application 643 • download and install ganache. launch ganache and choose the quick start ethereum option as seen in figure 11. 46. figure 11. 46 this is the quick start ethereum option that is available after installing ganache. ( credit : ganache, under mit licen... | openstax_introduction_to_computer_science_-_web | [
0.015034380368888378,
0.008342955261468887,
-0.037405844777822495,
-0.02764156088232994,
-0.025620339438319206,
0.016165677458047867,
-0.02345600165426731,
0.0007861313642933965,
0.039428725838661194,
0.055323436856269836,
-0.02451281249523163,
-0.04578413441777229,
0.06897548586130142,
-0... |
##mode > < app / > < / react. strictmode >, document. getelementbyid ('root') ) ; / / if you want to start measuring performance in your app, pass a function / / to log results ( for example : reportwebvitals ( console. log ) ) / / or send to an analytics endpoint. learn more : https : / / bit. ly / cra - vitals report... | openstax_introduction_to_computer_science_-_web | [
-0.010214854963123798,
0.005268156994134188,
-0.04294876381754875,
0.006787691731005907,
-0.056242335587739944,
0.011735430918633938,
-0.011413359083235264,
-0.0127213504165411,
0.032346561551094055,
0.035733744502067566,
-0.04493637755513191,
0.004426304250955582,
0.04665861278772354,
0.0... |
11. 6 • sample ethereum blockchain web 2. 0 / web 3. 0 application 645 figure 11. 47 here is the truffle - config. js file. ( rendered with truffle by truffle security co., under mit license ; attribution : copyright rice university, openstax, under cc by 4. 0 license ) to create the smart contract, in the ethreact / c... | openstax_introduction_to_computer_science_-_web | [
-0.009933401830494404,
0.015301811508834362,
-0.019392430782318115,
0.008130037225782871,
-0.05046815797686577,
-0.00830801296979189,
-0.04649578779935837,
0.009675593115389347,
0.02500271610915661,
0.036326535046100616,
-0.01698416844010353,
0.009448039345443249,
0.06056410074234009,
0.01... |
has been successfully compiled as seen in the following code : > compiled successfully using : - solc : 0. 5. 16 + commit. 9c3226ce. emscription. clang figure 11. 48 shows how this process will generate a few files, including two json files in the build / contracts / directory and a migration file in the migrations / d... | openstax_introduction_to_computer_science_-_web | [
0.02836078405380249,
0.035059064626693726,
-0.008821145631372929,
-0.017733747139573097,
-0.029666956514120102,
-0.016126900911331177,
-0.01914689689874649,
0.005344121716916561,
0.05531500279903412,
0.04471071437001228,
-0.009503621608018875,
0.0013338985154405236,
0.03673713654279709,
-0... |
11. 6 • sample ethereum blockchain web 2. 0 / web 3. 0 application 647 • compiled bytecode from the solidity smart contract code that can run on the ethereum virtual machine ( evm ) • a json representation of the smart contract. next, configure the react app to connect to the ganache blockchain network. to do this, ope... | openstax_introduction_to_computer_science_-_web | [
0.023605260998010635,
0.04197344556450844,
-0.053611863404512405,
-0.0016060579800978303,
-0.05276629328727722,
-0.00840606540441513,
0.0002765759127214551,
-0.012202010490000248,
0.04367481917142868,
0.03312169760465622,
-0.017392197623848915,
-0.011563898995518684,
0.0606674887239933,
0.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.