#web-development

2 messages ยท Page 23 of 1

fathom prism
upbeat egret
#

@fathom prism i have not. so if im not mistaken, are you implying to make a html template page specifically for just a footer?

#

i feel like thats not optimal

fathom prism
#

why not?

#

The other option is to place the <footer> in your base template

#

Stick this in your base html

<footer>
Content here
</footer>
upbeat egret
#

@fathom prism thanks

fathom prism
#

๐Ÿ‘

radiant river
#

Guys i can't handle django anymore

#

I don't think I like it.

#

How do you guys feel

#

I really do like python though

grand badge
#

@radiant river by "can't handle" do you mean you find it too difficult or do you not like the way you're meant to use django?

#

If you find it too difficult, with practice, you'll understand concepts quickly.

#

If you understand how to use it but dont like the "django way", try a framework like Flask

#

Flask is a bit easier to grasp

timber wharf
#

hi i have flask pandas table and i want to sort her like DataTable.js

#

how i do that

timber wharf
#

idk

#

i have now ather problem

#

can some one try to answer

#

plz

native tide
#

was told I should make a site

#

uhh

#

where do I start

heady basin
#

anyone know if there is a method to get the next tag after a particular element via dom ideally

#

for example if you have

#
<li class="something"> ... </li>
<li>... </li>
#

something to call on the first element to get a reference to that second one

#

oh nvm

#

nextElementSibling works

native tide
#

how can I make my page always appear in desktop mode and never shrink

warped robin
#

@native tide Does your page have a viewport meta tag?

warped robin
#

Anyone know how to replace all non Alpha Numeric characters in the Jinja2 template engine?
Like right now I have something like this:

<a href="/article/{{row[1].lower() | replace(' - ','-') | replace(' ','-') | replace('?','') | replace('!','') | replace(',','') | replace('.','') | replace(':','')}}/{{row[0]}}">

but having to use | replace for every single special character will get out of hand. Is there an easier way?

unborn terrace
#

@warped robin if you also want to discard accents and stuff:

import string

valids = set(string.ascii_letters + string.digits)
text = "Hรซllรด Wรธrld!"
print(''.join(c for c in text if c in valids))

would print

HllWrld
#

Also please tell what exactly are you trying to achieve

#

Because it really looks like you are trying to reinvent the wheel here

polar wasp
#

I ended up telling him about slugify and pointing a link to a jinja extension in the help channel

#

which I think returns hello-world for that string

fair pumice
#

Hello I'm running into this error ./src/Components/Playlist/Playlist.js Module not found: Can't resolve '../BaseComponent/BaseComponent' in 'C:\Users\Sreyeesh\Documents\GitHub\Codecademy-Jammming\jammming\src\Components\Playlist'

#

I'm not sure why this is hpapening from what I can see I'm following the instructions on how to use this code

#

import { BaseComponent } from '../BaseCompnonent/BaseCompnonent';
import Spotify from '../../util/Spotify';
import SearchBar from '../SearchBar/SearchBar';
import SearchResults from '../SearchResults/SearchResults';
import Playlist from '../Playlist/Playlist';
import './App.css';```
#

can anyone help me ?

#

https://github.com/Sreyeesh/GitHub/blob/master/Codecademy-Jammming/jammming/src/Components/App/App.js

#

that's how the structure looks like within git

austere apex
#

Heeey

#

Anyone up?

wheat trellis
#

Hey

#

I'm up

#

Man traefik-auth-forward is poorly documented

#

I think I've got it working. I mean it works but i don't know how robust my config is, and I don't understand how it's working

#

Both of those things annoy me

radiant river
#

can someone explain to me the difference between filter and get

radiant river
#

Can i get a link to the django discord server?

#

I lost it

floral seal
#

google

lofty cargo
#

Hi,
I created image recognition app with flask. User uploading image and AI model trying to predict result and returning it. But there is a problem. If user click predict button directly before upload any image than its returning last result of uploaded image.

How can i avoid of this problem? Should i search about session?

PS: all images are uploading in the same folder.

fierce frost
#
@app.route('/math', methods=['POST', 'GET'])
def math():
    if request.method == 'POST':
        print(request.form)
        formula = request.form.get('formula')
        a = float(request.form.get('a'))
        b = float(request.form.get('b'))
        n = float(request.form.get('n'))
        hz = eval(request.form.get('hz'))
        h = eval(request.form.get('h'))

All of the variables are None somehow and request.form does not exist? thonk_think

#

My .html file:

<html>
    <body>
        <form action = "http://localhost:5000/math" method = "POST">
            <p>Formula <input type = "text" name = "formula" /></p>
            <p>a <input type = "text" name = "a" /></p>
            <p>b <input type = "text" name = "b" /></p>
            <p>n <input type ="text" name = "n" /></p>
            <p>hz <input type ="text" name = "hz" /></p>
            <p>h <input type ="text" name = "h" /></p>
            <p>Formula number <input type ="text" name = "formula_number" /></p>
            <p><input type = "submit" value = "Submit" /></p>
        </form>
    </body>
</html>
radiant river
#

Im trying to get a value from my template

#

to my view

limber hemlock
#

Hey guys, how do you properly use flask "@login_manager.request_loader". I can see from the "flask-login" example how to load "Authorization" header but how do I pass token(JWT) to that "Authorization" header?

#

So that every request is login_authenticated (@login_required)

#

If someone can point me in the right direction, that would be great.

thick light
#

hello

#

i have this error where class.whatever is not callable

#

made a new file.py and i'm trying to use the data i queried from the database

steel tiger
#

Is psycopg2 the normal flask extention to use to connect to postgre?

mild bridge
#

I believe the package has been renamed to psycopg2-binary or something, but yeah I think it's the standard PostgreSQL adapter

steel tiger
#

๐Ÿ‘

dense ember
#

Hi! I have a question for you good folks if you have the time ๐Ÿ˜ƒ

#

I'm trying to create a web app that allows users to select a few favorite restaurants from a list of restaurants, then when they hit 'recommend', it should trigger python scripts that eventually return another list of restaurants

#

I just need everything to run locally for a demo,

#

I've been recommended Flask + AJAX but I'm having trouble getting started

#

I already have the python scripts and all written - I need help displaying all that information on a webpage

native tide
#

hey guys

#

anyone here uses rest

#

i'm trying to do this with my permissions.py:

class IsAscomOrReadOnly(permissions.BasePermission):
    def has_permission(self, request, view):
        if request.method in permissions.SAFE_METHODS:
            return True
        else:
            if request.user and (request.user.groups.filter(name='ASCOM') or request.user.groups.filter('Administrador')):
                return True
            return False
#

But says: Error: to many values to unpack . Expected 2

#

But with the:(request.user.groups.filter(name='ASCOM') or request.user.groups.filter('Administrador'))

#

But should not this be regarded as just an argument?

native tide
#

Oh, i find it

#

was missing the: name='Administrador in the argument :P

open forum
#

Which HTTP error code would correspond to the situation where the client makes a request which is not valid in the current system state, but which may be valid at a later time if the system state changes?

#

403 Forbidden?

bleak geyser
#

hello everyone, i have a problem that i am currently stuck on and was wondering could someone help me

#

i'm current working on a zero touch provisioning project and i'm very stuck is there anyone that is good with python and familiar with linux, tftp server and dhcp servers
i'm following a online tutorial of zero touch provisioning. here is the link https://networklore.com/ztp-tutorial/configuration-templates/
Networklore
Using configuration templates
The ability go generate configuration based on a dynamic template in a critical part of a ZTP setup.
the part of this which i do not under stand and i'm sure that it is easy is to set your environment variables, both in the windows you are running the TFTP server and the one thatโ€™s running rq.
you can see at the bottom of the page it asks me to set these environment variables. i don't know how to do this and believe me i have tried.

i'm sorry if i'm not being descriptive enough i am very much a noob

mild flint
#

Hi. Does anyone explain me please how to work correctly with HTTPS requests sites using a VPS as workspace? I have been looking for information about this for several weeks already, I try various options, but nothing happens.
What i mean. I have created a simple request-script that collects information from website (try/except/if/else omitted):

# Some code

s = requests.Session()
r = s.get(url)

# Work with r.text

It works perfectly and correctly when i run script from my laptop (url can be http or https).
I have VPS (Ubuntu 16.04 Server) with clean installation (added only python 3.7 and libs). I posted and run script on the server, but it works correctly only with http sites. When i place an url with SSL errors occurs:
1.

Connection error: HTTPSConnectionPool(host=<https_url>, port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1dba341320>: Failed to establish a new connection: [Errno 110] Connection timed out'))
Connection error: HTTPSConnectionPool(host=<https_url>, port=443): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7ff938fa44e0>, 'Connection to <https_url> timed out. (connect timeout=10)'))

I tried to add a .crt, .pem, .key files as parameter for request, but nothing happens (new errors occurs (such as SSL doesn't correct and others)).

There is a problem with server? Or i need put some unusual headers (which i didn't put on laptop) to a request?

heady basin
#

is port 443 closed for whatever reason?

limber vine
#

hi, I was wondering if anyone here recommends a small business to use site builders like wix or wordpress or if there are better alternatives for a sales landing page?

leaden latch
#

Hey

#

Man

#

My Bootstrap collapse button not working help anyone??

#

??

patent cobalt
#

That's not really a lot of info to go on. (Not that I can help you anyway, I'm not a webdev and don't know anything about js.)

#

However, it will probably help to be a bit more descriptive

#

!ask has some information on asking good questions

lavish prismBOT
#
ask

Asking good questions will yield a much higher chance of a quick response:

โ€ข Don't ask to ask your question, just go ahead and tell us your problem.
โ€ข Try to solve the problem on your own first, we're not going to write code for you.
โ€ข Show us the code you've tried and any errors or unexpected results it's giving
โ€ข Keep your patience while we're helping you.

You can find a much more detailed explanation on our website.

leaden latch
#

    <!--Bootstrap Css-->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    <!-- Optional theme -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
    <!-- Latest compiled and minified JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
#

My bootstrap collapse button is not working (nothing happens when I click on it). I have tried for a couple of hours fixing it but with no success hopefully someone here can help me find where I am mistaken

#
<nav class="navbar navbar-expand-md navbar-dark bg-light fixed-top" >
    <a class="navbar-brand leftoright verticalline" href="#">
    <button class="navbar-toggler navbar-light" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse rtl" id="navbarSupportedContent">
        <div class="navbar-nav">
            <ul class="navbar-nav">
              <li class="nav-item">
                  <div class="d-inline p-4">
                      <p class="nav-link online" href="#">492 ืžื—ื•ื‘ืจื™ื</p>
                  </div>
              </li>
              <li class="nav-item">
                  <div class="d-inline p-2">
                      <a class="nav-link" href="#">ื”ืชื—ื‘ืจื•ืช</a>
                  </div>
              </li>
              <li class="nav-item">
                  <div class="d-inline p-2">
                    <a class="nav-link" href="#">ื”ืจืฉืžื”</a>
                  </div>
              </li>
              <li class="nav-item">
                  <div class="d-inline p-2">
                    <a class="nav-link" href="#">ื”ื•ืจื“ื”</a>
                  </div>
              </li>
              <li class="nav-item">
                  <div class="d-inline p-2">
                    <a class="nav-link" href="#">ื“ื™ืจื•ื’ื™ื</a>
                  </div>
              </li>
              <li class="nav-item">
                  <div class="d-inline p-2">
                    <a class="nav-link" href="{%url 'events'%}">ืขื™ื“ื›ื•ื ื™ื</a>
                  </div>
              </li>
            </ul>
        </div>
    </div>
</nav>
honest hinge
grand badge
#

@honest hinge Does the ProductDetailSlugView have a model set that has a slug field?

honest hinge
#

i really confused

quick spruce
#
  {% for book in resp %}
        <a href= "{{book[2]}}">{{book[0]}}<input type="hidden" name='bookid' value="{{book[1]}}"></a><br>

        {% endfor %}```
