#web-development

2 messages · Page 129 of 1

vestal hound
#

basically an edutech private tuition portal, but the relevant part here is the chat system

#

which loads images for portraits

#

therefore in the view where you see open chats, each person has a thumbnail portrait

tidal saddle
#

just limit uploads to like 2MB?

vestal hound
#

so, yeah, I was thinking 500 kb

#

but anyway the main thing is that there could be as many as 8 images of the small size on screen at once

tidal saddle
#

Mobile isn't a big deal if they are on wifi. But otherwise lighter is better yeah

vestal hound
#

therefore it makes sense to have a small version that they can load directly

true scroll
#

Dude do you have file limits?

tidal saddle
#

is there a use case for the large photos though?

wicked elbow
true scroll
#

How are you handling files larger than that? It seemed to accept one

vestal hound
#

elsewhere on the site the larger versions will be used

wicked elbow
vestal hound
#

so basically I need 3 versions

#

small/medium/large

#

large will be the one uploaded by the user and I'll be creating two smaller versions

wicked elbow
#

i have implemented drag and drop with preview

#

gm your worrying to much about size... size isnt that big of a deal anymore. 4g is as fast as most peoples home connections and 5g is faster then most peoples broadband

tidal saddle
#

If you're not prematurely optimizing are you really developing though? 😛

true scroll
#

The US isn't the whole world tho

wicked elbow
#

most phone images are about 7-8mb as it is

vestal hound
true scroll
#

and it can't hurt to have it run in less than ideal conditions

vestal hound
#

in particular, subway (I believe this is the equivalent US term) tunnels

true scroll
#

even if you're just going for US users

#

Places like Alaska, Montana, etc

vestal hound
#

and, yes, some countries are still on 3G

true scroll
#

Internet not so good

vestal hound
#

(or 2G? I'm not sure about this)

true scroll
#

Nah 2G is dead

tidal saddle
#

I mean you could cache them on the device somehow maybe?

wicked elbow
#

most likely they arent accessing your page over a phone network. trust me 95% of the web cant do anything that slow anymore

true scroll
#

Ok but serving less content puts less strain on the server too

#

How well would your server handle somebody automating spamming image posts? \

#

of 8mb

wicked elbow
#

the implementation of it puts just as much strain as managing which version is being shown. i dont think you understand how it works....

true scroll
#

uhhh

#

@wicked elbow

#
[{"id":28,"username":"BubbleTanks","fname":"Riley","lname":"Gillespie","dob":"1900-12-16","ipaddress":"REDACTED","devices":"","geolocation":"","followers":"","following":"","likes":"","created":"2021-01-20T00:33:02.209783Z","lastlogin":"2021-01-20T00:33:02.209819Z","groups":"","description":"bruh, really?","facebook":"None","instagram":"None","youtube":"None","tiktok":"None","reddit":"None","snapchat":"None","twitter":"None"}]
true scroll
#

this is not the kind of stuff that you should be giving back as JSON responses in plaintext

wicked elbow
#

cool its in developement. if you want to abuse a developement server ill block your ip

true scroll
#

I'm trying to help you

#

You said you have testers

#

This is something that anybody you're letting test could have access to, and they wouldn't tell you about it if they were going to scrape a bunch of stuff

wicked elbow
#

im not found in any search engine.... and i do have testers

true scroll
#

and changing IP is very trivial

wicked elbow
#

its not for anyones use other then theirs... to see if a foreign ip pinged their account

#

im guessing you pulled that from redux though. itll be turned off in production, but its a required resource to test the server

true scroll
#

ips aren't sensitive info

#

it's the other stuff that is a concern

#

This is just a standard JSON response to a GET request to the /api/accounts endpoint

#

I'm not even the one who sent out the request, it's something you defined as behaivor

wicked elbow
#

what is of concern? firstname lastname? can find that on their facebook? date of birth? can also proably find that on facebook

#

passwords and actual private info cant be accessed.

true scroll
#

devices, geolocation, first name, last name, DOB

#

Those are generally considered to be private by most people, in comination

wicked elbow
#

devices and geolacation arent implemented yet. but its not private info. dob is a requirement though, because im allowing nsfw content that i have to filter out. again developement. not blocking everything out yet on purpose... thats the point of developement.

#

as for how you got it im not sure honestly. ill look into because it should only show info of the account your logged into. ill fix it in a second

true scroll
#

Just open up your dev tools

wicked elbow
#

i was missing a tab, im getting ready to upload the new version anyways. wont show anyone else information now. but like i said your seeing stuff from redux dev tools being turned on

true scroll
#

Found it

#

When you go to somebody's profile page

#

you submbit a get request to the /api/profile/ endpoint

#

with their username as a parameter

#

this could of course be done anyway, but it's probably not a good idea to do this for a potential attacker

#

and it looks like my auth token is perfectly valid for that route for some reason

wicked elbow
#

it is for that route. but you are correct, i should move it to a seperate route that only pulls the info needed to fill that page. you gotta understand, ive programmed everything on the site myself. probably about 8000 lines of code or more done it in about a month. still a huge work in progress

true scroll
#

It's fine man, I'm not trying to pick on you

#

I was just helping you test, these are things that are good to discover now

wicked elbow
#

no i knew they were there though. its just a process to get everything going

true scroll
#

but this is publically accesible, this server alone has tens of thousands of people ]

#

I don't think it's farfetched that somebody could scrape servers like these for personal projects that are being showcased on web servers

#

and looking for vulnerabilities

#

maybe paranoid, but you don't gain anything by leaving the server in debug mode and posting it here.

wicked elbow
#

your probably right, but id say 99% of people arent looking that deep into it. and the js can always be viewed anyways. youd be suprised how much data you can pull off of major websites. its simply just required data. and its easier for me to debug to keep it up. that way i can see what someone is talking about

true scroll
#

I would at least slap a warning or a disclaimer up there

#

or let your testers know not to use real info if they're at all concerned

wicked elbow
#
if(!src.name) {
  console.log(src) // hits here
  form_data.append('upload_src', src)
} else {
  form_data.append('src', src, src.name);
}
``` why isnt this working. there is a field name with upload_src. its a `CharField(maxlength=100)` on a standard post. i dont get it.
#

the second works, but not the first one. it wont let me put anything in upload_src

true scroll
#

is form_data a list?

#

I didn't think that append would accept more than one parameter

#

oh sorry lol

#

that's JS, not Python

#

I need to go eat

wicked elbow
#

formdata is formdata. you either pass info as application/json or as multipart/form-data

#

normally you pass as json, but when uploading images you have to pass the image blob as form-data

#

i fixed it. it was a backend issue

zinc geyser
#

would you know how to mock a jwt token for a flask route?

near bison
#
[
    {
        "id": 16,
        "product": 1,
        "quantity": 234
    },
    {
        "id": 17,
        "product": 1,
        "quantity": 235
    },
    {
        "id": 18,
        "product": 4,
        "quantity": 32
    },
    {
        "id": 19,
        "product": 1,
        "quantity": 2000
    }
]

This is the response i get currently from djagno rest framework powered api end point , i wanna change this so that product field which currently has the id of the product should be replaced with the name of the product, i am using DRF generic view

tribal python
#

So I'll post the HTML and CSS in a moment afterwards here

#

I am so very close to having this UI how I want it

#

the goal is the post there to be centered underneath the header text

#

I've been sitting for quite a while trying to figure out what to change to fix it up, but I'm virtually incapable of understanding CSS

#

Specifically, this started happening as I added the max-width: 720px; to the .post class

#

SOLVED: margin: 0 auto;

#

sigh

broken fjord
#

Can I get here any help about php ?

native tide
#

Hello everyone I am writing a project on django(3.0.11)+django cms(3.7.4). I created several applications, and when I try to link the application to a page created via django cms, these applications are not displayed. Has anyone encountered such a problem?

scenic galleon
native tide
#
{'fruit': 'apple'}
#

how would i get the value of fruit?

quick cargo
#

foo['fruit']

vestal hound
remote maple
#

anyone here know flask?

scenic galleon
native tide
#

just ask the question

#

how can you return datetime in json format from sqlalchemy?

coral raven
#

@scenic galleon you want to share the flask app via ngrok?

foggy bramble
#

Hello everyone i feel like I've got difficulties with retrieving, many to many objects... Can anyone share some resources that i can read to understand exact logic..? I've tried official doc but it didn't go well i think... Please reply to this message or tag me in case you have resources to share... Thanx

native tide
#

Hello. I just started making a website and could use a decent bit of help with one section I'm trying to implement. If anyone would be able to help me it would be more than appreciated.

scenic galleon
coral raven
#

Is it a flask app?

#

@scenic galleon

#

Do you run it on localhost?

scenic galleon
#

i need to setup flask i have imported it after pip install

scenic galleon
#

is it possible to display the console window in flask?

coral raven
#

Nope, not directly

scenic galleon
#

okk

#

i will send u a screenshot so u can get what i am coming to say

#

just a min make command is running it takes 2-3 min

coral raven
#

Okay

scenic galleon
#

i need to display that output in a flask webapp

coral raven
#

Copy the code into a .py file

scenic galleon
#

okk

coral raven
#

And then run locally

#

You can delete the photo

scenic galleon
#

i cant run it locally

#

it needs gpu

#

my laptop is not so gpu powerfull

lavish prismBOT
#

Hey @scenic galleon!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

coral raven
#

!paste

lavish prismBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

scenic galleon
#

here is the code

#

and things need to be changed to run locally

coral raven
#

Yes a lot needs to be changed

scenic galleon
#

and i am planning on running the colab in raspberry pi so i dont think i will ever go for local method

#

i tried flask with just a html <h1>hello</h1> and it worked but i dont know how to return the output

coral raven
#

If you run it locally on your machine, with ngrok your machine will act as a server and you can access the page on the internet

scenic galleon
#

but accessing the page is not a problem i ran flask with hello text in colab it worked!

#

but i dont know how to return the camera stream in flask

coral raven
#

How does colab do it

scenic galleon
#

i will send u a code snippet

#

`from flask_ngrok import run_with_ngrok
from flask import Flask

