Adding text to the end of a web address through a submission form

Here is an example of a form:

<form method="post">
{% csrf_token %} 
<input class="search" type="text" name="q" placeholder="Search Engine">
<input type="submit">

I am looking to add a word after the last character in the following link:

http://127.0.0.1:8000/saturday/

Answer №1

Finally, I was able to achieve this using django:

from django.shortcuts import redirect

if request.method == "POST": 
    try:   
        title = request.POST.get("q")
        return redirect(f'/wiki/{title}')
    

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Implementing a jQuery change event to filter a specific table is resulting in filtering every table displayed on the page

I have implemented a change event to filter a table on my webpage, but I am noticing that it is affecting every table on the page instead of just the intended one. Below is the code snippet: <script> $('#inputFilter').change(function() { ...

Exploring the world of CSS font families in Sublime Text 3 and linking them to the web

Is there a way to connect a font from the internet (such as those on Google Fonts: ) to my Sublime Text CSS file? I have tried linking it to an HTML file that is already linked to my CSS code, but it hasn't been successful. ...

"RecognitionAudio variable missing" and "InactiveRpcError occurred" [Utilizing the Google text-to-speech API]

I have a goal I'd like to achieve. A user communicates with a web browser. The web browser records the user's voice as a WAV file using Recorder.js and sends it to a server running on Google App Engine Standard environment with Python 3.7. The ...

Incapable of stopping/ending a child process

I have been facing a challenge with my python script that involves starting OpenVPN as a subprocess. Despite trying various methods, I have been unsuccessful in terminating the started subprocess. p = Popen(["openvpn", "--config", conf], stdin=PIPE, stdou ...

Compiling a directory of video URLs - hindered by email encryption

I am relatively new to Python and coding, so please bear with me as I explain my current project. Basically, what I'm trying to accomplish is creating a script that opens my monthly fire department training page, navigates to the video section where d ...

JavaScript communication between clients and servers

I am looking to develop two scripts, one for the client-side and one for the server-side. I came across a snippet that allows for asynchronous calling of JavaScript: <html> <head> </head> <body> <script> (function() { ...

ReactJS -- Button Overlay Issue: Unresponsive Clicks when Positioned on Top of List

Please check out the Code Example in my Code Sandbox demo that I have set up https://codesandbox.io/s/W7qNgVnlQ I am trying to get the button action of the Floating Button to work, but currently it is triggering the Action assigned to the ListItem instea ...

Retrieve information from the text input field and proceed with the action outcome

Currently, I am in the process of developing a form on an asp.net website. The objective is to have users land on a page named Software, where two variables are checked for empty values upon loading. If the check reveals emptiness, the Software View is ret ...

Help with selenium web scraping

In the month of June, I came across a question on assistance needed to scrape a website using Selenium in Python. Having tried the code back then and running into issues now, it seems like there might have been some changes to the site being scraped. The ...

Only the main page is accessible quickly through Express

Currently, I am delving into learning Express and leveraging FS to load my HTML Page. My research on this topic only led me to references of using ASP.NET instead of Express. Here is a snippet from my Server.js file: var express = require('express&a ...

python transform a single JSON format into a hierarchical structure

Is there a way to convert JSON data into a specific target format by extracting unique country names and grouping all entries with the same country name together? The dataset contains 50 thousand entries. The original JSON structure is as follows: [ ...

Can an integer-like object with the ability to store instance variables be created in Python?

Can Python support a custom data object that acts like a typical integer during math operations and comparisons while also having the ability to hold instance variables? In essence, it should allow for the following functionality: pseudo_integer = Pseudo ...

Swiss Francs Bokeh Numeric Formatter

Currently, I am developing a Webapp using Bokeh that features a table displaying Swiss Franc values. However, I am struggling to format the numbers in the style below: 1'000'000 Instead of commas, I want to use dashes as the 1000 separator. Whi ...

Executing multiple python scripts concurrently within individual containers from the same image

I'm attempting a seemingly simple task (or so I believe) - I aim to create a docker image and run two different scripts simultaneously from separate containers spawned by this image. Here's the basic idea: Container 1 -> print("Hello") Contain ...

Encountering difficulties while attempting to decode specific characters from API calls in Django

The response I am receiving from an API contains a character \x96 Upon making the API call, the following error is triggered: 'ascii' codec can't encode character u'\x96' in position 56: ordinal not in range(128) This ...

Quickest method for generating numerous thumbnails from a solitary large image using Python

I have a collection of high-resolution images (8000x6000px ~13mb) that I want to create various smaller thumbnails for with widths ranging from 3000px down to 100px. The original image is saved as a flat file, and the newly generated thumbnails will also ...

Struggling with setting up a PHP and Ajax registration and login system

Struggling with my code and in need of assistance. Desperately trying to set up a register form where users can input their username and password to sign up. Planning to utilize ajax, however, the integration seems faulty. For testing purposes, I tried ech ...

Custom control unable to display MP3 file

Hey, I came across this awesome button that I am really interested in using: https://css-tricks.com/making-pure-css-playpause-button/ I'm currently facing two issues with it. First, I can't seem to play the sound. I've placed the mp3 file ...

Tips for ensuring Opera browser compatibility with buttons using the CSS background image property

Is there a way to make background images work on buttons in Opera web browser using CSS? I've tried using the background image property, but it doesn't show up when I use Opera. Strangely enough, it works fine in Firefox. However, I have noticed ...

Is there a way to decrease the speed of a text when hovering over it?

Is there a way to create a button that displays text before another text only on hover, with a delay? I've managed to achieve the effect but can't figure out how to slow it down. For example, notice how quickly the word "let's" appears when ...