#

im trying to get bookid when i click the anchor any ideas?

quick spruce
#

i mean im trying to pass bookid

limber vine
#

Is there a fast basic template I can use to launch a simple website for my business with linux? I'm trying hugo right now but started getting a headache I'm ready to just pay for dynamic hosting to avoid the headache but thought I might ask here first

rare oar
#

hey all, I'm paginating a queryset of like 320 records right now and its growing. If I wanted to easily add a "rank" column to these results, is there an easy way to do it without killing performance? A bit lost since its a generator
The rank is basically just a incremental number from 1..n based on the queryset order_by

rare oar
#

Hi just an update that I solved this using a Window Expression

native tide
#

Why does Django look up on comments in templates? I am getting error, becouse I have some HTML code commented. I need to remove it completly . Why is that?

glacial quartz
#

anyone have a good example how to connect postgresql with aiohttp

orchid aspen
#

Is there any type of framework that makes front end development easier(using markdown or something)

#

@native tide commenting the HTML out would lead to it not being shown, not it not being processed

#

Sorry for the excessive use of not

native tide
#

Did I understand you good? The good should not been processed?

#

I noticed I must but Django expression in {# code here #}

#

so my code: {%url 'polls:download' 1 %} should look like this {#%url 'polls:download' 1 %#}

#

Do you know the way to comment it in PyCharm?

#

CTRL + / is taking block of code and commenting it like HTML tags. How to comment Django expression with it as well?

#

so that 1. <a href="{%url 'polls:download' 1 %}">ISO</a><br>

#

will look like this:

#

<!-- 1. <a href="{#%url 'polls:download' 1 %#}">ISO</a><br>-->

#

OK, i have turned on Django Support in the settings window and now it works well.

quick spruce
#

anyone know how to do an input and an anchor, i wanna click an anchor and access a hidden input in a flask route

fossil lotus
#

Does anyone here know how to make a search filter for a list of data?

quick spruce
#

So autocomplete?

#

@fossil lotus

hardy bridge
#

Does anyone have any info or suggestions for reading material / tutorials for learning about bugs and vulnerabilities for django 1.10 and how to patch them? Or insight into why Github tells me 1.10 has vulnerabilities and if I should be concerned? Just finished a bootcamp and they taught 1.10, so i'm rolling with it for now, but I want to make sure of what I'm doing if I build any websites and for my portfolio

#

my bootcamp is covering general security vulnerabilities, and maybe they cover this in a part I haven't reached, but it doesn't seem like it gets that specific.

lost saddle
#

where does it say that in github

hardy bridge
#

on the repo page. "We found potential security vulnerabilities in your dependencies." If I click through to see the vulnerability, it gives me more information and directs me to the nist.gov page. I guess I should read more about that before I follow up with this line of questioning.

#

it basically just tells me on github to upgrade to 1.11 lol

#

actually, I think I may have just answered my own question. I guess the last time I looked I didn't find as much info, which was probably just my fault. lol

fossil lotus
#

@quick spruce not sure what it's called but probably

quick spruce
#

i think thats what you want, you want to be able to have it recommend as you go right?

fossil lotus
#

yeah

quick spruce
#

yo, im trying to get data from html to a wtform than be able to pass that data to a flask route, any ideas on how to do that

#

im trying to pass it when i click a anchor href but its going bad

quick spruce
#

that or i want to be able to click and anchor tag and have a hidden input but can't figure out how

hardy bridge
#

do you have to use an anchor tag? I'm not sure if that's possible, but i'm not exactly super experienced with flask.

#

you could always use a route variable

quick spruce
#

darn and my team is really loving the anchor tag and it sucks lol

#

and with route variables you have to use them all right?

#

im trying to use 1 and pass the other

hardy bridge
#

yeah, it's an parameter that you have to meet, unless you give it a default in the route

#

depends on the specifics of what you're doing whether or not it would work though lol

quick spruce
#

i want user/title but have to give it bookid somehow

hardy bridge
#

couldn't you just query the title with just the book id?

#

also as an aside, i love projects with books ever since i misread bookid as boo, kid once and laughed for like 30 minutes

quick spruce
#

its gonan eb coold

#

*gonna be cool

hardy bridge
#

๐Ÿ˜ƒ

#

either way, I think it's better to pass as little info as possible through the route, plus, if you pass only the id, you don't even need it to be a post route

#

unless there is a reason you don't want to query in this function.

quick spruce
#

lol boss just wants it to return user/book_name_is_cool

#

and i wanted an input so i can just grab it that way

#

it searches for books than you select one through the href and it brings you to a page

#

having it in a for loop is rough man

hardy bridge
#

are there entryways to this route that won't have access to the book title?

honest hinge
modern vale
#

Your template

#

Home_page.html doesn't exist

hollow flower
#

Hello, what are the best resources for learning Django?

woven wasp
#

I am making a Flask application and i have writen out the code, i have flask_login downloaded but when i run it says module not found

#

im fucking losing my mind over this

floral seal
#

Are you sure you are running it with the right interpreter/enviroment

hollow flower
#

The official tutorial was not really anything I wanted.

floral seal
#

Then what are you looking for

hollow flower
#

How do I build a simple site in Django.

#

Without the need for databases at this point.

floral seal
#

DBs are very important in web development regardless, and the official tutorial doesn't only cover that

hollow flower
#

Regardless, I currently only want to build a site with the help of the Django's templating system.

woven wasp
#

@floral seal i am running it through the built in terminal in vs code and i tried normal terminal and nothing :p

floral seal
#

try pip list

woven wasp
#

what

floral seal
#

pip list to show all packages installed

woven wasp
#

it says its installed but its not in pip list

floral seal
#

how did you install it? Just pip install flask-login?

woven wasp
#

i tried pip3 list and its there

floral seal
#

aight

woven wasp
#

pip3 install flask_login

floral seal
#

how are you running the script?

woven wasp
#

in vscode going to terminal > new terminal inside vscode

floral seal
#

what are you typing

woven wasp
#

in pip3 list it says Flask-Login instead of flask_login but when i try Flask-Login in vscode it says syntax error

floral seal
#

try to also install it with just pip

woven wasp
#

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/rl/cxf2wzwd78g98bnzljwfpqbc0000gp/T/pip-install-2LJHaE/flask-login/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/rl/cxf2wzwd78g98bnzljwfpqbc0000gp/T/pip-record-zP0tKD/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/rl/cxf2wzwd78g98bnzljwfpqbc0000gp/T/pip-install-2LJHaE/flask-login/

floral seal
#

Idk how to change python interpreter that flask uses because I just use a venv, so can't help you with this one, sorry

woven wasp
#

wait i tried sudo pip install flask_login and it worked

#

it is running but when i go to check it it gives a 404

hollow flower
woven wasp
#

Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

covert radish
#

How do you control or keep count of API requests your app have made in the past hour?

upper mango
#

trying to make a website with aiohttp but i cant find how to make get and post request

limber hemlock
#

how do I convert my session based authorisation app to token base authorisation? I use flask. my endpoints render templates

thorny scaffold
#

Hi guys

#

What is the best way to show a youtube-dl video download progress on a web page (flask)?

native tide
#

!yt-dl

#

!ytdl

lavish prismBOT
#
ytdl

Per PyDis' Rule 5, we are unable to assist with questions related to youtube-dl, commonly used by Discord bots to stream audio, as its use violates YouTube's Terms of Service.

For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2018-05-25:
4A: You agree not to distribute in any medium any part of the Service or the Content without YouTube's prior written authorization, unless YouTube makes available the means for such distribution through functionality offered by the Service (such as the Embeddable Player).
4C: You agree not to access Content through any technology or means other than the video playback pages of the Service itself, the Embeddable Player, or other explicitly authorized means YouTube may designate.

thorny scaffold
#

Okay

#

fortget about youtube-dl

#

How to display a progress bar until a function runs..

honest hinge
#

the products links doesnt work what do u think the problem?

#

im sure about the links

steel tiger
#

I have a div with max-width:30em and min-width:100%

#

How do I default it to 30em? and shrink when it hit's below it

#

(Need this for mobile/small screen friendly when it shrinks small)

upper mango
#

?

#

no

deep narwhal
#

how to do while with ssl_sock recv for multiple recv data?

#

without the timeout error

lost saddle
#

Anyone has any good workarounds?

unborn terrace
#

@lost saddle call distinct on your queryset?

lost saddle
#

still duplicate entries

#
>>> from mainsite.app_models import *
>>> Title.objects.count()
105
>>> Title.objects.order_by('entry__date').distinct().count()
105
>>> t = Entry.objects.last().title
>>> [*Title.objects.order_by('entry__date').distinct()].index(t)
2007
>>>
unborn terrace
#

that's odd

#

@lost saddle does this fail?

a = Title.objects.order_by('entry__date').distinct()
b = Title.objects.order_by('entry__date').distinct()

assert a.count() == len(list(b))
lost saddle
#

nope

#

hold on

#

yeah it fails

#

lol

unborn terrace
#

you either have to drop the ordering (and order it with sorted or something like that) or deal with it

#

what are you trying to achieve exactly?

lost saddle
#

order titles by their entries date

#

if a title's last entry is the last created, that title is the first

#

So entry__date is a bit wrong even

#

should be somehow last_entry__date

#

@unborn terrace

unborn terrace
#

@lost saddle why would entries have multiple titles though? ๐Ÿค”

lost saddle
#

Title's have multiple entries

#

I may have confused couple things here

#

Entry model has a foreignkey to Title

#

I want to order Titles in a way that

#

All the entries are ordered by date without titles involved

#

and take the ordered entries' titles

#

and distinctify them

#

so the first title in the ordered queryset has the last entry entered into the database

#

the second title's last entry is the second last entry that has been entered

unborn terrace
#

yeah looks like you have to do this processing by hand

#

like

  1. get all entries
  2. filter out entries that are not the last one of their title
  3. query associated titles
lost saddle
#

or

#

or

#

have a property return the last entry date

#

and order by that

#
>>> Title.objects.annotate(last=Max('entry__date')).order_by('-last')[:5]
<QuerySet [Title(
    creation_date=2019-04-10 09:54:48.623112+00:00,
    creator_id=1,
    id=105,
    text=abc,
), Title(
    creation_date=2019-04-22 00:36:19.977737+00:00,
    creator_id=1,
    id=107,
    text=dasdasdsa,
), Title(
    creation_date=2019-04-16 12:52:02.092744+00:00,
    creator_id=1,
    id=106,
    text=vdczx,
), Title(
    creation_date=2019-03-19 12:10:24.704826+00:00,
    creator_id=65,
    id=35,
    text=Author public together land size thing,
), Title(
    creation_date=2019-03-31 22:42:06.458405+00:00,
    creator_id=1,
    id=102,
    text=sfdsdas,
)]>
>>>
#

@unborn terrace explain this

#

lmao

#

Okay yeah apparently this is my answer and it works with above config

#

One of the title's above didn't had any entry which made it error but overall it is what I need to do apparently

strange hollow
#

Is it possible to modify a Flask session inside a Flask SocketIO event?

@socketio.on("signup req")
def signup_req(json):
    print(f"Response! {json}")
    socketio.emit("signup res", "RECEIVED!")
    session["user"] = {"name": json["name"]}
ancient flame
#

Someone used Scrapy (python library) to crawl websites?

steel tiger
#

How do I have an empty div at 500px x 1000px and when the screen is too small, it shrinks width

brave mantle
#

Either use a percentage based width, or you'll need media queries

#

note that CSS pixels are not screen pixels

steel tiger
#

That need to be wrapped if they cannot fit into the screen

brave mantle
#

this is what flexbox is for

#

set up a flex row, have them wrap when there isn't enough space, set a minimum width

#

bingo bango bongo

steel tiger
#

If you resize the screen, they stay the same width until it is smaller than the size

#

Then it smooshes the width down and makes the height larger

brave mantle
steel tiger
#

Hmm

brave mantle
#

use flexbox

steel tiger
#

I tried them yesterday to no appeal

brave mantle
#

avail.

#

Try again :P

steel tiger
#

Also do you set flexboxes on the divs themselves or container?

brave mantle
#

this is the problem it exists to solve

#

the link I gave you separates container vs item properties

steel tiger
#

Ahhh

#

That's why it's split like that

#

Makes more sense now

brave mantle
#

so basically

#

flex container, flex direction row, flex wrap set to wrap

#

then set flex grow on the children as required

#

and that's about it

#

flex-basis can be used to set the width

heady basin
#

did you solve it?

#

in bootstrap you can also set column sizes that changed based on the size of the viewport

steel tiger
#

Ok

heady basin
#

each row is composed of 12 units and you can divide them based on what the viewport is

steel tiger
#

I done flexbox with no effect on anything

#

I need all items to be 30em, shrinking down to 100% if it goes below it

heady basin
#

highly recommend looking at this if you havent already

#

it will automatically reposition your elements

#

when the viewport changes

steel tiger
#

Seen it but how do I wrap them

heady basin
#

do you have your elements in rows/columns already?

steel tiger
#

@brave mantle I can't get flex-basis to set the width

#

It's a big for loop of 15 cards/divs

brave mantle
#

Set a minimum width as well, a min-with

steel tiger
#

I have like the container

#

Then an outer div for the card for margins

#

Then an inner that defines size

brave mantle
#

okay that won't work

steel tiger
#

Yep

brave mantle
#

you have the flex container

#

and then you have your flex items

#

and that's where the sizing goes

#

I'm not sure why you need a margin

steel tiger
#

So divs don't touch

brave mantle
#

just set justify-content to space-evenly or space-around

#

on the container

steel tiger
#

Nvm I don't

#
.jilk-card-inner {
    border-radius: 0.5em;

    padding-top: 1em;
    padding-bottom: 0.333em;
    padding-left: 1em;
    padding-right: 1em;

    min-height: 13em;

    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 30em;

    position: relative;

    margin: 0.75em;
}```
#

That's a div

#
.jilk-card-container {
    clear: both;

    display: flex;

    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;

    align-items: flex-start;
    align-content: flex-start;
}```
#

This is the container

#

Can't get width working

brave mantle
#

well remove the flex-shrink obviously

#

it's one or the other

steel tiger
#

Ahh

#

Nope

brave mantle
#

you don't need to add an attribute just because it exists

#

for example, those two aligns

#

the position also will mess things up

steel tiger
#

It is needed

brave mantle
#

then you're doing something wrong

#

you also seem to be using floats

#

you should never need floats in a flexbox layout

steel tiger
#

Not the width of the cards

#

I basically need it to align some items inside the div

brave mantle
#

align-content to start

#

er, flex-start

#

my question is why on earth you're using floats at all

#

I should also point out, you don't make a new flex container for each row

steel tiger
#

Hmm lemme see

brave mantle
#

you literally put everything into the same container

steel tiger
#

I'm not

#

Hmm?

#

You don't or you do

brave mantle
#

you do

steel tiger
#

But the rows will have 1-5 flexboxes on them

brave mantle
#

that doesn't matter

#

one container for all your rows

#

let the browser deal with positioning

steel tiger
#

That's what I done

brave mantle
#

also seems like you should be setting a max width

steel tiger
#
<div class="flex-container">
    <div class="flex-box"></div>
    <div class="flex-box"></div>
    <div class="flex-box"></div>
    <div class="flex-box"></div>
</div>```
brave mantle
#

yep

steel tiger
#

Done

#

But now things that are smaller than the max width are still smaller

#

That's the only thing I need to fix

brave mantle
#

try flex: 0 0 XXrem

#

remove basis, shrink, grow

steel tiger
#

Nope

brave mantle
#

also, use rem instead of em

steel tiger
#

Bit too late for that one

brave mantle
#

ctrl+r

#

:P

#

I'm not sure what the problem is entirely

#

mess with it, see what you come up with

#

you can straight up set a width on them if you need to

#

use your browser's inspector

steel tiger
#

It makes everything a tad bigger

#

Yeah it messes with some bits

#

Basically, everything is fine with it but I just need empty divs to expand to max-width by default

#

If you define a specific width and smoosh the divs/flexboxes down smaller than width: Xem;

#

flex-basis is doing litrelly nothing

brave mantle
#

are you using some CSS framework?

steel tiger
#

Bootstrap with a lot of shoddyly written but working custom css

brave mantle
#

like bootstrap or jquery ui

#

oh god yeah, okay

steel tiger
#

:/

brave mantle
#

in that case forget doing this yourself

#

see if bootstrap has something for it

honest hinge
steel tiger
#

All 270 lines of it

brave mantle
#

bootstrap is the IE of CSS frameworks

#

@honest hinge if you look at the page, it says "page not found"

#

you don't have a matching path in your urlconf

steel tiger
#

I would use a weird grid but how does that resize/wrap

brave mantle
#

they don't, really

honest hinge
#

i know but i couldn't find the problem

brave mantle
#

You don't have a matching URLconf

#

tha'ts the problem

#

it's not that you tried to write one and it was incorrect

#

you haven't written one at all yet

steel tiger
#

Best video I could get of it

brave mantle
#

I'm not in a position to watch videos

steel tiger
#

๐Ÿ‘Œ

brave mantle
#

I will say though

#

bootstrap is not flex based

#

I believe they are mostly float based

#

so you're going to have a hard time doing this with flex

steel tiger
#

FYI the website works without bootstrap

#

I just use it for fonts, some easier aligning and navbar

brave mantle
#

generally I like to recommend flex-based frameworks

#

like bulma for example

#

because they make this kind of thing so much easier

steel tiger
#

ยฏ_(ใƒ„)_/ยฏ

brave mantle
#

you can still do it with bootstrap, I just can't think of an elegant method

steel tiger
#

Weird that there isnt a 3rd option with min-x and max-x

#

If there was just a default-x it would fix this

#

Just make an empty div the default-x

#

Go to max-x if content overflows bounderies

brave mantle
#

sounds over-complicated

steel tiger
#

min-x if it underflows (?) bounderies

#

Well this is annoying

#

Only way to fix it is to add a ton of non-breaking spaces that sometimes ruins the formatting

brave mantle
#

There are light frameworks out there that only give you a grid or whatever

steel tiger
#

:/

honest hinge
#

im a biggnner

steel tiger
brave mantle
#

trust me, if I had a dollar for every time someone was screwed over by bootstrap

#

I'd be a rich man

steel tiger
#

I just need to expand that left card to full max width :(

#

I don't think its even bootstrap

#

It works the same but just looks stupid

brave mantle
#

do you only have 2 cards?

steel tiger
#

On the main website I have 15 per page

brave mantle
#

you're sure that your class is also applied to the first card?

steel tiger
#

If you had a 100" tv it would have like 8 cards in a row

#

It is

#

They are made by a for loop

brave mantle
#

and you can verify that in the inspector?

steel tiger
#

You can verify it in source code

#
{% for listing in listings %}
    <a href="/server/{{ listing.guild_id }}" class="no-highlight">
        <div class="jilk-card-inner darker-back">
            <h3>
                <div style="max-width:0em;min-width:100%;">
                    <div class="jilk-card-cutoff">{{ listing.name }}</div>
                </div>
                <img src="{{ listing.image_url if listing.image_url != '' else url_for('static', filename='img/no-listing-img.png') }}"
                    class="jilk-card-thumbnail card-custom dark-back">
            </h3>
            <p class="lead">{{ listing.description if listing.description != None else 'No custom description' }}
                <div class="inv-widget-outer">
                    <div class="inv-widget members-special inv-widget-border">
                        <img src="{{ url_for('static', filename='img/member-icon.png') }}"
                            class="inv-widget-img inv-widget-border">
                        <p class="inv-widget-text">{{ listing.members }} Members</p>
                    </div>
                </div>
        </div>
    </a>
    {% endfor %}```
brave mantle
#

no

#

fuck that

steel tiger
#

Oh discord did not like that

brave mantle
#

use your inspector

steel tiger
#

It is the same

brave mantle
#

there is a reason I'm telling you this

steel tiger
#

Anything I apply to it, also applies to the other

brave mantle
#

your inspector is not just for inspecting

#

you can modify the CSS rules to the right

#

allowing you to quickly mess with them without reloading the page

steel tiger
brave mantle
#

for example, you could set the first 0 in flex to 1

#

and see what it changes

steel tiger
#

Nothing

#

Entire flex does nothing with the divs

#

Works as a container

brave mantle
#

it's shorthand for grow, shrink, basis

#

recommended because it intelligently sets the others

steel tiger
#

Yeah

strange hollow
#

Is it possible to modify a Flask session inside a Flask SocketIO event?

@socketio.on("signup req")
def signup_req(json):
    print(f"Response! {json}")
    socketio.emit("signup res", "RECEIVED!")
    session["user"] = {"name": json["name"]}

I tried this, but it didn't work.

steel tiger
#

๐Ÿ‘‹

#

You could do app.session? But that may make for some bad imports

strange hollow
#

I did that already before I used the actual session...

#

I thought it'd be a problem to do app.session

#

I'll just overflow my question in stack c:

steel tiger
#

Seeing that the stack is essentially an ordered heap where you can only take off the top, a stack overflow would basically be a ram overflow?

#

Nope, it's when the heap and stack collide

#

So basically I guess?

strange hollow
#

r/woosh

steel tiger
#

Yes

#

It is a joke but I asked the meaning of "stack overflow"

strange hollow
#

You don't know what stack overflow is?

steel tiger
#

The meaning of stack overflow

#

Not the website

#

@brave mantle I kinda ended up redoing the entire card system

brave mantle
#

Did it help?

steel tiger
#

Flex is easier to control

#

I am having some trouble setting up a cutoff with .. if text goes past a certain height though

glacial quartz
#

hmm i think i should mix them together in loop right? anyone have an example?

elder nebula
#

Cannot get Resizing things work for python3.7

#

xD

#

I am kinda use to things not working

hollow flower
#
Template error:
In template D:\Programming\Websites\Python_Websites\Aava\templates\footer.html, error at line 2
   Invalid block tag on line 2: 'blocktrans'. Did you forget to register or load this tag?
   1 : {% now "Y" as current_year %}
   2 :  {% blocktrans %} Copyright {{ current_year }}{% endblocktrans %}
strange hollow
#

{% block trans %}

#

Just a space

hollow flower
#

No, that's not how it works.

hollow flower
#

Continuing tomorrow.

rare oar
#

hey all, I have a pretty simple queryset that I paginate. Its about 500 records right now and I filter about 50 at a time. Is there any built in or packaged search options? Just looking to search on a field, provide any potential matches with a link to where it is on that page/table row

tacit orbit
#

Hey is anyone around that knows how to close connections for a postgres database. Currently using Flask/sql-alchemy/marshmallow/postgres

glacial quartz
#

anyone know how to send email with from aiohttp server, am trying to port my flask server to aiohttp

#

aiosmtplib to the resque xD

glacial quartz
#

hmm jwtoken should i put in auth header or where? and what format should it be Autorzation: token-"dadsADsddfdsfds" or Autorization: "dasdsadasSADasd" or what ๐Ÿ˜ƒ

limber vine
#

what is the easiest way for a non developer to just get a template of a website that I can upload to my repository and then host on Netlify?

lost saddle
#

A gui

jade egret
#

so polling a aiohttp server via browser theres an additional request to/for /favicon.ico whats the best way to handle/shutoff

meager helm
#

@strange hollow try this ```python
@socketio.on("signup req")
def signup_req(json):
print(f"Response! {json}")
socketio.emit("signup res", "RECEIVED!")
session["user"] = {"name": json["name"]}
session.modified = True

strange hollow
#

Mate, I fixed it already

#

And I did it in a better way

#

Thanks though

olive wharf
#

Is there a limit to how much flaskrestful can send as a response?

#

Well, don't i feel silly now. I set the statuscode to return 204. Which i guess Flask is "smart" enough to not actually send anything then

olive wharf
#

I swear to god, I can never get CORS to behave grumpchib

#

Can someone give me a rundown on CORS with flask-restful

honest flower
#

Cross posting from #help-chestnut

Can anyone help out with comparing datetimes in flask-sqlalchemy

entry = Entry.query.filter_by(user_id=current_user.id, timestamp='2019-04-13').all()
Its a sqlite database so I know the timestamp field is stored as a string but I'm not sure if sqlalchemy turns them back into datetimes when filtering

Also the timestamp field has seconds, 2019-04-13 16:36:15.592823

shrewd sand
#

@honest flower This isn't the place for database help

#databases is where you want to go

honest flower
#

Ill post there too but I figured this mostly revolves around how flask-sqlalchemy behaves

#

Thanks ๐Ÿ˜ƒ

native tide
#

Anyone with good microservice knowledge ?

woeful sphinx
#

hi guys. I am having a problem lately

#

i have updated code on the waeb-server, and tried restarting uwsgi, nginx, and rebootet the whole server, i have also tried deleting the .Sock file

#

It doesn't register the newly commited code, even though it is right there

meager wharf
#

anyone use D3.js and Flask before?

hardy bridge
#

I'm not understanding the django documentation on this. Does django come prebuilt with a working email backend?

lost saddle
#

Yes

#

I'd you have smtp server up and running or using one online, you just put your credentials and use something like

#

django.core.mail.send_mail

hardy bridge
#

Maybe I didn't ask what I meant then, because that's pretty much what I meant. lol. So without an smtp server, it would fail. Thanks for the info! ๐Ÿ˜ƒ

hardy bridge
#

is there a best practices way to setup an smtp server on an ubuntu 16.04 server? everything I've searched so far points me towards postix.

#

Also, is there a good way to setup a localhost smtp server to use while I'm developing my site?

#

Papercut seems like it might be a solution to the second part, but I haven't looked too deeply into that yet.

floral fulcrum
#

trying to run flask on AWS EC2 but having some issues: [Thu Apr 25 06:07:58.106087 2019] [wsgi:error] [pid 4377:tid 140349786134272] [client 112.136.200.14:64526] from flask import Flask [Thu Apr 25 06:07:58.106113 2019] [wsgi:error] [pid 4377:tid 140349786134272] [client 112.136.200.14:64526] ModuleNotFoundError: No module named 'flask'

patent cobalt
#

Did you install flask?

floral fulcrum
#

yes i installed it on python3

#

not sure if it is launching python 2.7

patent cobalt
#

You can try to do:

import sys
print(sys.version)

That should show you the python version

#

Did you use the same python command to run the app as you did to install it?

floral fulcrum
#

trying to run it as a wsgi application which i dont have experience with

#

i think that it is launching python although im not sure how it is doing it

patent cobalt
#

Do you have a shebang inside of your Python file?

#

If so, does it point to python or python3?

floral fulcrum
#

points to python3 if you mean #!

carmine rune
#

Guys, what happened with the Django discord group?

ancient zinc
#

i tried port 5000 and 4670 (random)

jade egret
#

any output from flask terminal

ancient zinc
#

just this

jade egret
#

and is that localhost or '0.0.0.0'

ancient zinc
#

Debugger PIN:

#

c9

#

nvm

#

thanks

#

i tried changing host to 0.0.0.0

#

it works

jade egret
#

np, that opens it up so other devices/ips can see it

midnight timber
#

To anyone familiar with django's simple_history:

Whenever I have a foreign key in a model as well as the history enable on it, I get a stacktrace as follows:

File "/usr/local/lib/python3.6/dist-packages/django/db/models/query.py", line 413, in create
    obj.save(force_insert=True, using=self.db)
  File "/usr/local/lib/python3.6/dist-packages/django/db/models/base.py", line 656, in save
    if field.is_relation and field.is_cached(self):
AttributeError: 'IntegerField' object has no attribute 'is_cached'```
I stepped through this, the field it's referring to is the is field of the model.

Here is the model in question giving the above error:

```...
class SimpleTable(models.Model):
    some_value = models.IntegerField(default=0)
    some_foreign_key = models.ForeignKey(Asset, on_delete=models.CASCADE, blank=True)
    history = HistoricalRecords()```

I'm a little stumped as to what is going on here, why adding a `HistoricalRecords()` field would cause this error.... ![Thonk](https://cdn.discordapp.com/emojis/308122661462999046.webp?size=128 "Thonk")
fathom prism
#

Looks like the you may be either misspelling the method name (is_cached) or using the incorrect object (IntegerField). Check the docs again or use dir(field) to see what types of methods are available

lost saddle
#

It is clear from the traceback it is a method that django calls, not themselves

finite wren
#

Maybe I'll get better luck here:
I'm looking to automatically submit some forms for what essentially is a calendar. The main webpage displays the events as a calendar. When I hit "Add an event" a popup window comes up asking for start date, start time, end date, end time, title, and description. This is all the processed by clicking submit, which adds the entry onto the periodically refreshed main page.

I'm aware that this could be handled using javascript, however:
1โƒฃ I'm trying to broaden my horizons in Python
2โƒฃ I am more proficient in Python, as I use it daily.

Essentially, I am wondering if someone can point me in the direction of a particular library, or perhaps combination of browser extension/library (to avoid having to store auth etc), where I could ultimately achieve the same results as javascript.

The end goal is to be able to run this each day and simply have it auto-populate the calendar since most of the events are the same every day. Unfortunately they don't provide a way to simply copy from the previous day and
simply adjust minor details to the day. Instead, they expect us to fill this out event by event every single day.

#

So I want to fire up my calendar for the day, run my python script and send a bunch of form submissions to populate the calendar with a bunch of preset events. Then I can restructure/add things that matter for that particular day manually throughout the day.

#

Please @me if you respond

opal leaf
#

@finite wren you could use selenium or figure out how they submit forms and use just http POST/etc requests

finite wren
#

@opal leaf thank you for replying, I'll look into selenium. Appreciate it

#

Ah, seperate application, I'll look into http post requests via python then

hardy bridge
#

I FINALLY figured out sendgrid integration! I feel like my progress is at a snails pace though haha.

midnight timber
#

finally found it this morning with a fresh mind

#

it was an outdated package... amel_sigh I pip'd simple_history instead of django-simple-history.

ancient zinc
#

how to create a cookie

#

on flask

#
  • how to transfer data to html
#

to use
{{username}}

ancient zinc
#

what diffrence bettwen make_response and Response

quick spruce
#

in flask, how do i send things to validate from the route.py than back once validated

fiery geyser
#

Anyone here used restplus?

ancient zinc
#

i keep getting this

#

on flask app

#

no errors

#

and it take like a minute of waiting to get this Time-out

floral fulcrum
#

what issues will i have if i directly run flask as production server?

lost saddle
#

Security

floral fulcrum
#

ok running it through gunicorn now is that any better?

fathom prism
#

scalability

#

yup

ancient zinc
#

hello ? im there ?

#

no one answered me

fierce hare
#

Uhm so for a database (Before starting to learn web development), I usually use motor.motor_asyncio. Is it a good idea to use it with flask? If not what should I use for a mongoDB with flask?

floral fulcrum
#

what is your usecase?

fierce hare
#

Well right now as I'm learning it will be blogs and user logins/signups. But I have a discord bot that stores data into a mongodb, and I want to have my website pull that data from it and display it. And I don't want to use 2 different DBs for that. (Like SQLAlchemy for users and blogs and mongo for my bot data etc...)

#

I hope that made sense ๐Ÿ˜“

floral fulcrum
#

I don't see why it wouldn't work.

#

Might need to raise a 404 when you can't find a collection.

hexed linden
#

hi so i've got a bit of an issue with flask. i'm using uikit css for my frontend design and i have a form setup. it wont pass through as a POST request to my flask app, and I can't proceed with my register/login stuff. my app won't even load my database. im basically using the same code from another base script of mine, which works fine... please help. here's my full sourcecode, url-removed

#

i also have a models.py but im not sure how useful that will be

#

I think I may have resolved it. I didn't add method='POST' to my form, haha, but db.create_all() still doesn't seem to work

#

do I need to create the tables and such myself?

#

fixed it all

#

thanks though ๐Ÿ˜ƒ

polar wasp
#

what is current_user

#

@fierce hare

fierce hare
#

It is a flask_login class

honest hinge
#

hello,how to make cml in correct path of app models cuz i made tow apps then i changed somethings in a its models how do i make migration for that in correct path?

long zinc
#

Hello, I am having trouble getting Vue.js to render in my Flask template

#

Figured it out

floral fulcrum
#

Relatively new to web programming. Any recommendations on how to add TLS to flask

#

And roughly how much time it would take

alpine oak
#

i don't think you add tls to flask,i think you add it to the web server...

#

like dat

floral fulcrum
#

Thanks do I need a domain to use real certificates

long zinc
#

yes, you need to purchase a domain name

#

or obtain one some other way

#

checkout namecheap

floral fulcrum
#

Oh thanks

#

GoDaddy says $1 for first year. Do you know if it works with AWS EC2 servers?

long zinc
#

I don't see why not, But I have not done it myself

floral fulcrum
#

Ok thanks I will try it out

alpine oak
#

don't use go daddy

#

they're a terrible organization

floral fulcrum
#

Terrible like customer service or just bad people?

alpine oak
#

all of the above

long zinc
#
Amazon Web Services

I am fascinated by things that are simple on the surface and complex underneath! For example, consider the popular padlock icon that is used to signify that traffic to and from a web site is encrypted: How does the browser know that it should display the green padlock? Well, ...

#

You still need a domain though

floral fulcrum
#

I went to ghandi and it's something else lol

alpine oak
#

gandi, yeah, my bad

#

lol

#

and go daddy supported SOPA

floral fulcrum
#

I was wondering why you recommended that site when it looked so bad lol

alpine oak
#

so, y'know, they don't give a shit about the interwebs and are only interested in turning a massive profit

floral fulcrum
#

Oh yeah SOPA

long zinc
#

yeah, boycott go daddy

floral fulcrum
#

I was remembering all the stupid GoDaddy ads inatead

alpine oak
#

gandi.net has a great ui, a great privacy policy, and their shit makes sense and even if you get high traffic and a good domain name, they're not gonna charge you extra if you somehow let your domain lapse like go daddy has done

long zinc
alpine oak
#

they've been my registrar and the one i've suggested for years. no guff, no bs, no ads woven into their site like go daddy does... pretty awesome. ๐Ÿ˜ƒ

floral fulcrum
#

Hmm wonder if I should go with cheapo site with strange extension

alpine oak
#

i mean, what is it you're trying to do?

floral fulcrum
#

Personal site maybe show off some code projects

alpine oak
#

if you're going to use it professionally as a portfolio/live cv, top level domains like *.com's are penultimate usually and make you seem extra real

floral fulcrum
#

Hmm true

#

I'm not web designer if it matters

#

But I can see how com is just easier to read

alpine oak
#

i know this isn't super pythonic, but if you're just looking at showing off code, take some time and figure out how to make a mark down site on github to just show off codes

#

but if it's you selling yourself, .coms make you seem more professional, like you're there to do bidness

floral fulcrum
#

Oh yeah I have tried some MD with jekkyl but got confused by the framework

#

Have since done some basic stuff in Django and flask

#

Was thinking of adding them to a website to show off even if it isn't what I usually do.

long zinc
#

@alpine oak have you ever tried Pelican? I am using it now. I was wondering what others thought

alpine oak
#

i haven't. nerver heard of it, but it looks alright. it definitely seems like a back end dev's ease of use cms w/o any of the bulk

long zinc
#

It's like Jekyll, although I've never used Jekyll

#

It's for static sites. You can host it on Github

#

I just mentioned it because you said something about static Markdown sites on Github

alpine oak
#

yeah, i'm seeing that, super interesting. i'm reading the docs now, makes super good sense if you're not doing anything bananas and hosting up anything too big

#

book marked to revisis later

floral fulcrum
#

how does linking and css/js work on md sites

alpine oak
floral fulcrum
#

md doesnt have classes for tags right?

#

so would it be a bit hard to adjust your look?

alpine oak
#

that uses jinja, so it'd just be like using the flask templates when you're building it out

floral fulcrum
#

oh I see

alpine oak
#

yeah, and classes and other tags for css/js are kinda dirty

#

some of it i'm kinda down with, but css3's semantic tagging makes most of it kind irrelevant

floral fulcrum
#

css3's semantic tagging?

alpine oak
#

yeah

#

so back in the day everyone used tags to classify shit

#

w/ html5 and css3, you can just call article, aside, figure, footer, header, nav, section, summary

floral fulcrum
#

oh

alpine oak
#

yeah, html5 css3 and JS are freakin' amazing, and it's a travesty so many people lean on the old school methods so much, but old habits die hard.

floral fulcrum
#

old school methods?

#

should i use my primary email for domain registration?

alpine oak
#

nine it depends on your desire for security

#

i use my non shared email address for that

floral fulcrum
#

hmm thanks for the tips

#

bought a domain from gandi.net hopefully it finishes up pretty soon i want to set up site before finals lol

#

I need to learn how to make decisions faster so i stop wasting so much time lol

honest hinge
#

hello it is okay if i emulate a whole project from github?

olive wharf
#

With flask-restful, how would i get the body content on a request?

hasty relic
#

Hello everyone, I have small problem with Django. I am new to Python and Django. For my project I install virtual environment with python 3.7 and then install django version 2.2. Problem is when I create new django project the version is 1.11 and not 2.2. Could someone help me with that?

patent cobalt
#

How do you create your Django project? Are you using an editor/IDE with virtual environment support built into it?

#

Alternatively, do you activate the right environment when running the project?

hasty relic
#

No I am using terminal to create virtual env I tried with two commands and the result is the same one is python3 -m venv env and second one is virtualenv env -p python3.7 . I am pretty sure that I was activated that environment.

patent cobalt
#

Okay, can you do pip list for your virtual environment?

#

Just to check what's going one

hasty relic
patent cobalt
#

Can you type in pip list with the virtual environment activated?

#

I'd like to see what it says

hasty relic
patent cobalt
#

Okay, so it looks like it has the right version

#

To check, open the Python REPL (just type python with the virtual env activated) and type:

import django
print(django.VERSION)
hasty relic
patent cobalt
#

That means it is using Django 2.2

#

I'm not sure why that docstring says otherwise

#

Maybe someone forgot to update it

hasty relic
#

Also it use url and not path in urls.py

#

I guess it was in previous version?

patent cobalt
#

Are you working with an existing project?

hasty relic
#

I am just starting from scratch.

patent cobalt
#

Right, so, I'm a bit confused as to why that file seems to be in an older version

#

You did install django 2.2 in your virtual env and the import shows that you are using it

hasty relic
#

Ok thank you very much for your help. I will try something else. If I find a solution I will tell you. Thank you again for your time.

#

Hm weird. When I just deleted project and created it again now it says version 2.2.

odd locust
#

hey folks. is it possible to write a python app that acts as an intermediary between an https connection?

#

I have a webstore that is blocked in a few countries due to their own firewalls (china), and heroku's hosting isn't blocked in those countries. I don't want to move my whole store to a new provider. I am wondering if I can just set up some https forwarding or something so I can reach these customers.

#

I'm pretty sure what I'm trying to do is similar to what VPNs do. the customers that I currently have in those blocked countries use a VPN to purchase.

#

I know i'm not the first person to try to do this. hopefully someone here has done something similar to this.

hexed linden
#

Hey. I would appreciate if anybody could help me with my stackoverflow post, people there seem to be a tad bit slow. Thanks! https://stackoverflow.com/questions/55908295/modulating-my-code-with-python-flask-doesnt-seem-to-work-very-well

thorn vapor
#

how can i use something like opencv with heroku

winged island
#

hey guys, has anyone ever used Jinja for their webapps before?

#

i need some Jinja help

hexed linden
#

@winged island

#

yep

#

how can I help

winged island
#

Nvm i got it

#

Thx tho

long zinc
#

Has anyone tried pur to update their requirements.txt? Have you run into any issues?

tardy pasture
#

@long zinc I've tried this library and it works exactly as advertised.

#

It depends on your workflow, but it could be worthwhile; I ended up not using it, but that's just because of personal preference.

long zinc
#

It seems convenient. I just was wondering what others thought

ancient zinc
#

Hello,
i want to fix a bug on my website the route is

@app.route('/say/<string:word>')
def say(word):
    return word
#

if i go to

#

http://nice.domain/say/hi

#

i works

#

but if i go to

#

http://nice.domain/say/hi/

#

it says

native tide
rare oar
#

did channels just die?

#

Its so hard to find stuff on it other than "Build a chat room"

#

ugh

lost saddle
#

it was a 3rd party project

#

got into django roof

#

and now it is maintained but not developed any further

wet kite
#

i tried uninstalling Django and install again, but
same error

quiet solstice
#

what version of django did you install?

wet kite
#

2.2.1

quiet solstice
#

Your error says the feature you are using was removed in django 1.10

wet kite
#

python -m django --version

#

when i run this its showing 2.2.1

#

need to make a virtualenv?

quiet solstice
#

You need to change the code where you are using django/templatetags/future.py
That hasn't been in django since version 1.10

#

Try deleting all django files manually and then reinstalling.

wet kite
#

i didnt touch that file

#

i tried

quiet solstice
#

It might still have some files from a previous installation

wet kite
#

same error

#

even hello world application not working

quiet solstice
#

And yes, I would make a virtualenv for all projects, precisely to prevent problems like you are having now.

wet kite
#

i checked in local also there is no Django files when i uninstall it

#

yup, ty Grote

meager anchor
#

@ancient zinc those are different routes. Iโ€˜d recommend against it as itโ€˜s confusing, but you can use the path converter instead of string to achieve what you want

agile juniper
#

So I want to build a micro social network for gamers. I'm talking a web portal to discuss ideas, but one that integrates with the Discord, Teamspeak and game servers. Would anyone else be interested in a project like this? We'd be using Python of course, as well as Nuitka for compiling it down to faster speeds. I'm thinking a community could spawn out of this, and api's be developed for game servers as well.

quick spruce
#

I forgot this was more than a help channel lol and Jack if they can integrate

#

Do you mean like use teamspeak and discord or just have it be intractable with elements from them?

chrome river
#

Anybody got any advice/go-to libs for someone looking to implement a dashboard to a webapp running on Flask?

native tide
#

Hey guys

#

anyone here know django rest framework?

#
class IsAscomOrReadOnly(permissions.BasePermission):
    def has_permission(self, request, view):
        if request.method in permissions.SAFE_METHODS:
            return True
        else:
            if request.user and (request.user.groups.filter(name='ASCOM') or request.user.groups.filter(name='Administrador')):
                return True
            return False
#

i'm trying to make a set of groups to have a specific permission. I make like this, but now i need to add more groups to this permission.

maiden coyote
#

@chrome river Check out eel library. See if that helps.

#

just built a small app using eel. It is shown in UI section of this server

chrome river
#

I was looking at Dash but that already runs on Flask and rewriting what I have to keep using Flask whilst also using Dash is a pain so, I'm kinda just stitching bits and pieces together. Hadn't heard of eel, I'll check it out, thanks ๐Ÿ˜„

maiden coyote
#

It is a really small library. But I did build an app in a day using it..

#

and I am no developer... I am on the web side of things.

#

Look at Electron as well @chrome river

#

Concept is the same. But I noticed most people who use Electron, still end up using Flask... for python boilerplate.

chrome river
#

Also not a developer, I work in information security but I need a webapp to frontend my botnet monitor, still searching for the ideal solution ๐Ÿ˜„ hopefully either Eel or Electron will work. I think I'd actually settled on using Flask with everything bootstrap'd and Bokeh for data vis. The rest I would do from scratch D:

maiden coyote
#

Would like to see screen shots if you get it up and working @chrome river

lost saddle
#
class Perm(BasePerm):
    def has_permission(self, request, view):
        return all((
            request.method in permissions.SAFE_METHODS,
            request.user,
            request.user.groups.filter(name='ASCOM'),
            request.user.groups.filter(name='Administrador')
        ))
#

Same code but I think this is a bit better way to do it than all the if elses

#

Actually

#

not the same code but

#
class Perm(BasePerm):
    def has_permission(self, request, view):
        return request.method in permissions.SAFE_METHODS or all((
            request.user,
            request.user.groups.filter(name='ASCOM'),
            request.user.groups.filter(name='Administrador')
        ))```
#

Now 't 's the same I guess

deft lotus
#

hello guys, i'm looking for help . My problem is, when i click on delete, nothing happen
this is my view

def delete_row(request):
    mydata = DataItem.objects.all()
    if request.POST.get('submit'):
        mydata.filter(id=request.POST.get(mydata)).delete()
    return render(request, 'datahistoryrefreshed.html', {'mydata': mydata})
#

my html :

<tbody>

            {% for item in mydata %}

                <tr>
                    <form class="form-inline my-2 my-lg-0" method='POST' action="http://127.0.0.1:8000/blog/delete-row/">
                    <td class="text-primary"> {{ item.name }}  </td>
                    <td class="text-dark"> {{ item.lastprice }}  </td>
                    <td class="text-dark"> {{ item.sinceclose }} </td>
                    <td class="text-dark"> {{ item.sinceopen }} </td>
                    <td class="text-dark"> {{ item.isin }}  </td>
                    <td class="text-dark">
                        {% csrf_token %}
                    <button class="btn btn-outline-secondary my-2 my-sm-0" type="submit">Delete</button></td>

                    </form>
                </tr>

            {% endfor %}
hardy bridge
#

So I feel like I'm overthinking this and would like another opinion if someone out there is so inclined. I'm building a site with django (1.10) and trying to build a gallery app. I want the owner to be able to upload files only from the admin side to specific category folders, then I want those pictures displayed on the gallery template, split up by folder/category. I don't expect more than a few hundred pictures over time as it's intended to be a personal portfolio for an artist page.

I have looked at actual django apps, but considering the size, I think that may be overkill. If I think smaller, would that be as simple as using something like pathlib to pull the files and then adding the relative paths to context? It's weird, I've gone through a bootcamp, but they couldn't cover everything so I have all these not core things I've yet to learn that are tripping me up.

wet kite
#

How to pass variable from jinja 2 to python?

meager anchor
#

can you explain your usecase

halcyon ridge
#

@deft lotus i suggest some changes , first you pass id into your html page and then get id in delete_view function and get this delete delete data by id ,
Try thid hope you delete item

deft lotus
#

@halcyon ridge ty for your answer, im new to django, how can i pass id through my html page ?

halcyon ridge
#

Can you get id like this , {{item.id}}

deft lotus
#

I can get this

print(DataItem.id)
<django.db.models.query_utils.DeferredAttribute object at 0x103cb7ef0>
halcyon ridge
#

@deft lotus DataItem.objects.get(id=id)

oak niche
#

could somebody check my html code? i cant figure out where there is that space you see in the picture

#

i want to get rid of that space basicly

#

im probably missing something but i cant figure out

halcyon ridge
#

@deft lotus also you pass id into your html page like this <form action="{% url 'cart:cart_add' product.id %}" method="post"> you can make your action like this

deft lotus
#

with exactly 'cart:card_add ?

#

never saw this ^^'

halcyon ridge
#

@deft lotus pass your app_name:url_name , send your urls.py file

deft lotus
#
from blog import views


urlpatterns = [
    path('', lambda request: redirect('blog/', permanent=False)),
    path('admin/', admin.site.urls),
    #path('accounts/', include('django.contrib.auth.urls')),
    path('blog/', TemplateView.as_view(template_name='home.html'), name='home'),
    path('blog/templates/mydatahistory', views.get_data_db, name='mydatahistory'),
    path('blog/templates/refreshquotes', views.refresh_quotes, name="datadbrefreshed"),
    path('blog/delete-row/', views.delete_row),
    path('blog/add-isin/', views.add_row),
    path('blog/add-place/', views.add_row),
]


if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) # for the static files
halcyon ridge
#

`from blog import views
app_name='blog'

urlpatterns = [
path('', lambda request: redirect('blog/', permanent=False)),
path('admin/', admin.site.urls),
#path('accounts/', include('django.contrib.auth.urls')),
path('blog/', TemplateView.as_view(template_name='home.html'), name='home'),
path('blog/templates/mydatahistory', views.get_data_db, name='mydatahistory'),
path('blog/templates/refreshquotes', views.refresh_quotes, name="datadbrefreshed"),
path('blog/delete-row/', views.delete_row,name='delete_blog' ),
path('blog/add-isin/', views.add_row),
path('blog/add-place/', views.add_row),
]

if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) # for the static files`
Change your urls.py like this

deft lotus
#

ok

halcyon ridge
#

@deft lotus then you make form action like this <form action="{% url 'blog:delete_blog' item.id %} ">

deft lotus
#

path('blog/delete-row/', views.delete_row,name=' 'delete_blog), or ' delete_blog ' ?

#

ah ok

halcyon ridge
#

@deft lotus yes

deft lotus
#

no method = post ?

halcyon ridge
#

add all remaning

deft lotus
halcyon ridge
#

@deft lotus i give solution for this

halcyon ridge
#

@oak niche change in p tag style like this <p style="margin: 0;padding: 0;background-color: rgb(25,25,25);margin-top: 6px;padding-left: 40px;color:white;font: 18px/1.5 'Ubuntu', Arial, sans-serif;">lesson name here</p>

oak niche
#

@halcyon ridge thank you so much! i actually asked this question on another server, and i tried to add margin-bottom:0 px and it worked. thank you again!

halcyon ridge
#

@oak niche ok welcome

hardy bridge
#

So I feel like I'm overthinking this and would like another opinion if someone out there is so inclined. I'm building a site with django (1.10) and trying to build a gallery app. I want the owner to be able to upload files only from the admin side to specific category folders, then I want those pictures displayed on the gallery template, split up by folder/category. I don't expect more than a few hundred pictures over time as it's intended to be a personal portfolio for an artist's page.

I have looked at prebuilt django apps like photologue, which is cool, but I think that is probably overkill considering the size of my project. If I think smaller, would that be as simple as using something like pathlib to pull the files and then adding the relative paths to context in my views? I've already got the model with an ImageField and i'm importing the model into the admin panel via admins.py. Any opinions are welcome and appreciated!

gleaming ice
#

how can i make ip lookup web application , I get all the ASN ip ranges, is it enough to build ip lookup application datasets

junior lintel
#

in a flask app, is there a better way to pass variables to an html file than piling them into the render_template('whatever.html', var1=1, var2=2) etc if you're using 20+ variables?

outer lynx
#
render_template('whatever.html', **context)```
#

also 20 variables sound a bit much, you probably can reduce it

junior lintel
#

not really, I'm printing sensor data and user-specified parameters

#

I'm just googling what you wrote, am I looking for flask context stacks?

outer lynx
#

not related to flask what I wrote

#
def view():
    context = {
        'var1': 1,
        'var2':2
    }
    return render_template(template, **context)
#

it is just regular python unpacking

junior lintel
#

so basically writing a dict and passing it to render_template

#

can that dict be in a separate file, to keep routes.py cleaner?

outer lynx
#

Do all views share some of these variables?

junior lintel
#

no, just the one. it's a password-protected control page

outer lynx
#

I see

#

I mean you can always put that dictionary anywhere if it doesn't require the query parameters from the url

#

but I'd try to put it in the view

#

unless they are some constants

junior lintel
#

nah, it's all either sensor data or user-generated limits

#

my next step is to act on sensor data exceeding limits - without getting into js, is using a db the best way to store 'heaterstatus=on' or a similar toggled flag?

outer lynx
#

i mean if you want to store something per user I'd imagine yeah

junior lintel
#

fair enough. thanks for your help!

outer lynx
#

Anytime

odd locust
#

hey, folks.

#

I'm a C++ dev, and am working on my heroku site. it's running python and i'm working on it locally. Going through the tutorials has me to this code snippet

#
def index(request):
    r = requests.get('http://httpbin.org/status/418')
    print(r.text)
    return HttpResponse('<pre>' + r.text + '</pre>')
#

obviously, this is the code that's executed when I visit localhost://5000 and the browser requests index.html

#

I have some HTML that I need to be added to this page and I'm not sure how to set up the HttpResponse

outer lynx
#

Seems like django

odd locust
#

ok lemme look

#

for this line:

return HttpResponse('<pre>' + r.text + '</pre>')

do I just put whatever html I want returned from the server in there?

#

as a concatenated string?

outer lynx
#

you wouldn't want to put your html as a string tho

#

That's why I showed render

#

but yeah response is basically that

odd locust
#

ok

#

hmm

#

this is so complicated lol

#

i know i know, i just haven't learned the API

native tide
#

What Python modules would be good for creating a web app that provides driving directions using Google/HERE apis

#

User goes to website. Types in Origin, Destination, and departure or arrival times. it will then provide a weather forecast along the route so you wont be hitting storms while driving

kindred cosmos
#

Would that be mostly frontend?

native tide
#

I think so. But I would like all requests to the APIs made by the server

#

so the auth key isn't exposed

#

Django seems to complicated for this task.

kindred cosmos
#

You thinking flask?

#

How many api routes are you going to have

native tide
#

What do you mean by API route? Sorry im relatively new. And I just need to send requests to a weather service and directions api

#

My idea was to combine that information using leaflet

kindred cosmos
#

like /maps/routes

native tide
#

/directions/

kindred cosmos
#

Here's a good example of what I am talking about

native tide
#

Honestly got no idea how many are needed. I am just trying to grasp the concepts of doing this

kindred cosmos
#

Most of it will base on the maps api you want to use

odd locust
#

is there a channel for finding a python dev for web backend?

coral sorrel
#

@odd locust that's more of a question for #community-meta which is for questions about the server
Answer is no though, we don't allow advertising or recruitment in the server at this point in time, sorry.

odd locust
#

ah. fiverr it is lol

outer lynx
#

i always say it is upsetting it these cases so that people who actually search for coders for hire can find me and pm me

#

but it never happens

#

how upsetting :(

coral sorrel
#

@outer lynx there are a ton of other places that allow you to post or find job postings, and this is the wrong channel to continue this discussion as was already mentioned above.

junior cloak
#

haha fiver. for a backend

brave otter
#

hi everyone - does anyone know if model methods automatically save in django models or do I have to manually call self.save()??

#

for example:

def subscribe(self):
        self.subscription_status = 'subscribed'
        self.save()

# versus:

def subscribe(self):
        self.subscription_status = 'subscribed'

#

I'm assuming I have to self.save() since when you override a save() method in a model you always have to still call super(MyModel, self).save()

brave otter
#

nevermind - I found it is required. thanks!

junior lintel
#

anyone know why /var/log/nginx/error.log would be "unwritable" according to nano and blank? raspbian stretch on a pi

#

nginx 1.10.3

native tide
#
def test_create_multiples_articles(self):
        url = reverse('article-list')
        
        created = datetime.now()
        published_date = datetime.now()
        expires = datetime.now()

        data = {
            'title': 'Titulo Teste',
            'subtitle':  'Subtitulo Teste',
            'created': created,
            'published_date': published_date,
            'expires': expires,
        }

        response = self.client.post(url, data, format='json')
        self.assertEqual(response.status_code, status.HTTP_201_CREATED)
        self.assertEqual(Article.objects.count(), 1)
        for key in data.keys():
            self.assertEqual(Article.objects.get().key, data[key])

#

Hey guys

#

any help?

#

the error is:

`
Traceback (most recent call last):
File "/www/fapitec/api/tests.py", line 85, in test_create_multiples_articles
self.assertEqual(Article.objects.get().key, data[key])
AttributeError: 'Article' object has no attribute 'key'

`

#

maybe a __getatribute__ ?

native tide
#

Well getatribute works

#

but now i'm with a date problem

quiet kite
#

Hello everyone

#

I'm stuck with Django + Tailwind + PostCSS. Any good working example ?

#

Webpack is very obscure to me

kindred ether
#

Hey

#

Anyone know a good wordpress plugin for accordion menus?

#

I am trying to get them to look good so I can fit command boxes into them

outer lynx
#

I think this is more of a python web dev channel

kindred ether
#

Ah

native tide
#

I was trying to build a Django server , and I recently came across attacks like xss , (tried to try my hand at some hacking challenges and failed miserably), so I was wondering if there was any system in Django to prevent it

#

So uhh

kindred cosmos
#

If you use django.forms yes

#

On a form object you have to validate it. (form.is_validI())

#

This will create a new attribute on the form called clean_data

#

This cleaned_data is santized

#

On top of that the django templating systems has features for preventing rendering raw string unless it

#

is marked safe

#

While this does guarantee protection from XSS it does help a lor

#

You would have to spefically prorgam to allow for an XSS

native tide
#

but if plan to pass it as a json, I won't have that advantage ehh ?

kindred cosmos
#

Pass what in as json?

native tide
#

Data from the server

#

Or data from the forms to the server

kindred cosmos
#

If you are using the django forms you should be good

native tide
#

Ok

#

But what I'm doing is making an android app

kindred cosmos
#

as long as is_valid is called and data from cleaned_data is used

#

Are you just using django as json rest api

#

?

native tide
#

Yess

kindred cosmos
#

None of this matters then

#

XSS can only happen if your server is rendering html

#

At least from django's eye

#

As long as your frontend is locked down you should have a problem

native tide
#

Ok

#

Thanks

kindred cosmos
#

No problem mang

native tide
#

(Well ,now to figure out those hacking challenges xD)

kindred cosmos
#

You doing a CTF?

native tide
#

Trying

#

Just started actually

#

I couldn't figure anything out

kindred cosmos
#

Best of luck to you

native tide
#

Thanks

cursive cairn
#

Quick question: looking to input data on one flask tab and process it on another

#

how would this be done?

knotty garnet
#

Hi,
I have some script used for text recognition in pictures.
I want to make some apis or web application, that used that script.
So I will upload a zip with images, but i dont want to store this images on server i only want to process them and return result in json.
Do you know how to do it? Maybe you know some free servers? I think about heroku, but they only offer 500mb storage, so I can upload only ~250mb zip file

north swift
#

Hello, I'm following a flask tutorial, I'd like to know what would be the correct approach to handle the database being off (project wont start if it isnt on), I'm using flask_sqlalchemy

native tide
odd locust
#

Can anyone point me in the direction for how to print out the returned data from an HTTP request?

patent cobalt
#

That depends on how you're making the request. Which module/package are you using?

odd locust
#

@patent cobalt i don't even know where to start

#

i want to see what gets returned from the server when i connect to my site

vagrant adder
#

@north swift what do you mean

#

try using postgres database somewhere from heroku, they give you free postgres db

odd locust
#

i don't know where to start for opening http connections on the web in python @patent cobalt

patent cobalt
#

You can use something like requests to make requests to your server and inspect what comes back

#

it's fairly easy to use, @odd locust

odd locust
#

kewl

#

i'm coming from C++ and JUCE has a pretty simple URL class that does this

patent cobalt
#

requests is really easy to use as well

#

I wrote a pretty simple thing to test our API endpoints

#
import json

import requests


auth_headers = {'Authorization': 'Token [removed]'}

site = "http://api.pythondiscord.local:8000/"
endpoint = "bot/nominations"
end = ""

r = requests.get(
    f"{site}{endpoint}{end}",
    data={'active': False},
    headers=auth_headers
)
print(f"Status code: {r.status_code}")
print(json.dumps(r.json(), indent=4))
#

This just uses the json module for pretty printing, but I could have used other options for that

odd locust
#

cool thanks

junior lintel
#

maybe a touch off-topic, but I want to run two nginx servers on two separate computers from behind a single router - how do I set up the right port forwarding for that?

old ether
#

(no flask experience)
i'm making an API with no frontend, I just need to know how to send data to a route and make that variable usable by a method in that route

junior lintel
#

@old ether what kind of data, and where is it coming from?

old ether
#

it's coming from a .net desktop application, it's a string @junior lintel

junior lintel
#

define the variable in the route def, and then include it in your render_template statement. i forget how to paste properly in here, I'll send you a message

velvet sluice
#

Hi, coming from a JS background and starting to dive into python for a role in backend. Iโ€™ve learned python basics and bought a Django udemy course, but Iโ€™m not sure what a good โ€œ0 to job ready pathโ€ is like in python.

For JS it seems a bit easier for specifically front-end.

north swift
#

@vagrant adder My app uses data stored in a mysql database, but I cant run the app if mysql is offline, my question is how can I get the app running even if that's the case

vagrant adder
#

Then first spin up your db, then your app

old ether
#

@velvet sluice i'm no experienced person in python, but in order to know how to do things you have to start somewhere, so make a small forum/blog type thing with user registration in order to get familiar with the structure of django, whenever I start using a framework/language, a user database is the first thing I do

outer lynx
#
function stream_write(elm, input) {
    for(let i=0; i<input.length; i++) {
        sleep(5000).then(()=> {
                elm.value += input.charAt(i);
                console.log(input.charAt(i));
            }
        )
    }
}```
#

It writes the whole thing in one go

#

Instead of sleeping between letters

#

send help

#
const sleep = (milliseconds) => {
    return new Promise(resolve => setTimeout(resolve, milliseconds))
};```
outer lynx
#

nvm

hybrid river
#

The CMD is set FLASK_APP=FILENAME then flask run --host=0.0.0.0 --port=1234

wet kite
#

How to deploy flask applications in heroku, or anyother free hosting site please

wicked kernel
#

Anyone have exp with flask/sse and session. I'm trying to send out a message via SSE to every client based on the permissions controlled and managed in flask_session

junior cloak
#

this is apropos of nothing, but in case anyone comes here and does what i did a few months ago and search for graphql hoping for something useful... after banging my head against a wall trying to get graphene to work correctly and in an otherwise fully async backend, I rewrote the entire thing in a few days using Ariadne: https://github.com/mirumee/ariadne

north swift
#

I'm using javascript to do a post to my flask app, is there any way to avoid the web client waiting for a response on a really long process?

timid arrow
#

does it need to know the response?

north swift
#

no

#

as long as its actually doing the post (which it is currently) I'm fine

wicked kernel
#

@north swift yes

north swift
#

yes?

wicked kernel
#

none of my calls waits

#

cuz i dont need the fuckin response

#

and i know it got there, cuz that's how TCP works

#

actually... now that i look at it

#

i might just be plain wrong

north swift
#

actually I just added a one sec timeout and looks like its working fine

wicked kernel
#

ok, good

#

you know flask? mind helping me with something?

north swift
#

know is a wide term considering I'm asking this kind of stuff

wicked kernel