app = Flask(name)
run_with_ngrok(app)

@app.route("/")
def home():
return "<h1>hello</h1>"

app.run() `

#

this worked in colab

coral raven
#

Yeah

scenic galleon
#

but how do i return the video instead of hello

coral raven
#

Call the function that is responsible to stream the video inside the route

scenic galleon
#

i am new to flask i just learnt about it
this is the function name video_stream()

#

can u modify that flask code?

#

😶

scenic galleon
#

oo it does not return something it actually javascript so how do give it in flask

shrewd horizon
#

I am trying to learn Flask. I am new to python too. Could anyone tell me how can I learn flask?

native tide
#

guys im trying to make a porn site i need a way to check images

#

like face recog

#

but for tits'

near bison
#

I have a javascript file in django static directory. I want it to be minified when the env variable debug=false, how can i achieve this ?

misty sigil
#

wtf is this chat

lyric jacinth
scenic galleon
#

i tried but i get that file is not found

lyric jacinth
#

put the file in the same folder containing your code
that way you don't have to specify the path

#

I'm talking about html code

scenic galleon
#

since i am in colab i draged and dropped in the root folder

#

just a min i will create a new colab notebook with a simple hello world html code and try

lyric jacinth
#

try with a simple image first

scenic galleon
#

okk

#

done that still same error

#

code
`!pip install flask_ngrok
from flask_ngrok import run_with_ngrok
from flask import Flask, render_template

app = Flask(name)
run_with_ngrok(app)

@app.route("/")
def home():
return render_template('test.html')

app.run() `

#

wait it worked when i putted the file inside a folder called templates

#

Thank you for the help now i will try with my original code

#

ok now there is a another problem it cant detect the javascript file for no reason

#

i tried putting it in multiple directories but it says in the website console that 404 file not found displayVideo.js

#

but i have another problem

#

if anyone could help me in this flask ping me thank you!

#

btw i dont get it if i do like this it will show the once camera they use but i want to display the cam of the colab comp when i am connected to everyone

sage escarp
late fjord
#

Hi everyone

#

Can you please tell me about the best way to learn django

#

I mean how much time does it take to master it

#

what are the most important things that I have to know and learn

#

cuz I have been learning it and I'm not doing great with it

#

a good free course is great

silent owl
#

@late fjord I found brad traversys videos on django and django/react to be pretty good

#

they're free on youtube

late fjord
#

I will check them and tell you thank you

#

@silent owl

meager shore
#

"If the product is part of an order that has not yet been paid and / or shipped, the product will not be removed and the Administrator will see an error message"

What should the code be to apply this? i did remove it .. but it removes everything regardless

late fjord
silent owl
#

yeah that's the one I started with

#

I did his django/react course after that

late fjord
#

did you know react before django

silent owl
#

a little bit

late fjord
#

and is this course full because I think it is really short

silent owl
#

yeah I think so, I thought it was a series sorry.

#

the full stack react/django is more indepth but if you haven't really used react much before that I probably wouldn't recommend diving into that yet

late fjord
#

the react course I guess includes django's api framework and react

silent owl
#

yeah redux too

late fjord
#

redux is for design

#

???

silent owl
#

its for creating a global state system for using throughout your frontend application

late fjord
#

thanks

#

if you want to rate yourself what do you choose

#

pro or intermediate I mean in django

silent owl
#

junior

late fjord
#

that's not in the list I guess hhhh

silent owl
#

haha

late fjord
#

do you have a job

#

django job

silent owl
#

yeah i work at an agency, not with django though

late fjord
#

you haven't made a penny from django

silent owl
#

no i'm learning it so I can transition from web developer to full stack software developer hopefully

late fjord
#

you work with css stuffs

#

and js

meager shore
#

Delete function
pick up orders on the basis of the product id, then you check for shipped / paid for all orders

silent owl
#

ya

late fjord
#

thank you for all this information

#

can I ask a question sort of private how old are you

#

plz tell me that the profile picture is not yours

#

I mean that's not you

verbal obsidian
#

that's danny devito

kindred osprey
#

Hello, I am currently working on encryption in my flutter app wherein I am using RSA key-pair generator to get public and private key using the following code-

import 'package:rsa_encrypt/rsa_encrypt.dart';
import 'package:pointycastle/api.dart' as crypto;

//Future to hold our KeyPair
Future<crypto.AsymmetricKeyPair> futureKeyPair;

//to store the KeyPair once we get data from our future
crypto.AsymmetricKeyPair keyPair;

Future<crypto.AsymmetricKeyPair<crypto.PublicKey, crypto.PrivateKey>> getKeyPair()
{
var helper = RsaKeyHelper();
return helper.computeRSAKeyPair(helper.getSecureRandom());
}


Now I want to get the keyPair.publicKey in string format but if i print keyPair.publicKey, it shows "Instance of RSA publicKey" . How can I get it in string format??

uncut spire
#

how do people generally consume secrets from AWS secrets manager in flask? I'm flask apps into EKS that have instance configs, but as those get gitignored is there something people generally do in that case? what comes to mind is having an environment variable specifying "ENVTYPE=development || prod" and using boto in the prod case but is that in the zone of acceptable?\

elder moat
#

Is there a good way to integrate celery with flask? My celery worker literally crashes all the time and on top of that requires extra setup to even run in a dev environment (eg. I have to open another terminal window/etc) and it's really annoying. It's also pretty glitchy in general imo and I was thinking I could just ditch celery in favour of regular threading

iron beacon
#

I have a Django models question on #help-chocolate. I don't properly understand derived attributes in Django (and why there's no standard implementation for that). Can anyone help me pls?

#

or any feedback on how to improve the question

dim wyvern
#

how would you go about making something like this into a selectable list?

#

currently using flask. Tried some stuff w/ SelectField and FileInput widget but can't figure it out

#

even tried some html <select></select> fields

mint tangle
#

does anyone know how to have flask accept post requests that turn the parameter into an image?

#

like my client is sending a base 64 encoded image and i want to do some processing on that

haughty turtle
#

Eh whos familiar with uwsgi?

haughty turtle
#

Nvm got it to work

native tide
#

@dim wyvern you can add background image to the select option in its style

maiden kraken
#

Hello, is it possible in django to call a view function with parameter from template?

onyx flume
#

hey

#

i cannot post anything to my API and i recieve "responded with a status of 415 (Unsupported Media Type)"

#

views
`from .serializers import ShitSerializer
from rest_framework import generics
from .models import shit

class ShitCreator(generics.ListCreateAPIView):
queryset = shit.objects.all()
serializer_class = ShitSerializer`

#

serializers:
`from rest_framework import serializers
from .models import shit

