My first full stack CRUD web application built with Python, PostgreSQL, and Flask framework.
Users should be able to:
- Check for the meaning of words.
- Add a new word with it's meaning to the dictionary.
- Update the a and its meaning.
- Delete a word from the dictionary
- View the optimal layout for the site depending on their device's screen size
- Solution URL: (https://github.com/faozziyyah/Dictionary-app)
- Live link: (https://ustackydict1.herokuapp.com/)
- HTML
- CSS
- Javascript
- Flask - A web development microframework built with python
- PostgreSQL
- How to connect to a database
- How to use the Jinja template
$("#logo-form").submit(function() {
let data = new FormData();
data.append('file', $('#logo')[0].files[0]);
$.ajax({
url: '/add_logo',
type: 'POST',
data: data,
enctype: 'multipart/form-data',
processData: false,
contentType: false,
success: function(data) {
location.reload();
},
error: function(err) {
console.log(err);
}
})
});
@app.route('/add_logo', methods=['POST'])
def add_logo():
image = request.files['file']
if image:
filepath = os.path.join(current_app.root_path, 'static/images/logo.png')
image.save(filepath)
flash('image successfully added!')
else:
flash('error adding image!')
return 'success'
<div class="modal-body text-center">
{% for message in messages %}
<p>{{ message }}</p>
{% endfor %}
</div>