python - List URL Route Flask -


मेरे पास एक सूची है

imageIds = ["zw8SeIUW", "f28BYZ"] < / कोड>

जो लगातार जोड़ा जा रहा है। मैं अपनी साइट को / images / zw8SeIUW और अन्य सभी imageIds पर पहुंचने में सक्षम होना चाहता हूं।

ऐसा क्यों कुछ नहीं होगा? मैं इसे कैसे काम करूं?

छवि आईडी में छवि के लिए @ app.route ('/ images / & lt; animage & gt;') def imagePage (): return render_template ('imagePage.html ')

छवि पृष्ठ फ़ंक्शन ओवरराइट किया जाएगा और केवल पिछले एक रहेगा (क्योंकि डीएफ़ ब्लाह (..) पुरानी एक को ओवरराइट कर देता है।)

कई फ़ंक्शन को परिभाषित करने के बजाय, दृश्य के रूप में अनुसरण करने के तरीके के बारे में कैसे?

  @ एप। रूट ('/ images / & lt; image & gt;') डीआरफ़फ़ेज पेज (छवि): अगर छवि छवि आईडी में नहीं है: एबर्ट (404) अन्य: रिटर्न रेडर_टामप्लेट ('imagePage.html')  

Comments

Popular posts from this blog

Folder list php -

symfony - FOSUser mail is translated but confirmation_url isn't -

java - org.apache.http.ProtocolException: Target host is not specified -