class ShitSerializer(serializers.ModelSerializer):
class Meta:
model = shit
fields = 'all'`

#

settings:

INSTALLED_APPS = [
'corsheaders',
'rest_framework'
]

MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',

]
CORS_ORIGIN_ALLOW_ALL = True

frigid orchid
#

hello everyone im basically wondering if it is possible to make a simple ui in python that i can host on my webserver

#

Then when i enter certain parameters it runs my python

sage escarp
#

does anyone know a site/tool that i can use to generate some nice looking webpages all i need is a few buttons a place where i can display some text and a submit box nothing else.i want them to look nicer than what i can do with html

native tide
#

@sage escarp if you actually want to code it yourself, you can use bootstrap. Otherwise theres plenty of drag n drop software out there

#

@onyx flume can you print your request

#

Its unsupported media type

#

So you're probably sending something other than JSON

sage escarp
#

this is my lame attempt just so you have a reference of what i am trying to achieve

native tide
#

I dont use drag & drop, so I wouldn't know. I would recommend coding it though - it will help you improve how you design your websites (and that something that has to be learnt, it doesn't come naturally for most).

#

And in that case, I'd simply say use bootstrap.

#

You keep all your html, and just change the styles of your elements.

sage escarp
#

yeah but i have a hard time putting stuff in the right places

#

i want stuff to be centered and it gets placed in weird places

native tide
#

Bootstrap will solve that for you ;)

sage escarp
#

i don't like writing html at all

#

ok i will give bootstrap a try thank you very much

native tide
#

You can have rows, columns, centred elements, and premade styles for your elements.

sage escarp
#

i was planning on making some things wirelessly controlled around the house with a raspberry and i want to make a website so i can have controll from everywhere and the hardest part for me is the site part since i have not worked with websites in my life and i can't find resource to the stuff i need

#

it took me a few hours to figure out how to make that button trigger a python script

#

=))))

scenic galleon
#

do u need to control with mobile or from any devise

sage escarp
#

no i will just use my ip address in browser and there will be a password prompt

#

i plan to use it from mobile and pcs

scenic galleon
#

okk

#

if u need mobile only u can go for blynk app to control u can trigger a python code with it

#

do u need it in local host or public?

sage escarp
#

public

#

but django already handles that for me

glossy girder
#

hey guys

sage escarp
#

btw my button tries to access a link and in the views in django i just run my script from there and refresh the page dk if that is the way to do what i tried

glossy girder
#

Do you guys know how i can serve multiple files with flask? mainly .jpg and .pngs

#

I know it may sound like a silly question, but all the information online is quite complicated and not very well explained, so i come here

buoyant shuttle
#

hello guys, anyone has expereince integrating react with django, with babel and webpack etc

tender seal
#

how to make a pop up block when a image is clciked using html, css and js?

buoyant shuttle
regal isle
#

Hey all

#

I'm making webapps in Pycharm Community, but the js support just isn't great. Would anyone be able to recommend some options, or share how they do webdev where they might need to work on both the back-end/API and client side code in react for example?

dapper tusk
#

I just used VSCode for that

regal isle
#

I've only ever used VSCode for purely client side builds, gulp, npm, all that worked like a charm.

#

How's VSCode with multiple languages?

dapper tusk
#

it works quite well

regal isle
#

I'll give it a shot. It looks like if I want to continue using PyCharm for whatever reason and support js well + css highlighting, I'd have to buy Pro, which is fine too.

regal isle
#

Thanks @dapper tusk

native tide
meager shore
#

validate category

    categoryRegex = re.match('([a-zA-Z]{3})',category)
    if categoryRegex is None:
        return {"message": "Invalid category"}, 401 

Why if I test this it doesnt work

#
  1. The category name contains at least 3 characters
  2. If the category name does not meet the validation rules, an error message is displayed
onyx flume
late fjord
#

I am asking if it is important to learn django's template system if I am going to learn rest framework anyway

dapper obsidian
#

Hello, I use pycharm, I try to import pillow and it doesn’t work, I already downloaded pillow it said “Already downloaded pillow”, and when I try to import it, it says “pillow module not found”

quick cargo
#

it's module name is pil

dapper obsidian
#

oh

quick cargo
#

as pillow is a fork of PIL

dapper obsidian
#

I will try that

quick cargo
#

well

#

PIL in caps to be specific

late fjord
#

@quick cargo can you answer my question please

quick cargo
#

If you're making purely a rest API using on JSON then not really

#

the template system isnt exactly hard though

late fjord
#

I know but I didn't want to waste my time on it

#

cuz since I am not going to use it that means I will forget it

#

I am in the process of learning django

#

thank you for saving me time I am skipping it

#

I have another question

#

Can I also skip static files because I think that is included in frontend

#

sorry for the mention @quick cargo

dapper obsidian
#

I did “pip install pil” and “pip install PIL”
It said
“ERROR: Could not find a version that satisfies the requirement pil
ERROR: No matching distribution found for pil”

#

@quick cargo

#

I tried both PIL and pil

late fjord
#

I guess you should import by saying PIL

dapper obsidian
#

I did it

#

I said I did both

late fjord
#

you said you did pip install

#

and that's not what he or she meant

#

Because you said it is already downloaded

dapper obsidian
#

It says “pillow module not found”

#

I tried to import

late fjord
#

I will try to download and tell you

dapper obsidian
#

I downloaded it

#

I did “import pillow” and not “import PIL”

#

I thought they meant to download as PIL

late fjord
#

I did import PIL and it worked

dapper obsidian
#

@quick cargo thanks it worked

late fjord
#

can I ask you something

#

do I have to learn static files

#

since I am going to use rest framework

paper void
#

Can anyone explain me how to force flask in heroku to use https always instead of http?

late fjord
#

I guess we can manage static files in frontend

#

@dapper obsidian

native tide
#
@app.route('/api/GetData',methods=['GET','POST'])
def getData():
    if request.method == "POST":
        data = request.json
        print(data)
        return render_template('index.html')

TypeError: The view function did not return a valid response. The function either returned None or ended without a return statement.

#

it used to work a few days ago and now it doesnt...?

chilly hill
#

just add else branch

native tide
#

ight thx

true scroll
native tide
#

Instead of render_template @true scroll ?

true scroll
#

No, you would still use render template

#

but you would

return render_template(url_for('function_name'))
#

instead of the .index.html

#

whatever function you defined in the function that you decorated with @app.route('/index')

native tide
#

What would be the difference?

true scroll
#

Right now? probably nothing but if you're building an API you can append queries to a GET request URL, you could use it to more easily build jinja templates, you can specify variables as arguments in cases where you might not know the route of the URL you need a template for until runtime (e.g. url_for('posts', post_id=post.id))

#

Really there's very little reason not to, there's no overhead really and it comes with Flask

true scroll
#

@native tide I'm sorry I wasn't reading / thinking properly earlier

naive crater
#

if someone could help me in #help-kiwi that'd be great 😄

meager shore
#

hii people,

At this moment I am busy with a webshop made with python flask and I wanna do this;
"If the product is part of an order that has not yet been paid and / or shipped, the product will not be removed and the Administrator will see an error message."
The code you see here .. is that right good? because it don't works..

true scroll
#

You have to be more specific than that

#

What exactly doesn't work

glass orchid
#

Hello everybody it's my first time on discord 😉

#

i'm not sure but i think the chanel is empty ?

#

I face at an issue with Django, in fact i've 2 model class and one is a foreignkey for the other but in a form to add a element in database the foreignkey display a database object instead of the return of the modelclass return

#

sorry for my english i hope you can understand me 😉

#

if i try to explain with more detail i've a model WeekDay so inside only 7 line with ID, Name, Number, DateTimeUpdate

#

and each line is a day of the week Monday, Saturday etc ...

#

i've a another model it's for the schedule, one line is for one event with Activitie (is an other model for detail of activitie) and Start Day and End Day.

#

In a form for add a schedule line everything is ok for choose an activitie (activitie_name are display in the combo box) but for Start_day and End_Day is not working instead of display Monday, Tuesday, etc ... it's display in the combo box WeekDay Object (1) for monday for example or WeekDay (5) for Friday etc

#

I don't understand

#

I find my mistake (several days i face to this issue)... i'm a bullshit man sometimes it was my function for return WeekDay.Name i had write __ srt__ instead of str

tight grotto
#

@glass orchid next time try pasting code here

oblique kite
#

I have a question on DRF serializers
So the question is
I want to display limited fields of a manytomany field class.
Attached is the tried and tested solution but somewhere I feel like there might be a better solution.

meager shore
elfin bluff
#

Anyone who can help in setting up google auth with django web app ?

left jackal
#

Hello, I have got problem with CORB when developing web scraping app (selenium)
and I have no idea how to fix it.
basicly web starts to ignore all my commands at one point.

naive glen
#

Is anyone tell me what should I do in this or what this statement says -

{The links in the

FAQ section (questions in drop down) on this page are hard-coded (static). Make them dynamic to be configured from the location object.}

native tide
#

I am wondering how to make the input come from a csv for text file. And maybe even delete after use.
Like a line of names or phone numbers on a text file and the input goes down the list one by one every time it runs.

tacit anvil
#

Hey so im trying to make a sticky nav bar with some code i found online but they used plain html css and js but im using react and when ever i try to run the website i get this error. this is my code ```js
import React from "react"
import {Link} from "react-router-dom"
import './App.css';

export default function App (){
const navStyle = {
color: "white"
};
// When the user scrolls the page, execute myFunction
window.onscroll = function() {myFunction()};

// Get the navbar
var nav = document.getElementsByClassName("nav");

// Get the offset position of the navbar
var sticky = nav.offsetTop;

// Add the sticky class to the navbar when you reach its scroll position. Remove "sticky" when you leave the scroll position
function myFunction() {
if (window.pageYOffset >= sticky) {
nav.classList.add("sticky")
} else {
nav.classList.remove("sticky");
}
}

return (
<div className="App-header">
<nav className="nav">
<h3>Logo</h3>
<ul>
<Link style={navStyle} to="/">
<li>Home</li>
</Link>
<Link style={navStyle} to="LogIn">
<li>Log In</li>
</Link>
</ul>
</nav>
</div>
)
}

opaque ice
#

@tacit anvil so react is trying to call the remove() methood of nav.classList, however it is undefined.

#

The code you're writing above the return statement executes before your html elements are returned and rendered

#

so document.getElementsByClassName("nav") probably doesn't exist at the point you are trying to assign it to the nav variable

#

That's my uneducated guess

tacit anvil
#

so should i put the code below the return statement?

opaque ice
#

No, no code can be below the return statement

tacit anvil
#

oh ok

opaque ice
#

Once return executes, you leave the entire App functional component

tacit anvil
#

when i run the webiste

#

it works fine

#

but when i scroll is when i get the error

opaque ice
#

Yes. When you go to the website it works but it assigns undefined to nav (that itself doesnt crash). But when you scroll you try to use the remove() method of nav which is undefined and undefined does not have a remove method

tacit anvil
#

so then what should i do?

opaque ice
#

you can try adding console.log(nav); after nav = document..blabla to confirm this

tacit anvil
#

ok

#

i get this

#

so it is defined\

opaque ice
#

ok, then add it just before classList.remove() as well to see what you have there

#

oh now I probably see it

tacit anvil
#

i did cosole.log(sticky) and that returns undefined

opaque ice
#

nav and sticky are probably undefined in your function, because they are not in the same scope

