This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ===== _form.html.erb ===== | |
<%= form_for @test, :html => {:multipart => true} do |f| %> | |
# ----- other form fields ----- | |
<div class="field"> | |
<%= f.label :img %><br> | |
<%= f.text_field :remote_img_url %> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -- in nav-base.html -- | |
<ul class="nav pull-right"> | |
<li>{% block item-home %} <a href="{% url 'shortener:create' %}">{% trans "HOME" %}</a> {% endblock %}</li> | |
<li>{% block item-about %} <a href="#">{% trans "ABOUT US" %}</a> {% endblock %}</li> | |
<li>{% block item-info %} <a href="{% url 'staticpages:detail' %}">{% trans "INFO" %}</a> {% endblock %}</li> | |
# -- in home.html -- | |
{% extends 'nav-base.html' %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import qrcode | |
import os | |
def generate_qr_code(content, name_img): | |
qr = qrcode.QRCode(version=1, box_size=10, border=4) | |
qr.add_data(content) | |
qr.make(fit=True) |