tacit anvil
#

nav is still defined befire class.list.remove()

opaque ice
#

what about nav.classList

tacit anvil
#

thats undefined

#

i run the code in a seprate html file and it ran fine

#

only when i tried to put it in react is when i get errors

opaque ice
#

document.getElementsByClassName("nav");

#

this should be the error

#

this returns a list of elements

#

so you're probably having a list of 1 elements

untold flare
#

Hey guys, I have to switch my fastapi app over to flask, which I've never used before, I was wondering what the recommended way to use flask over multiple files is? Should I use blueprints?

opaque ice
#

you want to do classList on the element, not the list itself

tacit anvil
#

when i tried to do getelement by id

#

i got that it was undefined

#

i think im using the wrong thing

opaque ice
#

Did you assign an id to the nav element?

tacit anvil
#

i set a classname

#

not an id

opaque ice
#

It needs an id if you're going to get element by id

tacit anvil
#

ok

#

i knew i didnt have an id

tacit anvil
#

so i changed it to document.getElementsByClassName("nav");

#

but that doesnt work

opaque ice
#

You should use id for something that is unique (you will probably only have one nav bar)

tacit anvil
#

ok

opaque ice
#

did you add the id to nav?

tacit anvil
#

yes

opaque ice
#

Let's see the code again

tacit anvil
#
import React from "react"
import {Link} from "react-router-dom"
import './App.css';


export default function App (){
  const navStyle = {
     color: "white"
  };
    // When the user scrolls the page, execute myFunction
  window.onscroll = function() {myFunction()};

  // Get the navbar
  var nav = document.getElementById("nav");
  console.log(nav)

  // Get the offset position of the navbar
  var sticky = nav.offsetTop;


  // Add the sticky class to the navbar when you reach its scroll position. Remove "sticky" when you leave the scroll position
  function myFunction() {
    if (window.pageYOffset >= sticky) {
      nav.classList.add("sticky")
    } else {

      nav.classList.remove("sticky");
    }
  }


  return (
    <div className="App-header">
      <nav className="nav" id="nav">
        <h3>Logo</h3>
        <ul>
          <Link style={navStyle} to="/">
              <li>Home</li>
          </Link>
          <Link style={navStyle} to="LogIn">
            <li>Log In</li>
          </Link>
      </ul>
      </nav>
    </div>
  )
  
}

#

it says that nav is undefined

#

well

#

null

opaque ice
#

Not really sure

#

But I believe you should look into using states

#

Try moving nav and sticky into your function

#

You don't really need them in the outer scope right?

tacit anvil
#

ok

opaque ice
solar zinc
#

Hi, i'm currently coding a web application with django 3.0 and trying to override some functions of an installed django apps (Python social auth module). I want to do it because i want to change the default behavior.

I have found some method to perform overriding of a module (monkey patching) and try to implement it but i the following errors when i try to implement it :

  File "/Users/***********/code/recrutlocataire/recrutlocataire/core/__init__.py", line 1, in <module>
    import core.monkey
  File "/Users/***********/code/recrutlocataire/recrutlocataire/core/monkey.py", line 6, in <module>
    from django.contrib.sessions.models import Session
  File "/usr/local/lib/python3.8/site-packages/django/contrib/sessions/models.py", line 1, in <module>
    from django.contrib.sessions.base_session import (
  File "/usr/local/lib/python3.8/site-packages/django/contrib/sessions/base_session.py", line 26, in <module>
    class AbstractBaseSession(models.Model):
  File "/usr/local/lib/python3.8/site-packages/django/db/models/base.py", line 107, in __new__
    app_config = apps.get_containing_app_config(module)
  File "/usr/local/lib/python3.8/site-packages/django/apps/registry.py", line 252, in get_containing_app_config
    self.check_apps_ready()
  File "/usr/local/lib/python3.8/site-packages/django/apps/registry.py", line 135, in check_apps_ready
    raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

Create my patch in the monkey.py file in my application directory:

Import the monkey file in the init file located in my application directory

It seems that I have this error because I'm trying to import the session module whereas the application loading is not done but i cannot find a proper way to do it.

Could someone tell me how can I perform it please ?

toxic flame
#

Let's see your code

solar zinc
#

@toxic flame

Here is my core/monkey.py

from social_core import utils
from social_core.exceptions import InvalidEmail
from django.core import signing
from django.core.signing import BadSignature
from django.contrib.sessions.models import Session
from django.conf import settings

def partial_pipeline_data(backend, user=None, *args, **kwargs):
  pass

Here is my core/init.py

import core.monkey
naive glen
#

Is anyone tell me what should I do in this or what this statement says -

{The links in the

FAQ section (questions in drop down) on this page are hard-coded (static). Make them dynamic to be configured from the location object.}

toxic flame
#

Did u add it to your installed Apps?

solar zinc
#

@toxic flame I just did and i got the same result

toxic flame
#

'core' right?

solar zinc
#

core is my main application

#

monkeys is my file which contains my "patch"

grizzled sand
#

Hey everyone, just noticed mozilla isn't supported backdrop-filter: blur with css
Do we have any way implement it?

indigo kettle
#

can you use this?

#

filter: blur(5px)

rich bridge
#

hello need css related help!

rich bridge
#

hello i have a query,
actually im working on framework7, my questiong is im using css but it isnt reflecting unless i add !important keyword after style
as you can see in it, in mytable class, i have added margin but its nit reflecting but not the same with border

wheat olive
#

Typically the method is not added by default. You’ll need to add to the apps.py file in the required app and then modify settings.INSTALLED_APPS to include AppConfig from your app instead of app name

umbral pivot
#

Hi, i have this flask code. ```py

Keep Repl Alive by creating a webserver for uptimerobot to ping every 5 minutes

from flask import Flask, request
from multiprocessing import Process

app = Flask(name)

html = """
<html>
<p>
message id
</p>
<textarea id = "message_id"></textarea>
<p>
message content
</p>
<textarea id = "message_content"></textarea>
</br></br>
<button id = "submit" onclick=submit()>
submit
</button>

<script>
function submit() {
fetch(
'https://The-Info-Broker.zorycroft.repl.co',
{
method: 'post',
headers: {
'Accept': 'application/json. text/plain. /',
'Content-Type': 'application/json'
},
body: JSON.stringify(
[
document.getElementById("message_id").innerHTML,
document.getElementById("message_content").innerHTML
]
)
}
)
}
</script>
</html>
"""

@app.route('/', methods=["GET","POST"])
def index():
if request.method == "POST":
print(request.get_json())
return html
``` im trying to get the contents of the two text areas in my webpage, so im setting the body of my post request to be [document.getElemebtById("message_id").innerHTML, document.getElemebtById("message_content").innerHTML] but i just get ['', ''] back no matter what i type into the textareas?

#

nvm i got it

cinder whale
#

anyone use streamlight? seems really easy and intuitive. thinking about doing a few ML projects using it

#

thoughts/opinions?

twilit needle
#

can someone please guide me achieve this?

twilit needle
#

I want to setup an events system with django-channels
like discord
whenever an object is created to the database, I want to send an event
to the client

import json
from channels.generic.websocket import AsyncWebsocketConsumer


class BoxEventsConsumer(AsyncWebsocketConsumer):
    def __init__(self):
        super(BoxEventsConsumer, self).__init__()

    async def connect(self):
        # add the channel_layer to the requested box's group.
        # group names are unique as they include the box-id
        self.box_id = self.scope['url_route']['kwargs']['box_id']
        self.box_group_name = 'ws_box_%s' % self.box_id
        await self.channel_layer.group_add(self.box_group_name, self.channel_name)
        await self.accept()

    async def disconnect(self, close_code):
        await self.channel_layer.group_discard(self.box_group_name, self.channel_name)

    async def receive(self, text_data=None, bytes_data=None):
        # send event data to every channel_layer
        # that is a part of the box's group. global events
        # such as box-creation must be sent to every user
        json_data = json.loads(text_data)
        formatted = {'data': json_data['data'], 'event': json_data['event']}
        await self.channel_layer.group_send(self.box_group_name, formatted)

    async def fire_event(self, event, data):
        # we send events to the box-groups from the
        # server. (data-binding is always outbound) so we don't need
        # to bother to receive data from clients
        await self.send(text_data=json.dumps({'data': data, 'event': event}))

I wrote this consumer so far
now, I need to overwrite a model's save method and then use the fire_event method of the consumer to send data right?

naive glen
#

How I do drop down section which is hard-coded static into dynamic in python

near bison
#

Are you using a framework ?

naive glen
#

@near bison which framework do i use for this?

near bison
#

I don't actually fully understand your query

naive glen
near bison
#

I have a javascript file in django static directory. I want it to be minified when the env variable debug=false, how can i achieve this ?

oblique kite
#

How to create pagination for multiple serializers in single API in Django Rest Framework?

night hawk
#

i m new in java

#

can anyone teach me

native tide
native tide
#

java is not even web-development Thonk

native tide
#

Some people think java and JavaScript are the same thing

patent ingot
#

Hello I have a django question, why is this code producing users_status_rocketchat() takes 0 positional arguments but 1 was given?

views.py

def users_status_rocketchat():
    api_url = ROCKETCHAT_DOCKER + "/api/v1/users.presence"

    # Login admin
    login_response = login_rocketchat(os.environ["ROCKETCHAT_ADMIN_USERNAME"], os.environ["ROCKETCHAT_ADMIN_PASSWORD"])
    admin_id = login_response["data"]["userId"]
    admin_token = login_response["data"]["authToken"]

    # Set headers
    headers = {
        "X-Auth-Token": admin_token,
        "X-User-Id": admin_id,
        "Content-type": "application/json"
    }


    api_response = requests.get(api_url, headers=headers).json()

    # Logout admin
    logout_rocketchat(admin_token, admin_id)

    return api_response

urls.py

from django.urls import path
from django_rocketchat import views as django_rocketchat_views

urlpatterns = [

    path('api/rocketchat/users/', django_rocketchat_views.users_status_rocketchat, name='users_status_rocketchat'),

]
native tide
#

Hey all! I’m brand new to Python and was wondering if I learn this language is it possible to use it for Web Development?

patent ingot
#

yes

native tide
patent ingot
#

well this was easy, but my problem is not quite? Maybe I should add decorators for GET and POST requests?

native tide
bright sinew
#

Hi everyone, I was wondering if anyone has tried using the pandas HTML table and run into an issue with the styler?

#

It seems like it puts all the cell id's on a single row, which breaks on Chrome when exceeding 4096 cells

uncut spade
#

Hi, I'm trying to implement a new LoginForm in Django. Her's what I'm trying to do. The code does work, but when I redirect to 'Profile' in which I made a markup <h1>{{Log.username}}</h1>, it doesn't show me user's name . Could someone explain me why ? Thanks !

#
from .forms import UserRegisterForm, UserLoginFoo
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required


def register(request):
    if request.method=='POST':
        form= UserRegisterForm(request.POST)
        if form.is_valid():
            form.save()
            return redirect("PagePrincipale")
    else:
        form=UserRegisterForm()
    return render(request,'Utilisateurs/Inscription.html',{'Usr':form})


def Loginin(request):
    if request.method=='POST':
        Log= UserLoginFoo(request.POST)
        if Log.is_valid():
            return redirect('MonProfile')
    else:
        Log= UserLoginFoo()
    return render(request,'Utilisateurs/Connexion.html',{'form':Log})


def Profile(request):
    return render(request,'Utilisateurs/Profile.html')```
#
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import authenticate


class UserRegisterForm(UserCreationForm):

    class Meta:
        model=User
        fields=['username','password1','password2']


class UserLoginFoo(forms.Form):
    username = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control','placeholder':'Username'}))
    password = forms.CharField(widget=forms.PasswordInput(attrs={'class':'form-control','placeholder':'Password'}))
    yourfield = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control','placeholder':'yourfield'}))
    def clean(self, *args, **kwargs):
        username = self.cleaned_data.get("username")
        password = self.cleaned_data.get("password")

        #user_qs = User.objects.filter(username=username)
        #if user_qs.count() == 1:
        #   user = user_qs.first()
        if username and password:
            user = authenticate(username=username, password=password)
            if not user:
                raise forms.ValidationError("This user does not exist")
            if not user.check_password(password):
                raise forms.ValidationError("Incorrect password")
            if not user.is_active:
                raise forms.ValidationError("This user is no longer active")
            return super(UserLoginFoo, self).clean(*args, **kwargs)

dire fractal
#

I believe you need to provide Log in the context

uncut spade
#

Yeah but I redirect to 'MonProfile' So i can't give an extra arg

dire fractal
#

You can redirect with arguments?

patent ingot
#

@dire fractal did you saw my question? I am only a beginner to this kind of level 🙂

uncut spade
#

No I can't redirect with arguments

dire fractal
#

Not a clue what rocketchat is, and if so can you provide the exact line its pointing to? As well as some form of docs around it (What your using)

dire fractal
#

@patent ingot ^

patent ingot
uncut spade
#

Her's the error I get

#

return redirect('MonProfile',{'Log':Log})

dire fractal
#

You will need to allow for arguments

uncut spade
#

How?

dire fractal
#

return redirect('MonProfile', log=Log) will be the syntax for redirect and can I see your MonProfile route? Just the urls.py entry and the first few lines of the func

dire fractal
uncut spade
#

'MonProfile' is in templates->Utilisateurs

dire fractal
#

Its a route tho correct?

uncut spade
#

Yes

dire fractal
#

Give me a minute to sus the best way to take a form

#

Can I see your route definition?

lavish prismBOT
#

Hey @patent ingot!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

uncut spade
#

Sorry but what's a route definition?

#

which file I mean

dire fractal
#

Your views.py file is where they normally live

patent ingot
uncut spade
#
from .forms import UserRegisterForm, UserLoginFoo
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
import inspect

def register(request):
    if request.method=='POST':
        form= UserRegisterForm(request.POST)
        if form.is_valid():
            form.save()
            return redirect("PagePrincipale")
    else:
        form=UserRegisterForm()
    return render(request,'Utilisateurs/Inscription.html',{'Usr':form})


def Loginin(request):
    if request.method=='POST':
        Log= UserLoginFoo(request.POST)
        if Log.is_valid():
            return redirect('MonProfile', log=Log)
    else:
        Log= UserLoginFoo()
    return render(request,'Utilisateurs/Connexion.html',{'form':Log})


def Profile(request):
    return render(request,'Utilisateurs/Profile.html')


#

This one?

dire fractal
#

Which one does the 'MonProfile' redirect point at?

uncut spade
#

This view

dire fractal
#

Which function

uncut spade
#

Loginin

dire fractal
#

So it just redirects at itself?

#

Can I just ask the design choice behind that?

#

You appear to be able to avoid a redirect, and you already have the form

#

I'll be honest im getting a tad confused

uncut spade
#

No

#

I actually try to get into the 'MonProfile' file which means 'MyProfile' if the user is authenticated

dire fractal
#

So it doesnt redirect to the loginin function. So where does it redirect, is MonProfile a template?

uncut spade
#

and with the args, I can add some features on the 'MonProfile' Page. Imagine if the users name is Mark, I'll be able to add Mark on my geml page

#

No it's Just a route

#
    path('admin/', admin.site.urls),
    path('', NewAppli_views.Home, name="PagePrincipale"),
    path('Inscription/', Utilisateurs_views.register, name="S'inscrire"),
    path('profile/', Utilisateurs_views.Profile, name="MonProfile"),
    path('Connexion/',Utilisateurs_views.Loginin,name="Se connecter"),
    path('Deconnexion/',djauth_views.LogoutView.as_view(template_name='Utilisateurs/Deconnexion.html'),name="Se deconnecter")```
#

It's its name sorry

dire fractal
#

We got there eventually, it actually goes to the Profile function which is what I was looking for... 😂

#

Do you need anything other then form_instance.username?

#

from the form

uncut spade
#

yeah

#

The password and an other field

dire fractal
#

username, password, and whats the name of the other one?

uncut spade
#

Code

dire fractal
#

username, password, code

uncut spade
#

Yup

dire fractal
#

cool

#

and since password n such, we now need to use a POST method, since GET would mean url encoded and url encoded passwords arent good

#

I assume you have a user profile?

#

Does your form talk to said profile

#

I think if so, it'd be easier to call your Profile route with the user profiles pk (id) and fetch data that way rather then try mess around with post redirects

#

@uncut spade

uncut spade
#

How could I do it?

dire fractal
#

wdym?

uncut spade
#

Uh I didn't unerstand

#

I'll try it

dire fractal
#

Your form is used to login correct?

#

So it should be checking agaisnt a stored user profile or somethin to ensure its valid

#

The idea then is if it is valid, you just provide the user profiles unique primary key as a url param
Then in Profile you fetch said user profile using the primary key

#

If that makes more sense

patent ingot
#

@dire fractal did you look at my project? 🙂

#

I send the link to the stacktrace

dire fractal
#

try
def users_status_rocketchat(): -> def users_status_rocketchat(request):

#

Since its a route, all routes get given request as a param

#

@patent ingot

patent ingot
#

Ok, i'll try

sage escarp
#

how do i make an infinite loop run alongside a django webserver or is this not possible and i should just make it a separate program

quick cargo
#

threading™️

patent ingot
#

Hey thanks, but now I would like to know how to return json object properly (json requests.get function from request library in python):

    api_response = requests.get(api_url, headers=headers).json()

    # Logout admin
    logout_rocketchat(admin_token, admin_id)

    return api_response
dire fractal
#

return jsonify(api_response) I assume

#

Nothing a simple google couldnt accomplish

patent ingot
#

Sorry, I am working on this for too long time...

sage escarp
#

would it be ok to spawn a new thread in the main function of django in manage.py

spark temple
#

Generating thumbnails for hls streaming links :

What could be the effiecnt way of getting a screenshot of an hls live streaming link in python. I Have tried reading through different packages like this one ffmpeg python lib, but I haven't seen what I need exactly.

A django solution would be better.

REASON FOR THIS

Am having a frontend which has a list of TVs, so these TVs need thumbanils before pressing on them. So in the backend if we could have a possibility of generating them, then we pass them through an API.

#

?

late fjord
#

Hi I'm asking for an advice about moving from django to fast api

#

I haven't mastered dj I'm just a beginner

#

And I think that FastApi is the future of web frameworks

zealous siren
#

I mean, FastAPI is just REST API so if you want to provide UI, you need to provide JS Frontend

late fjord
#

@zealous siren I don't think someone is going to use django template system for his website

zealous siren
#

then FastAPI won't work for you

late fjord
#

why

zealous siren
#

because it REST API

late fjord
#

that's what I was looking for

#

I will learn react

#

or plain js

grizzled barn
swift sky
#

yeah learn react

#

im not sure where to post this but i have a UserWarning: Current server name '0.0.0.0:5001' doesn't match configured server name 'localhost.localdomain:5001' issue

#

ive checked on stack overflow

#

idk what else to do

swift sky
#

this only happens when I run my docker container

grizzled barn
#

it's a different kernel so the domains don't resolve the same

swift sky
#

i did add this in my run file though

#

&& echo "0.0.0.0 something.website-name.com" >> /etc/hosts

#

sooo

#

i have to do this Use --network="host" in your docker run command, then 127.0.0.1 in your docker container will point to your docker host. @grizzled barn

grizzled barn
#

Okay cool I was about to ask why you were using 0.0.0.0 instead of 127.0.0.1

#

so I guess it isn't equivalent to localhost

swift sky
grizzled barn
#

Oh lol yes I think you do

swift sky
#

idk what they mean by use 127.0.0.1 in your docker container

#

@grizzled barn any ideas xD

late gale
#

i even added DEFAULT_FROM_EMAIL in settings.py but it still takes the from email from EMAIL_HOST_USER

swift sky
#

channel is not closed

#

it's occupied

grizzled barn
#

@swift sky sorry I think I'm missing something myself

#

I'm pretty new to docker myself

late gale
#

is it closed now?

swift sky
#

@late gale sorry my mistake i thought this was a help channel, not a topic channel. it was never close sorry

late gale
#

ook i fixed my issue

#

no no its ok

#
DEFAULT_FROM_EMAIL = 'My Doamin <no-reply@mydomain.com>'

is it written correctly ?

#

it shows My Domain in from email but it still shows me the EMAIL_HOST_USER as from email

#

let me try to screenshot

#

please mention or reply

#

so i can get notified

cinder whale
#

django vs flask. choose only one

vestal hound
#

Django

summer dirge
#

flask FastAPI

native tide
#

Django!

summer dirge
#

real answer: REALLY depends on the use case. flask is way simpler, fastapi is way better for APIs, Django if you want to make a large server-rendered web application

native tide
summer dirge
#

if you want to render clientside i personally would go with fastapi though i have little experience with djanog to say it wont work

zealous siren
dawn ember
#

hello! i was wondering if there was a way to put multiple entrypoints into a gcloud instance

#

i wanted to host a web server and discord bot simultaneously on the same instance (if possible)

#

in the references there doesn't seem to be any mention of it but i thought i'd ask anyway

swift sky
#

so im assuming that you cant put pull .env variables into a dockerfile

#

how are you supposed to handle that then? like i have a && echo "0.0.0.0 some.site.com" >> /etc/hosts

cursive nova
#

Flask website ideas?

swift sky
#

dildo marketplace

cursive nova
wicked elbow
#

Easiest way to change password in auth_user table in django? Seems like a million ways to do it, but whats the right way?

summer dirge
#

@swift sky you can pull arguments into your dockerfile from the outside using ARG or you can get env vars into the final container in a multitude of ways

#

i would advise you to use a docker-compose file for building where you can then easily add env vars as build ARGs

swift sky
#

Im currently using the env file method

#

But this question was regarding the build file

#

Which the env file method doesn't work

#

Idk. I'm getting a 502 bad gateway

#

So somethings not hooked up. But im too tired to fix it

summer dirge
#

docker compose automatically gets .env vars and makes them avaliable in the docker-compsoe with the ${} syntax, which you can then pass into the build using the ARGs

swift sky
#

I see

#

Thanks

summer dirge
#

example docker-compose

version: "3.8"
services:
  web:
    build:
      context: .
      args:
        - TOKEN=$TOKEN
#

works if the .env is in the same or a parent directory

swift sky
#

Cool

#

Good night

summer dirge
#

gn

placid parcel
#

Hello Guys
Do anybody Know 3D reconstruction from 2D images using python?

vestal hound
#

I would suggest you refrain from doing that

#

use User.set_password instead

wicked elbow
# vestal hound I would suggest you refrain from doing that

I did, but there's like a million different examples. Also don't want to force logout on password change either. I read it clears the token when you change the password. Im doing front end verification for password and retype password so don't need to handle that on the backend.

#

I went as simple as possible, but hopefully not to simple. I just know the auth user table has a lot of built in stuff

placid hearth
#

Guys, im kinda new into backend and after a long long hours my code kinda ugly works. I tried to filter django rest framework api with url params. This is what it looks like

# views.py

class PostViewSet(viewsets.ModelViewSet):
    serializer_class = PostSerializer
    queryset = Post.objects.all()
    permission_classes = [permissions.IsAuthenticatedOrReadOnly, IsOwnerOrReadOnly]

    def get_queryset(self):
        query = dict(self.request.query_params)
        count = self.request.query_params.get('count')
        user = self.request.query_params.get('user')
        if count:
            return Post.objects.all()[:int(count)]
        if user:
            return Post.objects.filter(author__username=user)
        return self.queryset

# serializers.py
class PostSerializer(serializers.HyperlinkedModelSerializer):
    author = serializers.ReadOnlyField(source="author.username")
    class Meta:
        model = Post
        fields = ["title", "content", "date_posted", "author"]

#urls.py
router = DefaultRouter()
router.register(r'posts', api_views.PostViewSet)

now i can filter data like

# get data of 10 posts
http://localhost:8000/v1/posts?count=10/

or

# get all posts of specific user
http://localhost:8000/v1/posts?user=AnyUser6000

but i feel like "i packed a lot stuff in the wrong place", also this solution doesn't allow me to specify url or combine params like http://localhost:8000/v1/posts?user=AnyUser6000&count=10 to get 10 posts of specific user and if i add more f.ex 10 different filters i'll end up with bunch of if statements. Could someone tell me how it should look and guide me how should i organize stuff and to what i should pay attention? Thanks!

dreamy void
#

how do i put my database generated via python to my sql database from django?

somber iron
#

does anyone know how to convert webelement in python selenium into an integer?

cinder whale
still elm
#

hello
can some one tell me how to create a server in my computer and then use that server to fetch data in another computer from that server
using django

cinder whale
native tide
#

Django or Flask ? I am junior

neat briar
#

Can somebody help me in this using Flask?

A web application (only API) in Python 3 with one endpoint that accepts (x, y) coordinate values on a 2D plane.The response is a function of the current (x, y) input as well as the previously passed values.
Response:Iff it's possible to make a square using any of the four points plotted so far, return the 4 points formatted as a string.
Otherwise, the response is just an acknowledgement of the input.Once a successful response is returned, further calls to the API should just return the same response.
Bounds:*
Assumption 1: All input points can be assumed to lie in the positive quadrant.* Assumption 2: You only need to consider axes-parallel squares (no tilted squares).

native tide
#

Error: The included URLconf '<module 'app_users.urls' from 'D:\Projects\school website\teaching_blog\app_users\urls.py'>' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import.

#

pls help

spark temple
oblique kite
stone cradle
#

tkinter vs pyqt vs kivy for a small project?

fickle cobalt
spark temple
#

😥

nimble epoch
#

wanted to know if i can add django csrf_token when im using form in reactjs cause i get 403 error (CSRF cookie not set) if not is there any way so that i can pass this error?

native tide
#

So i only allow 1 domain as input, how would i check if the form input is the specific domain?

scenic galleon
#

!paste

lavish prismBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

oblique kite
late fjord
#

FastAPI 10 / Django 7 / Flask 3

#

what do you think

#

@oblique kite

oblique kite
# late fjord <@!791591873034584064>

FastAPI is fast and minimalist when compared to Django. But in my opinion Django is Best as it contains large user base and lots of online resources. (Haven't worked on Flask)

late fjord
#

But I guess you can do anything you want with fastapi

#

is that right ???

#

as a beginner do you think I should learn django or fastapi

oblique kite
#

Django provides ORM, Migrations, MVC pattern where as FastAPI is dedicated to backend APIs

late fjord
#

orm is the best thing in django but I can use sql alchemy with fast api

#

"MVC" what is this ???

oblique kite
late fjord
#

I tried django

oblique kite
late fjord
#

what makes django good for big projects ???

#

and what makes FastAPI bad for big projects ???

oblique kite
late fjord
#

thank you

#

do you know both ???

#

@oblique kite I read what you sent to me thank

#

Just another question if you are going to build amozon like website you choose django or fast api, also thank you for everything

oblique kite
oblique kite
late fjord
#

thank you so much

sage escarp
#

why does my thread stop when i spwan it in manage.py in django ?

sage escarp
#

no i was dumb and forgot to add the infinite loop in my function 😅

silver iris
# late fjord Just another question if you are going to build amozon like website you choose d...

Sorry to disrupt this, but i cannot completely agree with @ virus02. To a beginner, Django feels much easier, because it hides a lot in a hidden blackbox. Django is perfect for projects like a simple CMS, or a tiny ecommerce website, but imho, it becomes a nightmare as the project grows. The models are coupled with the database, making everything hard to test. If you're a complete beginner, I would go with Django, sure - it's easy to learn and you can get a working product quickly while understanding fundamentals like request handling, validation or database design. But if you're aiming for a bigger project, a simple framework (like Flask or FastAPI) on top of which you can build a cleaner architecture, will be a relief in the long run. But it obviously requires some understanding of why you're designing things one way or the other.

#

My point was, if you decide to go the FastAPI way, it will be harder at first, but I believe you will learn a lot more along the way.

nimble epoch
# oblique kite Can you please provide your code?

just wanna know how can i pass it or how to add it because whenever you dont use {% csrf_token %} in your form django gives error 403 cause of the csrf_token and you cant add {% csrf_token %} to your reactjs app it gives a kinda error because of {%%} so seems like i cant mix the django template engine with jsx. so how do i add the csrf_token?

#

and of course i need a little explanation😅

oblique kite
oblique kite
halcyon lion
#

boys what does the "||" stand for in js

#

like if i write

#
if (a =b || c=a)
#

what does that stand for

native tide
halcyon lion
#

cant they just be stright forward like in python 😄

#

fk js

#

worst language ever

native tide
#

bruh

#

I have never served react within a django template, is it easier or harder than having django just as an API?

silver iris
halcyon lion
#

have no idea :d

#

i have this js course in my uni and i have to take it

#

i cant graduate if i dont

hybrid cloak
#

Could anyone tell me the best resources to get started with web dev

west wren
#

I have a Flask app that's doing difficulty analysis on Chinese texts given to it through a request.
It uses a large amount of data with Chinese word frequencies to do so, and I'm not sure what the best format would be to have it be fastest.

(approx. 5000 lines CSV, 1mb JSON)
For this sort of work, would it be fastest to use:

  • csv
  • json
  • a python dictionary
    or some other format?

Thanks in advance!

fringe mountain
#

Hello how do i use the index method in the django template language

oblique kite
fringe mountain
#

Oh thank you so much

late gale
#

I'd like to ask a question if possible I wanna deploy my Django website on either Heroku , Digital Ocean or Blue Host . what do you recommend please for top performance, security , pricing and of course support ? thanks

acoustic oyster
#

I have used digital ocean on credits, and have helped some of my students use heroku.

I found digital ocean was much simpler to deploy on (more similar to other ways I had deployed, at least), however it is not free. From what I understand heroku is free and is a go-to for many users, there are also many guides on this. Digital ocean also has a cool mascot.

They should all be similar in security, I would expect digital ocean to have the better customer support. They have their own guides online and they are a paid service.

Alternatively I would also recommend AWS EC2, as they are obviously reputable and I had a good experience with them. It was also quite cheap (It ended up being less than $1 per month after several months of usage)

#

@late gale

cinder whale
#

anyone use streamlit?

#

im have a super stupid mistake and cant figure it out

#

what the site gives me

#
import streamlit as st
import numpy as np
import pandas as pd

from sklearn import datasets
from sklearn.ensemble import RandomForestClassifier```
#

how i imported the libraries

#

am i forgetting something

late gale
#

and btw should i host my static files on aws does it really affect performance or it doesnt matter

late gale
cinder whale
#

im like 110% positive i installed it

#

i pip installed it

#

and conda installed it

late gale
#

lmao

cinder whale
#

but let me do it again

#

"requirement already satisfied"

#

why is it not finding it

late gale
#

what framework is it django or flask?

cinder whale
#

streamlit

#

its even simpler

#

im just dumb

acoustic oyster
cinder whale
#

wait why does it say this:

Installing collected packages: sklearn
Successfully installed sklearn-0.0

#

0.0 ID_BoomKek

late gale
#

I like your enthusiasm

cinder whale
#

im gonna go cry and eat lunch

late gale
#

is AWS free or paid

acoustic oyster
#

it is paid, but it has free tier. I used the free tier and it charges you for resources you use beyond the limits of the free tier. For me it was only a few cents per month, but it is based on usage. (My usage was VERY low)

late gale
#

cool glad there's a free tier so i can try it first

#

One more question sorry to ask alot but I've recently heard about PWA i found it cooler than normal sites do you recommend to change my site into PWA or not worth

#

I'm doing more researches recently on it before my judge

acoustic oyster
#

I cannot say I am very familiar with what a PWA really is

#

update: I finished my google research.

yeah, that would be really cool. I do not think it is anywhere near essential though. It appears the main difference is that a PWA is meant to also be installed as a local app. Which as a user is something I usually want to avoid, except for with very special apps lemon_sentimental

#

I will also add that if you are using a JS framework, they are often made with this sort of thing in mind. I.e React yells at me if my site is not install-able.

cinder whale
#

ahhhhhhhhhhhhhhh why does it run when i call it from the terminal

streamlit run iris_app.py

#

how come it didnt run when it deployed it from github

late gale
#

Relax.

cinder whale
#

ok

late gale
late gale
#

i didn't know streamlit until yet so i'm not knowledgeable

cinder whale
#

its ok ill just cry SmileThruThePain

#

maybe i shouldve learned django or flask instead

#

they said this was easier

late gale
#

Chill, learn what you you feel right

cinder whale
#

ok

acoustic oyster
#

Sadly I am not familiar. BUT: this is how you learn. When I started out, I remember obsessively trying to get small features to work for hours on end. All while aggressively googling. Most of what I know is from this method. Over time you build the confidence that no matter what the problem is, you will be able to solve it through troubleshooting and likely a lot of googling.

cinder whale
#

yes this is true

late gale
#

i totally agree with fisher

#

this how everyone learns

#

this is how education goes

#

do mistakes

cinder whale
#

its probably just a package error or version error

late gale
#

so u can learn

#

true

#

nothing complicated

late gale
acoustic oyster
#

Yeah, it would certainly be cool. I do not have much experience with it.

The front end for my django sites are always in React nowadays anyway

late gale
#

React yes

#

It's so cool

thin marsh
#

Wassup guys I'm trying to web scraping a horoscope website but this clickbait abomination requests clicks all over the place to get each of information bit. U guys have an idea how to deal with this without create bunch of html file in memory?

cinder whale
#

sounds like a hot mess

#

good luck my dude

vapid dome
#

I'm just trying to make a File server with flask lmao

cinder whale
#

tell me when you find out how

vapid dome
#

hahahahah

#

It aint gonna be a "file server"

cinder whale
vapid dome
#

more or less im useing flask as a way to run a website, and from the site it links to a directory where anything in the directory you can download

#

im just trying to think of cool projects to make

#

kinda run outa ideas

cinder whale
#

im in a similar boat

#

i think im gonna use heroku to host

#

and streamlit if i can ever get it to work to do most of the work

#

i guess i could try django but im on a crunch

#

maybe next project

#

or i could stay up

vapid dome
#

lol

shrewd sand
#

I'm using a jsonfile to store my websites information. It's never going to be more than about 600 lines. Is this acceptable, or should I move to an SQL database? Probably postgres

zealous siren
acoustic oyster
acoustic oyster
zealous siren
#

gets out the book.

#

Can I share the good word of FastAPI with you?

acoustic oyster
#

Lolol, tbh that is how it feels nowadays xD and yes I need to learn fastapi

cinder whale
#

did someone say fastapi resources

rapid bramble
#

Hello there I'm having a question regarding implementation of dynamic modals in flask. What I'm looking to achieve is create a password protected modal, that is when a user clicks a certain button on his dashboard, a modal pops up which asks him to confirm his password, and when he does displays some secret data. I'm wondering how to implement this. not the modal as such but the password protection of it. Basically that is really secure data and it'd be nice to pass it to the template only when the user confirm his password. What's a possible way of acheiving this?

sacred rampart
#

Does selenium actually interact with the website or does it simulate what would happen if you do certain inputs?

thin marsh
#

Hey how do u guys know where a website is taking its data from

#

For example covid19.who or sth

sacred rampart
#

Ahhh okay thank you

left jackal
#

Hey guys, I am developing web scraping app and at one point browser stops listening to my code CORB is blocking it and I am stuck.

#

ping me

left jackal
#

yeah cors

elfin bluff
#

Any django user ?

oblique kite
rustic pebble
#

Hey, I am trying to figure out an answer to the following question:

Say you have frontend for a social network and all the backend layed out. The app contains a search bar in which you can search basically everything, a user, a page, a group. How would one make an optimised search in the database as, potentially millions of entries would exist. So lets say I typed the word: Kiwi, it would have to search all the users, pages, groups and return with the ones that contain that string in their name. Having multiple tables with so many rows it would take enough time to make the app look slow. How would one tackle with this issue?

mint folio
#

@rustic pebble You should look into full text searching. Most databases support it, or you can use an external search provider like algolia or elastic search.

earnest prawn
#

whats the best help guide for web development?

elfin bluff
#

I can see the names of tables, but as soon i click on the name it shows a error

oblique kite
shy willow
#

Hey guys! I'm new to django, and I'm wondering if it's possible to to detect if a session has ended, and if it has, count a timer for, like, let's say a week, and if the session has never been reconnected, then delete the model?

#

So for example, if I have a model that has a code, and if I add the code to the url as a param, it will display the models data

calm citrus
#

Hey guys I'm a new in python and I'm messing around
If I make a website using flask, is there way to get a unique domain name for free. By that I don't mean like commerical sites like wix, I want the server to run on my PC, it won't be a 24/7 server or anything just a server that will run when I run the file.

shy willow
#

and if that code hasn't been accessed for a week by anyone, then delete it?

calm citrus
#

Idk about django

shy willow
#

ah okay

elfin bluff
#
    Id = models.AutoField(primary_key=True)
    Username = models.CharField(max_length=100)
    FullName = models.CharField(max_length=100)
    Email = models.EmailField(max_length=150)
    Contact = models.IntegerField()
    Password = models.CharField(max_length=100)
    Status = models.IntegerField()
    RegDate = models.DateField(auto_now_add=True)
    UpdationDate = models.DateField(auto_now=True)
    class Meta:
        db_table="Students_info"```

***How many values i need to pass as user input here ?***
wintry grove
#

Hey people
I'm building a newsletter
How would I implement mailchimp in Flask?
(if this is not the best way to do a newsletter in python please tell me)

compact flicker
#

Django unique, null and blank CharField giving 'already exists' error on Admin page
What should I do...?

native tide
#

Hello. I just started making a website and could use a decent bit of help with one section I'm trying to implement. If anyone would be able to help me it would be more than appreciated.

hushed jackal
#

Hi all. With Flask, I know I can get a URL named param with a request.args.get(<key>)

What is the best way to get the first value of a URL param if there is no key in the URL request? For example: http://mysite.com/?5555

native tide
earnest prawn
#

whats the best guide for html and css?

patent oak
#

How do you listen to Post requests from a desktop application?

indigo kettle
hushed jackal
#

So there is no such thing as param with just a value instead of a key/value? I was asked to handle a URL like the one I mentioned above, and I was scratching my head.

indigo kettle
#

I mean it's fine, you could just iterate through the params and see what's there

#

whether it's the key or the value doesn't seem like it should matter

lone star
#

hi

#

I want to store usernames to mysql db and I also need to create files for the usernames. space characters take up space that's just one example. what should I do?

olive tiger
native tide
# olive tiger I guess, you can just ask your question

So I was working on my review website and I wanted to add a feature that would allow people to vote. The concept would be that by pressing an icon it would pop a page up and ask them to review the movie out of 100 and then add to a list of everyone's rating and average them out and display it in a circle that would be animated to show the rating.

late fjord
#

@silver iris I've just read your message, I am not a complete beginner, and I am not a pro, I know how to handle requests...... so what do you think

#

I also know what apis are

#

I keep seeing @silver iris is typing...

silver iris
#

It really is a matter of personal preference. With Django, the framework does a lot of hard work for you at the expense of enforcing a certain way of doing things. Lightweight frameworks like Flask or FastAPI let you create your own architecture that may or may not be better than what you'd get out of the box with Django.
I'm not trying to say "Django is bad", I'm not trying to say "FastAPI is great". Anything you can do in one framework can be done in the other.
I've seen larger Django projects become an unmaintainable mess where every change can be breaking. This goes hand in hand with what I've said in the other post - building a testable codebase with django is harder than with a simpler tool.
On the other hand, I do not have experience with FastAPI on a large production-level project. Maybe it will prove me wrong.

late fjord
#

thank you so much @silver iris I now know why I kept seeing marinovanec is typing... thank you so much, I myself decided to move to fastapi because I think it is going to make the trend soon and I want to be the one who knows it, I think I took a lot of your time, thank you so much 💝

#

I also looked for tutorials I didn't find any, I guess I should go for the docs what do you think

silver iris
#

I think I've seen something about a tutorial in the docs

#

but I can't say how good or bad it is
their docs are well above average, though

late fjord
#

thank you

vestal hound
#

use flexbox?

#

vertical-align is more for stuff that is on the same line

past cipher
#

I wonder if anyone can help me. I have a form that is posted, and it contains two forms. One for user registration, and another for a product that will be created and stored in the database. I then need to post one of the forms to another routes file called register, and once that is done, I then need to add the product in the original route to the database. I am currently using requests to make the post request, but I need a better solution.

@editor_bp.route('/editor/create', methods=['POST'])
def create():
    product = ProductForm()
    register = RegisterForm()
    
    if not (register.validate_on_submit()) or not (product.validate_on_submit()):
        return redirect(url_for('editor.edit'))

    if not requests.post('http://127.0.0.1:5000/auth/register', data={'email':register.data.get('email'), 'password':register.data.get('password'), 'store_name':product.data.get('store_name')}):
        print('invalud post')
        return redirect(url_for('editor.edit'))
@auth_bp('/register', methods=['POST'])
def register():
  ## some code here
#

How can I post RegisterForm() to register without using requests library? is there a way to do it in Flask without another library?

#

Because when I use requests and login the user on the register route, it doesn't login the user correctly

olive tiger
#

if it is the same app, no need to use http request, just import register as a module

#

or if it is in the same file, just call register() with your arguments

#

then you also do not need to route the register

native tide
#

why django always show ValueError: attempted relative import beyond top-level package whenever i try to import a module from main project directory?

#

structure is :

olive tiger
#

you have cross import?

#

oh, no, sorry

#

you are trying to import from outside your root dir, probably

native tide
#
parent/
  dir1/
    foo.py
  foo2.py
#

now if i try to import foo2 in foo

olive tiger
#

your root dir is where your manage.py sits

native tide
#

yes

#

if i try to import from there

#

it shows the error

olive tiger
#

do you have __init__.py in all dirs?

native tide
#

not in the root dir

#

as it was created by django itself

olive tiger
#

which one is the root?

#

oh,and did you add your module to the APPLICATIONS in the settings?

native tide
native tide
olive tiger
#

I am not sure, but I assume, you still need to add it to the APPLICATIONS

native tide
olive tiger
#

yes

native tide
#

no no, that only contains django apps, not the custom modules

olive tiger
#

but django will not see it, if you do not add it

#

just try, it does not cost much

native tide
#

lmao oky

olive tiger
#

but you may need to put into a dir, I do not think you can use file name in the installed apps

native tide
#

this is pissing me off, it should import from other dirs, if i give the absolute import then it works but then pycharm complains that no relevance found

past cipher
olive tiger
#

cannot help you with pycharm, I do not use it

native tide
#

thanks anyway 🙂

olive tiger
#

what error are you getting when you try to run it?

native tide
#

solved! It was my pycharm configs wrong, the content root was one dir level above than the original one. Lmao spent almost 2 hours for this

olive tiger
#

I knew it, never use ide's

oblique kite
compact flicker
#

Django unique, null and blank CharField giving 'already exists' error on Admin page
What should I do...?

wheat olive
#

I ve used django extensively. How can I help?

safe linden
#

Hi everybody! I built a small django webapp for collecting and organizing sport activity data using garmin fit or gpx files. It is designed to run locally to avoid uploading sensitive health and tracking data into any 3rd party cloud. I would be happy to receive some feedback 🙂 https://github.com/fgebhart/workoutizer

winged axle
#

What about Flask ? Have anyone tried it ?

native tide
#

Hello who knows django really well?
Because I really need help now I have been stuck for 4 days on the same problem

chrome cargo
native tide
gaunt marlin
#

@native tide i been working with django for a long time, i can help you

native tide
nova jetty
#

how would you put a python project into the web?

teal rapids
#

Hi there, I need some help with Django and HTML... first off, I know it's possible to put several forms inside another form, like this:

  {{form1}}
  {{form2}}
  {{...}}
</form>```
I made something similar to this:
```<form method="POST">
  <div>
    <form>
      {{form1}}
      <input type="submit" value="submit1">
    </form>
  </div>
  <div>
    <form>
      {{form2}}
      <input type="submit" value="submit2">
    </form>
  </div>
  <input type="submit" value="submit3">
</form>```
When I click "submit3", nothing happens. I already tried putting `action="."`, using jquery `submit()` to do something. Consoles on both Django and browser don't say anything.
#

The above forms are displayed as a sort-of slideshow, showing the proper div. Submit1 and submit2 just post the form, save the data and clear the form fields, without reloading the page.

blazing jetty
#

what the fuck

#

I can't import flask

#

it hangs

#

but when I type "python" to console and import it there, it works

#
import flask
import traceback
import requests
import logging
import ujson
#

this is my code, when I remove the flask import it works

#

when I don't, it just stops here:

#

but works here

formal axle
#

whats some good project based tutorials for django?

#

if anyone knows of any

native tide
left kraken
formal axle
left kraken
#

You mean django and flask or flask and fastAPI

formal axle
#

django and glask

#

flask

left kraken
#

Well, flask keeps things simple. You're master of your own.
|Have you ever tried to find smtn in django docs?
It's a disaster

formal axle
#

nah i have never tried that lol

#

im new to python and i want to learn a framework instead of wasting my time doing random stuff

#

lol

left kraken
# formal axle nah i have never tried that lol

If you want custom behavior from your app, like some strange API that does some extra complicated things than it is better to build whole authentication, groups and permissions on your own that rely on django

blazing jetty
#

@native tide pip list shows that Flask is installed

left kraken
left kraken
formal axle
left kraken
blazing jetty
#

no @left kraken

left kraken
formal axle
left kraken
blazing jetty
#

don't see the point rly, I don't like it either

#

wym global env=?

blazing jetty
#

I don't remember having to do anything other than importing to make it work

left kraken
blazing jetty
#

well it is clean and up to date stilll :D

left kraken
blazing jetty
#

there is no error

#

importing just hangs

left kraken
#

So, you're trying to execute the file from command line and nothing happens

blazing jetty
#

not file

#

I import flask but it hangs

copper lagoon
#

oauthlib.oauth2.rfc6749.errors.InvalidClientIdError: (invalid_request) Invalid "refresh_token" in request for gunicorn / flask / nginx

left kraken
blazing jetty
#

:/

native tide
#

Django is more just for fast development of the backend