#web-development

2 messages ยท Page 79 of 1

native tide
#

react used in font-end

#

bootstrap for like stying the page

thorn tartan
#

https://www.youtube.com/watch?v=UmljXZIypDc&list=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p
@quick cargo this was really useful for me starting out, I highly recommend this

In this Python Django Tutorial, we will be learning how to get started using the Django framework. We will install the necessary packages and get a basic application running in our browser. Let's get started...

The code for this series can be found at:
https://github.com/Core...

โ–ถ Play video
manic grail
#

I can't avoid js when creating a web app Right?

native tide
#

yes

#

js is main part of web

manic grail
#

Alright

distant trout
#

i dread writing javascript

#

thats why i learned jquery

manic grail
#

So I can't cover for it with python?

native tide
#

@manic grail in web development to get into any company u need js

distant trout
#

html css js - the main 3 in web dev

dapper tusk
#

you can in theory, but in practice, JS is much better

manic grail
#

Oh, alright, I have time to learn

quick cargo
#

you need basic JS tbh

#

Website JS is alot simpler overall compared to Node in reality

manic grail
#

And what about TypeScript?

quick cargo
#

typescript is just strictly typed JS that you'd then need to transpile to js

manic grail
#

Angular uses TypeScript

quick cargo
#

i havent really seen it used in frontend based stuff properly

native tide
#

html,css,js part in fontend python js(node)- backend

manic grail
#

So:
Flask
Bootstrap
React
MySQL
Heroku
Is it enough for a decent web app?

distant trout
#

i use postgres

native tide
#

u need to know how to use git aswell

manic grail
#

I know

#

I have am very experienced with git

native tide
#

@manic grail u need to know sass aswell

manic grail
#

Sass is related to css?

native tide
#

yes

distant trout
#

css framework

native tide
#

^

dapper tusk
#

you do not need sass, it is helpful though. Raw CSS is writable though

distant trout
#

i find the grouping css is very easier with sass - more organized

quick cargo
#

Heroku isnt needed

#

Heroku isnt used at all unless you want a lil free host for some basic stuff

#

MySQL is optional, alot of people prefer noSQL or Postgre best of the shitshow mySQL has been and still is in places

native tide
#

what about firebase

dapper tusk
#

ye, sass is definitely nicer in that regard. But it adds more steps to compilation and deployment, which can be a pain

native tide
#

firebase or heroku

distant trout
#

true. I guess if you are beginner stick to normal css for now

manic grail
#

I am not a newbie developer, I am quite experienced, although out of all the programming languages I used am the least experienced with python, Anyway, I am struggling with choosing a framework-> Flask or Django?

quick cargo
#

firebase inst the same thing as heroku

#

@manic grail just try both and see which you prefer

native tide
#

hmm

quick cargo
#

Its not hard to learn both tbh

dapper tusk
#

for the vast majority of websites, you could toss a coin and do fine either way

native tide
#

django file structure gives me headache

distant trout
#

yeah same here

quick cargo
#

Django forces you into good practices

manic grail
#

Some people told me it is easier to learn Django after knowing Flask

native tide
#

nah flask is amazing

quick cargo
#

alot of new people who use flask tend to fall into a really messy organisation system full of random global varibles

native tide
#

flask to django makes it easier not django to flask

quick cargo
#

not really

#

I went from Django to Flask lol

native tide
#

Lol

quick cargo
#

Not really had an issue other than found it more awkward to properly organise stuff in Flask

native tide
#

i actually went django to flask

distant trout
#

yeah you are right, im not very organized with my flask app

native tide
#

same

distant trout
#

my current project is all over the place interms of organization

#

XD

native tide
#

i don't even use blueprint

#

lol

distant trout
#

yeah

atomic zinc
#

should I first study front end or start with django?

quick cargo
#

issue when people arnt forced into poper structuring

manic grail
#

Well, organization is quite important for me, will Django make it easier to Organize stuff?

quick cargo
#

well DJango forces you to organise shit properly

native tide
#

yes

distant trout
#

im gonna start using blueprints, my project is getting too big

quick cargo
#

and is designed and forces you to make things modular etc...

native tide
#

@quick cargo i 100% agree with u

quick cargo
#

flask does not, which often leads to people having messy code

native tide
#

i said bye to django when i saw the file structure

manic grail
#

My only concern is that people told me that Django is more complex

distant trout
#

i really wish flask had that, forcing us to structure better

quick cargo
#

I wouldnt say its more complex

#

Django just has batteries included

native tide
#

i wish flask wasn't mirco-framework

distant trout
#

@quick cargo you think flask blueprints is good for organization?

quick cargo
#

in many cases handling stuff for you

#

I dont use blueprints

#

I made a custom backend system when i was using flask

distant trout
#

oh

native tide
#

oh

#

but i like to use flask-sqlalchemy alot in flask

quick cargo
#

Never used it lol

distant trout
#

yeah good ORM, i heard djangos ORM is better tho

native tide
#

it's amazing

manic grail
#

Hmm I guess I'll use Flask and If the shit hits the fan I'll learn Django

distant trout
#

django uses their own ORM

quick cargo
#

Django's orm is probably the best orm in python

distant trout
#

@manic grail u wont be disappointed with flask, its fun

manic grail
#

What's an ORM?

quick cargo
#

and probably one of the best of any web framework in any language

native tide
#

apis works with flask really well

quick cargo
#

an Orm basically stops you writing your own SQL queries

#

it does it for you

manic grail
#

Oh wow

quick cargo
#

and everything becomes a object

manic grail
#

Nice

native tide
#

flask-sqlalchemy use orm

quick cargo
#

alchemy is the orm

native tide
#

yes

manic grail
#

When should u use Angular over react?

quick cargo
#

personal choice normally

distant trout
#

I still havent learned any frontend framework

quick cargo
#

you dont even need React or Angular overall tbh

native tide
#

react is amazing u can build clone like ,yt,twitter,facebook

distant trout
#

maybe jquery? idk if thats a frontend framework

manic grail
#

What's Form validation lol

native tide
#

jquery is for animation

quick cargo
#

not really

distant trout
#

yeah ik basics of jquery

#

im trying to learn how to use ajax properly with jquery

native tide
#

thats good

quick cargo
#

jquery can be used for Dynamic reloading etc... as part of AJAX

manic grail
#

U think vanilla js is enough?

quick cargo
#

yh

manic grail
#

Generally or for python web apps specifically?

quick cargo
#

tho i havent finished this site at all

distant trout
#

i heard vanilla js is a good knowledge to have

quick cargo
#

generally speaking you dont need to have a front end framework

#

and plenty of sites dont use it

native tide
#

wait what

distant trout
#

this looks nice, what did u use with this site

quick cargo
#

tho it can be helpful at times its certainly not required

#

some basic JS and TailwindCSS

distant trout
#

oh nice

#

i heard tailwind is more customizeable than bootstrap

quick cargo
#

ehh yes and no

manic grail
#

Well, I have been told frameworks save you from a few headaches hehe

quick cargo
#

Bootstap does more because it includes JS stuff

#

Tailwind is pure Css

distant trout
#

ah

quick cargo
#

but yes you can customise how it builds the css files

native tide
#

bootstrap is for people can't do styling

#

๐Ÿ˜„

distant trout
#

what are u hosting this on @quick cargo

quick cargo
#

my server

manic grail
#

So I can get away with bootstrap and vanilla js?

quick cargo
#

yeah

native tide
#

i use figma because i don't like bootstrap in my website

manic grail
#

Although I want a really good site, want to make it BOMB, it is a project for next year

quick cargo
#

never used bootstrap tbh so wouldnt know

distant trout
#

bootstrap is good to put together a quick layout

native tide
#

bootstrap is good for buttons and forms

#

really good

#

i mean really good

distant trout
#

@manic grail u can make ur own styling if u have a lot of time

manic grail
#

No lol

native tide
#

bootstrap made for saving time

#

๐Ÿ˜„

distant trout
#

id design a website using figma and put it together with html/css and some js

#

and then add in the backend

native tide
#

design,html,css,js ,python(flask) flask-sqlalchemy for database = proper website

manic grail
#

Ah it is so overwhelming

#

So much to not learn

distant trout
#

@manic grail just start with flask tutorial

quick cargo
#

WSGI frameworks are good then you get into the work of ASGI systems for performance and more lemon_fingerguns_shades

manic grail
#

Is fullstack development a wanted job

quick cargo
#

yes

manic grail
#

Does it pay well?

native tide
#

flask and django wouldn't be nice without jinja

distant trout
#

i think most programming related jobs pay well

quick cargo
#

๐Ÿค” Django doesnt use jinja

distant trout
#

if u find the right job

native tide
#

wait django don't use jinja

distant trout
#

django uses its own templating engine

#

i think

quick cargo
#

yh

manic grail
#

Well, it is a good think to have in the resume

quick cargo
#

if i remember Django's templating engine came before Jinja and Jinja was a superset of Django's engine

distant trout
#

oh

native tide
#

oh

manic grail
#

What's js's main part in a website?

native tide
#

front-end

distant trout
#

user interaction?

quick cargo
#

generally

native tide
#

user interection = font-end

quick cargo
#

animation, dynamic reloading stuff like that

native tide
#

^

distant trout
#

@quick cargo do u know how i would use dynamically updated charts with flask

manic grail
#

So gui, dynamic reloading, asthetics and stuff like that

quick cargo
#

@distant trout you wouldnt generally

#

that would have to be done with JS on the frontend

distant trout
#

ohh okay

native tide
#

pygal

distant trout
#

i learned matplotlib for no reason ๐Ÿ˜ฆ

#

im gonna look into something like line charts

native tide
#

u can create chars using pygals

manic grail
#

So, React is only for gui stuff?

quick cargo
#

generally yes

manic grail
#

And Vue?

native tide
#

@distant trout if u wanna build chart then u can use pygal

#

in flask

distant trout
#

@native tide can i use with flask

native tide
#

yes

distant trout
#

ah, ill look into it, thanks

native tide
#

np

manic grail
#

Flask, Bootstrap, React, I have a lot to learn ๐Ÿ˜‹
And deployment to cloud.
And the general basics of HTML, CSS and Javascript ah.
Fun. ๐Ÿ˜ฏ ๐Ÿ™‚

#

Good luck, sorry for the monolog lol.

distant trout
#

@manic grail bootstrap easy, just need to remember few classes that u will regularly use ๐Ÿ˜„

manic grail
#

I ended up more overwhelmed and confused ๐Ÿ˜‚

glossy arrow
#

Can I use both flask and nodejs in an app?

native tide
#

<@&267629731250176001>

#

what is that?

#

<@&267629731250176001>

nocturne jetty
#

Do you need something moderated?

native tide
#

no.

nocturne jetty
#

Please only ping that role if you need something moderated.

native tide
#

ok, thank you.

patent cobalt
#

!mute 742012925950165043 1d Pinging the Moderators role multiple times, spamming the same message over and over again to various channels. Not a great start on our server.

lavish prismBOT
#

:incoming_envelope: :ok_hand: applied mute to @native tide until 2020-08-17 20:28 (23 hours and 59 minutes).

stark canyon
coral lotus
#

How do I start a web app?

potent kelp
#

anyone know how to work with chromedriver?

twin sable
#

Whenever I want I play my online CS50 course I fall asleep. Please help

native tide
#

yo

native tide
#

yo

#

@twin sable Watch it 1 hour after waking up and with that have a cup of coffee

#

If you can sleep under those conditions you're a degenerate

#

Also turn up the volume, open the blinds, brighten the screen. Wake up don't be a dungeon master

sudden fog
#

hi

native tide
#

@high holly hi

#

what u need?

potent kelp
#

anyone know why the code wont make firefox open?

#

I'm stumped

dawn heath
native tide
sturdy pike
#

Is anyone out theere

green snow
#

yea

crimson shard
#

I am using django framework but i am facing some problems regarding the execution of my models.py file.My tables are not adding in the database.

lavish prismBOT
crimson shard
limber laurel
#
{% extends 'users/user_form.html' %}
{% block extra %}
    <p>Click To <a href="{% url 'login' %}">Login</a></p>
{% endblock %}
#

How do I get it to show block extra?

#
{% block title %}{{ action }}{% endblock %}
{% block body %}
        <form action="" method="post"> {% csrf_token %}
            {% for field in form_user %}
                <div>
                    {{ field.label }}: {{ field }}
                </div>
            {% endfor %}
            {% for field in form_profile %}
                <div>
                    {{ field.label }}: {{ field }}
                </div>
            {% endfor %}
        <input type="submit" value="{{ action }}">
        </form>
{% endblock %}
{% block extra %}{% endblock %}```My user_form

Oh I had to put block extra in block body
crimson shard
sand tinsel
#

did you run makemigrations first?

crimson shard
#

yes,i have made some changes to my models file

limber laurel
#

And did you also migrate the migrations you made?

sand tinsel
#

it says there is no database table. Is this the first run?

limber laurel
#

How could I implement something like this in django, if a object of a model is not modeifiet for lets say, 7 days, it gets deleted?

#

Can I just simply use a property?

uncut glacier
#

@limber laurel if the timing doesn't have to be precise, you could just keep track of the modification datetime in the object and then run a cron job every day or hour or whatever to delete them if it goes over the timer

limber laurel
keen lily
#

is anyone familar with django authall?
i have an error

heady hearth
#

Hi, I'm working on a flask project, while I'm trying to do some css changes, the interface is not changing, even I change some html tags , it's not working.. It's showing previous result..

#

How can I fix that problem

bleak bobcat
#

disable cache in the network tab of devtools

native tide
#

@heady hearth ctrl f5

manic grail
#

Stupid question, when creating a web app Do I still need to create a separate server or Django does it?
Sorry for the stupidity

bleak bobcat
#

During developpement django comes with its own server, however for prod you'll need a webserver (apache/nginx)

manic grail
#

I mean, do I need to build a server from scratch, sockets, protocols, all this?

#

I am not talking about deployment

#

Well, I am not sure ๐Ÿ˜…

bleak bobcat
#

Nah you don't need to do any of that

manic grail
#

Oh cool

#

So, um, how do you deal with requests and stuff like that in Django?

#

Is is dealt automatically with routing?

bleak bobcat
#

yea

#

url => view => template
Each view comes with a request object

manic grail
#

Ok, and what about some functionality that is done separately, some processing I need to do?
In this case do I need a separate server?

heady hearth
#

I disbales cache, while I'm trying to refresh the page, it's shows the previous styling results, even I restart the server,

#

Source code also shows the previous code..

#

Then changes are not applying

short minnow
#

Fatal error in launcher: Unable to create process using '"c:\python38\python.exe" "C:\Python38\Scripts\pip.exe" install request': The system cannot find the file specified.

#

i have this error when i want to install pip requests

cursive viper
#

django

short minnow
#

?

cursive viper
#

i learnt django

left jungle
#

I disbales cache, while I'm trying to refresh the page, it's shows the previous styling results, even I restart the server,
@heady hearth I had the same "problem". Hold shift when you reload the page. That worked for me

limber laurel
#

I am deeply confused, I ak trying t9 install a package im vagrant, and I get a permission error, when I look at the permissions, all users have all of the permissions

bleak bobcat
limber laurel
#

Ok

junior stratus
#

Hey there, im creating a simple web page. With some forms. I wanted to change all of them to wtforms (security reasons) but i guess i miss something. My webpage has a navbar, some of the items open a modal in which the form will be shown.

Since the navbar is inside my base template, every other template i gonna load needs to return the form. For me this seems kinda redundant.

junior stratus
#

OK i've solved it. The Modal without innterHTML stays inside the base file. OnClick an ajax call requests the template with the form. On success the innerHTML of the modal gonna change

native tide
#

Anyone with experiece with PDFRW lib ?

bleak bobcat
native tide
#
RecursionError: maximum recursion depth exceeded```
#

what does this do?

frigid verge
#

I'm having trouble getting started on a project. I want to write a simple notifier program that lives in the system tray / notification area on Linux and/or MacOS that shows notifications for new events on support tickets owned by the user. The product we're using offers an API, but I'm not sure exactly how I would leverage it for this purpose. Would anyone be able to brainstorm or guide me in the right direction? Happy to this in DMs to keep channels clear.

I assume I need some sort of http server that is listening for POSTs to a particular ticket id or set of ticket ids based on which user is auth'd with the app... or perhaps I'm thinking about that wrong...

bleak bobcat
#

You don't need a http server, just a http client that makes request to their api, and since you want something in the system tray that's not really web development

frigid verge
#

@bleak bobcat my bad I thought it might qualify as backend since it's dealing with http and API. can you recommend a better place for my question?

bleak bobcat
#

Hmmm....Maybe #networks for the api calls part, but for the rest it would be a generic help channel

frigid verge
#

thanks for the direction ๐Ÿ™‡

native tide
#

is there a way to make a registration form without haviong the user to pass in passowrd,

unborn heart
#
<p>
    &nbsp;</p>
<p align="center">
    <img alt="" src="assets\images\E1.png" ></p>
<p>
    FIGURE <strong>E.1</strong> Schematic of a distillation column.</p>
<table border="0" cellpadding="0" cellspacing="0">
    <tbody>
        <tr>
            <td style="width:312px;height:228px;">
                <p>
                    <img alt="" src="assets\images\E2.png" ></p>
            </td>
            <td style="width:312px;height:228px;">
                <p>
                    <img alt="" src="assets\images\E2b.png" ></p>
            </td>

could someone tell my why these images are not loading in, I have never used HTML before. i have other images written the same that are loading in and more that aren;t

balmy shard
#

I was about to ask the same question with a background

#

I'm pretty sure its smth with flask

#

And other ones

unborn heart
#

what's flask?

half bough
#

I have a model with this:

        meeting_datetime = models.DateTimeField(blank=True, null=True)```
#

A file to manually create the dates and times with this:

    ('', 'Choose...'),
    ('date1', '2020-08-25 14:30:26')
)```
and calling my manual data in forms.py:
`meeting_datetime = forms.ChoiceField(choices=DATESTIMES)`
#

Any help would be greatly appreciated!

#

I also tried adding the timezone like this: 2020-09-04 06:00:00.000000 UTC and these:

2012-09-04 06:00:00+0800
2012-09-04 06:00:00.000000-08:00```

But none of them work, I get the same error as above.
halcyon oriole
#

does someone know how to prevent beautiful soup from taking the text of a child (eg:

<div class="match-item-event text-of">
  <div class="match-item-event-series text-of">Group Stage&ndash;Group D</div>
    Cyber Games Arena Pacific Open
</div>
``` I just want to take `Cyber Games Arena Pacific Open` but bs4 gives me also `Group Stage...`. Here is the python code: `.find("div", {"class" : "match-item-event text-of"}).text`
modest scaffold
#

why does my padding go inwards
whenever i use a pixel value e.g. padding: 5px; it adds the padding to the current width and height
but when i use a percentage value e.g. padding: 5%; the padding reduces the width of the element so that the element is ultimatley the same width
basically it minuses the width

dull jay
#

django vs flask?

sturdy pike
#

django

#

Also, quick question about django. is the variable pk saved in relation to model ids?

#

like when using it in the url paths

mellow tide
#

@dull jay that argument is more nuanced than x vs y

#

They are just tools, pick the right one for your job. Django is more inclusive, but comes at the cost of a steeper learning curve. Flask is easier to learn and faster to use right off the bat, but you have to do more bolt-ons to make it work like Django

sweet field
dark hare
#

@half bough have you tried using the default widget? Why are you overriding a DateTime Input and passing it a string value?

#

@sturdy pike what do you mean

sweet field
#

someone help me please im getting this error with selenium well might not be selenium as such but ye
@sweet field [17396:9180:0817/201811.393:ERROR:device_event_log_impl.cc(208)] [20:18:11.393] Bluetooth: bluetooth_adapter_winrt.cc:1074 Getting Default Adapter failed.

sturdy pike
#

voice chat boys

stoic knot
#

hey how do i use cookies in aiohttp_jinja2?
i searched but couldn't find docs

quick cargo
#

๐Ÿค” What do you mean

#

cookies has nothing todo with jinja

stoic knot
#

oh?
so how do i use cookies in general XD
sorry but i am new to web-development
and i heard i can store the user info from discord in cookies so i can define that this info belongs to this user

quick cargo
stoic knot
#

thanks

native tide
#
.grid-contain {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  background-color: #2196F3;
  padding: 10px;
}

.grid-contain img {
  border: 1px solid #ccc;
  box-shadow: 2px 2px 6px 0px  rgba(0,0,0,0.3);
  max-width: 30%;
}

{% for project in in projects %}
    <div class="grid-contain">
           <img src="{% static project.thumbnail.url %}"  width="100%">
    </div>
{% endfor %}

hi,
i have an issue with using a grid layout with a for loop
i want the images to be shown on 3 columns but it only puts the pictures on the first one and i don't know why, any idea?

stoic knot
#

    last_visit = session['code']``` so i use this part ?
native tide
#

how do buisness website make such cool templates

quick cargo
#

css and time

stoic knot
#

hey i got this error RuntimeError: Install aiohttp_session middleware in your aiohttp.web.Application

import pyrebase
from aiohttp import web
from aiohttp_session import setup, get_session, session_middleware


import discord
from discord.ext import commands

import aiohttp_jinja2

import jinja2
from pathlib import Path

from oauth import Oauth
 async def verified(self):
        @aiohttp_jinja2.template('home.html')
        async def start(request):

            raise web.HTTPSeeOther(location=Oauth.discord_login_url)




        @aiohttp_jinja2.template('cover.html')
        async def login(request):
            session = await get_session(request)
            last_visit = session['last_visit']
            print(last_visit)
            return``` the code @quick cargo
#

this is a cog btw

sweet field
#

@sweet field [17396:9180:0817/201811.393:ERROR:device_event_log_impl.cc(208)] [20:18:11.393] Bluetooth: bluetooth_adapter_winrt.cc:1074 Getting Default Adapter failed.
@sweet field bruh you guys are so useless on here i need an answer ASAP

dark hare
#

@sweet field ๐Ÿ˜†

sweet field
#

i mean i did ask at 20.18 my time

stoic knot
#

that's rude of someone who asks for help

quick cargo
#

Luckily for us we're just volunteer's and arnt your servants :P

sweet field
#

nice

#

but i would expect someone to help me if i asked nicely

#

they could have at least said soz boet cant help you

dark hare
#

what a terrible attitude

sweet field
#

how

#

at least respond

#

its called common decency

quick cargo
#

it shows how to install the session stuff when making the app

#
import asyncio
import time
import base64
from cryptography import fernet
from aiohttp import web
from aiohttp_session import setup, get_session, session_middleware
from aiohttp_session.cookie_storage import EncryptedCookieStorage

async def handler(request):
    session = await get_session(request)
    last_visit = session['last_visit'] if 'last_visit' in session else None
    text = 'Last visited: {}'.format(last_visit)
    return web.Response(text=text)

async def make_app():
    app = web.Application()
    # secret_key must be 32 url-safe base64-encoded bytes
    fernet_key = fernet.Fernet.generate_key()
    secret_key = base64.urlsafe_b64decode(fernet_key)
    setup(app, EncryptedCookieStorage(secret_key))
    app.add_routes([web.get('/', handler)])
    return app

web.run_app(make_app())```
dark hare
#

there are lots of beginners here and also more experienced people with knowledge in different areas. Sometimes people aren't able to help, it doesnt mean they have to respond to tell you they cant help

sweet field
#

better if they do say so ngl

#

where should i look for an answer then

quick cargo
#

you can ask in a help channel but you do have to be patient

dark hare
#

if no one can help you, then read the docs or google the error message

#

and try to debug yourself

stoic knot
#

@quick cargo i did
i even copied the whole example and i still get the error

sweet field
#

you can ask in a help channel but you do have to be patient
@quick cargo lol patient ive waited 1 and half hours

quick cargo
#

๐Ÿคทโ€โ™‚๏ธ That happens

#

@stoic knot hmm

#

send your full code

stoic knot
#

ok

quick cargo
#

@sweet field if you actually gave us more to work with people might be able to see whats wrong, but last time i checked selenium had nothing todo with bluetooth directly so

sweet field
#

i did say that in the orignal message btw

#

someone help me please im getting this error with selenium (well might not be selenium as such but ye)

#

lol

quick cargo
sweet field
#

whatsapp open and then closes with that error

quick cargo
#

๐Ÿคฆโ€โ™‚๏ธ What is your code

stoic knot
#

hastebin is not working

quick cargo
#

!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.

stoic knot
quick cargo
#

okay

#

secondly you dont actually install the middlewear like the example tells you todo

#
app = web.Application()
    # secret_key must be 32 url-safe base64-encoded bytes
    fernet_key = fernet.Fernet.generate_key()
    secret_key = base64.urlsafe_b64decode(fernet_key)
    setup(app, EncryptedCookieStorage(secret_key))```
stoic knot
#

hmmm but it works fine?
like its under the @aiohttp_jinja2.template

#

oh so that's the middlewear

#

i already have the app defined so i will use this part secret_key = base64.urlsafe_b64decode(fernet_key)
also idk where to put this setup(app, EncryptedCookieStorage(secret_key))

#

and it seems i can't pip install cryptography

No matching distribution found for cffi!=1.11.3,>=1.8
#

ah nvm

#

@quick cargo i think this example is outdated or something
everytime i fix something i get another error
this is the last error setup(app, EncryptedCookieStorage(secret_key)) TypeError: setup() takes 1 positional argument but 2 were given
code : https://paste.pythondiscord.com/widucunibo.py

dull jay
#

if i'm just making a rest api and probably some sort of webhook service and want something quite light weight what would you recommend? I've recently been shown quart and that seems to do what i need

quick cargo
#

quart is pretty good

#

if its purely for a API take a look at fastAPI

sturdy pike
#

Help me

#

Turn me into a django god

#

can u hear me

#

@craggy gale

craggy gale
#

nope

#

I heard nothing at all @sturdy pike

sturdy pike
#

I don't believe you

#

trolls

#

brb

#

someone come to chat

half bough
#

hi @dark hare no, I haven't tried using the default widget yet

#

@dark hare I guess I was confused on how to pass a DateTime value to my drop down

native tide
#

hey my flask server returns js files as text/plain when i include them like this:

  <script type="module">
    import {init} from '/js/file.js';

otherwise .js files have correct mimes. any ideas why this could happen?

#

i saw ppl suggesting to fix my windows mimetypes, i did, but the error still persists

#

i get this error:
Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain".

wind escarp
#

Did you omitt type="text/javascript" @native tide ?

native tide
#

i can't declare that when it's an ES6 module

#

also, it's the import that behaves incorrectly

wind escarp
#

Are you building an API?

#

I think it has more to do with how your request is sent and what is the Content-Type of response

native tide
#

the code above is how my request is sent

#

/js/file.js is interpreted as a text/plain, for whatever reason

wind escarp
native tide
#

no, but i'm serving this as a static file

#

i'm not gonna override all my static modules to an explicit request

wind escarp
#

right

#

well, I don't know any other options

native tide
#

me neither, btw this all got fd up on its own

wind escarp
#

I been working with flask too much for past few days, sometimes things work, sometimes they don't

#

better contact a flask ninja

#
I have implemented it on my blog but I need to configure the styles, and implement the ability to upload photos from machine.```
native tide
#

well it's not a fix and btw the web can go get coitus, but changing the extension from js to mjs solves the issue ...

wind escarp
#

what!

#

how is that possible

native tide
#

mjs would be the correct extension, but until now it was just a recommendation

wind escarp
native tide
#

yeah and now your whole project breaks because of this

#

classic web tech skiddery ever since 1990

wind escarp
#

I thought it would be more like changing the extension... or do you handle things for different extensions specifically?

native tide
#

nope

#

this is all in the browser

wind escarp
#

right

native tide
#

now i changed all the files and it works ๐Ÿ˜‚ unbeliveable

#

not to mention i'll have to change like hundreds of files in my other projects

wind escarp
#

Automate all da thingies

native tide
#

i am habing trouble trying to add a car icon using font awesome i downloaded the css but it isnt working. i have the code but still isnt working

distant trout
#

how does this user page look (im really bad with designing)

#

only using bootstrap and fontawesome for the icons

vestal hound
#

it looks serviceable

lyric jetty
#

hey guys

distant trout
#

thanks @vestal hound

acoustic oyster
#

It looks nice, I would consider centering the div that is on the left, then tucking the sidebar away on the right. But I am bad at that too.

native tide
#

Should be learn XML for flask data processing project

#

Or JSON

#

I already know some JSON so it should better if I learn XML aswell

zealous siren
#

XML isn't used as much

#

I wouldn't learn it unless you have a project you know uses it

sturdy pike
#

Can anybody explain simply what the meta class does in Django in one sentence?

#

If you say it in a way that I can understand i'll fly over to your house and finish you

fair agate
#

Having some issues with DB in Django, specifically trying to use Djongo (MongoDB) instead of SQLite3, things were working fine, now suddenly receiving database errors when I try to Migrate - anyone willing to lend a helping hand? ๐Ÿ™‚

#

Notably trying to set up Django REST Framework for API function to export JSON

#

not sure if that is an issue or anything

acoustic oyster
#

--flush migrate zero haha

fair agate
#

How does that work? Did a cursory search found nothing but I think the --flush is making it difficult to search it

#

I tried django-admin flush but it also turned up errors

#

did python manage.py flush || confirmed and erased, still producing errors when I go to migrate

tepid lark
#

Is it possible to have a Django user without a db backend? I'm looking at SSO auth options.

viscid forge
#

flask.cli.NoAppException: Could not import "project.project"

whats this>

sturdy pike
#

What's the best font for readability? Any suggestions?

#

Easiest, cleanest to see.

thorny scaffold
#

So fellow Django users, what do you prefer or think is better than the other: 1. Creating a custom user model or 2. using the default user model by forming a OneToOne relationship with your required models?

limber laurel
#

If anyone wanna work on a project together, dm or ping me (preferably in django) :)

willow iron
#

Heya

#

For those of you who don't know what DomeCode is,
I made a previous post on this subreddit about it, https://www.reddit.com/r/Python/comments/i9g0oo/made_a_platform_for_people_to_learn_code_practice/

DomeCode is an open-source application that helps you learn and practice code with the appropriate tools and a curated list of resources through the philosophy of practice. Itโ€™s a single workspace where you can advance your coding journey with compiled resources to learn programming concepts, take notes, plan tasks, practice coding problems, discuss interesting stuff on the Forum, meet other developers and most all have the musical element with all of it without ever leaving the single workspace to navigate to dozen platforms.

Open-sourced at: https://github.com/the-domecode Would love contributions and stars!

You can sponsor the open-source project at https://domecode.com/sponsor

GitHub

DomeCode helps you learn code, practice, discuss, take notes, plan and more with the appropriate tools and a curated list of resources from a single platform. - DomeCode

DomeCode is a platform that simplifies your process to learn code and provides you with other tools as well to help you learn to code. Get more, with less hassle.

#

If anyone wants to contribute to it, lemme know :))

wind escarp
#

i am habing trouble trying to add a car icon using font awesome i downloaded the css but it isnt working. i have the code but still isnt working
@native tide which version are you using?

native tide
#

Nevermind i fixed it

#

the latest

wind escarp
#

Okay

jagged sonnet
#

i am facing a problem with flask> can anyone help me?

wind escarp
#

What problem @jagged sonnet ?

jagged sonnet
#

when I change a static file (css), the changes are not showing in flask live server.

#

i have to clear the browser cache, then changes works

wind escarp
#

How are you including css file?
Did you use url_for or the normal one?

jagged sonnet
#

url_for

wind escarp
#

Try using the normal one

#

And run the server on debug mode to make it easy to see changes

jagged sonnet
#

i always run in debug mode

#

but it diidn't work.

wind escarp
#

:/ don't know really, did you deploy it yet?

jagged sonnet
#

no

#

running offline

wind escarp
#

Yeah that's the thing, I read a blog about this and they advised to use a content delivery network for this type of thing

#

After deployment of course

#

For now I think you should keep cleaning the cache or look up another solution

jagged sonnet
#

ok. thanks

wind escarp
#

Np

stray oracle
errant junco
brave elbow
#

I have a flask app where the current user can add employees to a SQLAlchemy employee class and projects to a project class. the current user has a one to many relationship to their employees and projects, so that users can only access their employees. I am now at the stage where I need to assign the employees to the projects via a many to many relationship. In order to do this, should I make a join table with just two columns, an Employee ID foreign key and a Project ID foreign key? Then when I query the table add a filter_by(backref=current_user). Or should I make the join table have 3 columns, adding the user ID as well? Basically I want to render a list of all the employees that are working on a given project, that belong to the current user .Im brand new to all things programming and Im trying to wrap my head around this.

distant trout
#

has someone ever worked with lightbox or lity? the css frameworks?

errant junco
#

Hey guys, im using next.js + nextauth.js in frontend with django rest api as backend:
The auth and it's provider and settings for it is taken care at frontend and when I signin I get the following data (example):

user object
{
  name: 'xxx',
  email: 'xxx',
  image: 'xxx'
} 

account object

{
  provider: 'google',
  type: 'oauth',
  id: 'xxx',
  refreshToken: undefined,
  accessToken: 'xxx',
  accessTokenExpires: null
} 

profile object

{
  id: 'xxx',
  email: 'xxx',
  verified_email: true,
  name: 'xxx',
  given_name: 'xxx',
  picture: 'xxx',
  locale: 'en'
}

How can I use the above data to login to django rest api?

{
  name: 'xxx',
  email: 'xxx',
  image: 'xxx'
} 

is available throughout the frontend btw, though I don't know if that's of any use in here
Please ping me when replying

glacial tapir
#

hey! I'm learning Flask and I'm doing the flask tutorial. Flask keeps defining things as special objects like g' and 'current_app' and I don't know what that means. I have a basic understanding of OOP but I don't know what a special object is. Is that specific to flask? From the goggling I've done I think it has something to do with being specific to each request? But I'm really not sure.......

uncut glacier
glacial tapir
#

thanks!

drowsy robin
#

Hello! Iโ€™m trying to click on instagrams heart button in the dm box but itโ€™s class name is the same for 3 other buttons and it has no name or Id. Anyone know?

woeful vapor
#

Can someone help me with Jquery and flask?

#

Im a bit confused

left jungle
#

ok. thanks
@jagged sonnet Hold shift and reload the webpage. That will change the cache

native tide
#

for flask can you do flash(render_template())?

wise plank
#

I'm trying to make my module runnable online, I know about Brython, any way I can have a text field that would run (with my module pre-installed) on a website?

#

So that when you click "Run" it would run the import my custom module and then run the code?

#

Not like a Shell interface, more like a text box

#

Please ping me if you have any ideas :)

topaz widget
#

So, I have a weird issue with Django where the DIRS list in the dictionary in the TEMPLATES list in the settings.py file appears to not be read when run on an actual web server, but it doesn't have any problems locally. Does anyone know what the problem might be here?

#

Nevermind, figured it out. Turns out the server requires an absolute path, whereas the localhost development server takes a relative path.

left jungle
#

for flask can you do flash(render_template())?
@native tide I do not understand why would you want to flash (render_template())?

native tide
#

You can't anyways, I was making a sign up page but realized I can render_template a new html file completely for the account verification

hallow moat
#

Hi guys, I'm currently working on an API server that featured login/register, email confirmation and password resetting options, I've decided that the use of JWTs for each option isn't good (due the that fact that I will have to create a blacklist for used tokens and use different "secrets" for each token so an attacker couldn't use them)

I thought about the following design, two tables:

  • users
  • tokens

each user can have multiple tokens (each token record contains an foreign key of the user id) and each token have a "type" column, the token type indicates it's purpose (e.g "auth", "emailverify", "passwordreset")

what do you think ?

native tide
#

can't you just gen tokens and give them an expiry date

hallow moat
#

@native tide that's not a solution for my second problem - I don't want to maintain multiple tokens secrets, I don't want people to be able to reuse the password reset token and I think blacklisting jwts is stupid

native tide
#

Why would you have to maintain or blacklist? When a user requests they want to change their password, gen a token with an expiry date of 15 mins, then an email is sent with their token and redirects to a new link. As soon as the link is pressed the token is used up, it can't be reused and is deleted

#

Are you using flask?

hallow moat
#

the technology here isn't part of my considerations, I'm talking about the design

the application code will get bloated if I use different secrets for each token (I already mentioned the various purposes)
although 15 minutes is indeed a short amount of time I don't want people to be able to use the reset link multiple times (and I don't want to create a blacklist for the used tokens)

native tide
#

Ok, so as soon as the token is used it can be deleted. Plus it can be stored in the user's session instead of a database. Look into itsdangerous

hallow moat
#

I think you got me wrong (+ I thought you meant to JWTs)
this isn't my problem here, I just asked a design question
storing this token in the user session is pretty useless

I want to create a generic token table, for authentication, email verification and password resetting, I asked for an onion about my idea for creating a "type" column

swift sky
#

hello

#

trying to figure out how to place an unordered list, horizontally

#

everything ive looked at online hasn't helped

#

this is what i have so far

#
                <ul class="menu">
                  <li><a href="{{ url_for('dashboard') }}">Dashboard</a></li>
                  <li><a href="{{ url_for('callagents') }}">Call Agents</a></li>
                  <li><a href="{{ url_for('schedules') }}">Schedules</a></li>
                  <li><a href="{{ url_for('jobsites') }}">Job Sites</a></li>
                  <li><a href="{{ url_for('reports') }}">Reports</a></li>
                </ul>
            </div>
        </nav></strong>
      </div>```
#

i knw it's supposed to be done in css

#

but everything ive tried doesn't seem to work xD

native tide
#

@swift sky so u wanna this be like nav-bar

swift sky
#

yes sir

native tide
#

use flexbox

#

display: flex;

swift sky
#

im googeling now

native tide
#
menu{

display:flex;
justifity-content: space-evenly;

#

try this

swift sky
#

that aint it chief

native tide
#

ik

#

show me a pic of current stats of the nav-bar

swift sky
#

stats?

native tide
#

how it looks

swift sky
#

would you like the html file?

native tide
#

give me the html file and css file

swift sky
#

!paste

native tide
#

just copy and paste the code here

swift sky
#
<html lang="en" dir="ltr">
 <head>
     <meta charset="UTF-8">
     <title>Staff Parent Template</title>
     <link  rel="stylesheet" type= "text/css" href= "{{url_for('static', filename='css/staffdash.css') }}">
 </head>
 <body>
     <header>
         <div class="container">
             <h1 class="logo">Exp Staffing</h1>
                 <h2 class="navigation-menu">Navigation Menu</h2>
             <strong><nav>
                 <ul class="menu">
                     <li><a href="{{ url_for('knowledge_articles') }}">Knowledge Articles</a></li>
                     <li><a href="{{ url_for('role_call') }}">Role Call</a></li>
                     <li><a href="{{ url_for('code_of_conduct') }}">Code of Conduct</a></li>
                     <li><a href="{{ url_for('training') }}">Training</a></li>
                 </ul>
             </nav></strong>
         </div>
     </header>

     {% block content %}
     {% endblock %}
 </body>
</html>
#

that's the parent template

#
<html lang="en" dir="ltr">
   <head>
       <meta charset="UTF-8"></meta>
      <title>311 Project</title>
   </head>
   <body>
    <h1> Welcome to the Exp Staff Dashboard </h1>
    <p> Choose your options below </p>
    {% extends "staff_parent_template.xhtml" %}
    {% block content %}
    {% endblock %}
   </body>
</html>``` thats the dashboard html
native tide
#

ok wait

swift sky
#
    background-color: powderblue;
    }

h1 {
    color: blue;
    }

p {
    color: red}

menu {
display:flex;
justify-content: space-evenly;
}```
#

that's the css

native tide
#

give indent to the display ;flex and justifity-content

swift sky
#

no difference when

#
    display:flex;
    justify-content: space-evenly;
    }```
native tide
#

hmm

#
#menu {
    display:flex;
    justify-content: space-evenly;
    }
#

try this

#

wait

#

try that

swift sky
#

nothing

native tide
#
.menu {
    display:flex;
    justify-content: space-evenly;
    }```
#

try this

#

we are styling the class so to style the class we need to use .whatever name of the class

swift sky
#

i see

native tide
#

worked?

swift sky
#

but no

#

it might actually be

native tide
#

give background-color: blue;

swift sky
#

<h2 class="navigation-menu">Navigation Menu</h2>

#

since it's under that h2?

#

idk...

native tide
#

no

swift sky
#

give background-color: blue;
@native tide what do you mean

#

ill change it to blue

#

huh that's weird that didn't do anything either

#

so that didnt do anything

#

but odly

#

when i accidentally changed

#
    background-color: powderblue;
    }

h1 {
    color: blue;
    }

#

to

#
    background-color: blue;
    }

h1 {
    color: blue;
    }
#

it still didn't change anything

native tide
#
nav{
  width: 90;
  display: flex;
  justify-content: space-evenly;
  background-color: blue;
}
#

this should work

swift sky
#

nope

#

i dont think my style sheet is working properly

#

it didn't pick up the change in what i wrote above

native tide
#

What browser u using?

swift sky
#

friefox

#

err

#

sry

#

chrome

native tide
#

u using chrome?

swift sky
#

yeah

native tide
#

oh ok

#

press ctrl + shift + i

#

u will see developer tool

distant trout
#

@app.route('/streamers/<string:streamer>')

#

is there anyway I can access the <streamer> in jinja2

native tide
#

{{string}}

distant trout
#

I tried {{ request.endpoint }} but i get the function name of the route

swift sky
#

im on a mac

native tide
#

@swift skygo to setting

distant trout
#

<h1 class='text-center p-4'>Showing Stats For {{ string }}</h1>

#

this doesnt work ๐Ÿ˜ฆ

swift sky
#

ok

native tide
#

@distant trout u need to pass that string into def home(string)

distant trout
#

oh

#

it worked... thank you so much @native tide

native tide
#

np

#

@swift sky did go to chrome setting

swift sky
#

yes

native tide
#

not setting

#

sorry

#

did u see more tool

swift sky
#

when i did cntrl shift i

native tide
#

yeah

swift sky
#

no

#

but do you want me to inspect element

native tide
#

have u seen 3 dots

#

in google chrome

swift sky
#

ahh ok

native tide
#

press that

swift sky
#

foudn the dev tools

native tide
#

ok

#

go to network and press disable cache

#

and keep it there

#

don't close that

#

ok

swift sky
#

ok

#

done

native tide
#

now

#

lets go back to code

#
nav{
  width: 90;
  display: flex;
  justify-content: space-evenly;
  background-color: blue;
}```
#

try this

#

and refresh the web page

swift sky
#

ok that worked

#

however

native tide
#

nice

#

show me the pic

swift sky
native tide
#

ok

swift sky
#

should we try flex box O.o

native tide
#

give

swift sky
#

?

native tide
#
a{
  text-decoration: none;
#
.menu {
    display:flex;
    justify-content: space-evenly;
    background-color: red;
    }
swift sky
native tide
#

ok

#

ok

swift sky
#

alright

native tide
#
li{
  list-style: none;

#

and remove the background-color: red;

swift sky
#

ok

#

letters are clumped togetehr

native tide
#

show me>

swift sky
native tide
#

ok i have to go bye

swift sky
#

ok thank you!

#

very helpful!!

#

๐Ÿ™‚

native tide
#

np

upper horizon
#

Heyy can someone help me with this issue please?hacktober_pydis

alpine barn
#

For an admin panel with Bootstrap (I'm going to use a template) and MySQL integrations, should I use Django or Flask?

weak lynx
#

Hi Good Night,Im making a blog and i have a question... for each post in the blog do i have to create a html for that post? does the blogs work like that?

#

i mean... i have let say a bueprint for each post i will create... do i have to use it to create each post and create a post1.html and the for the second one a post2.html and like that?

hollow yoke
#

hey guys! ive never used py for web development but is it the same as normal py or is it modified for web dev

warm igloo
#

@weak lynx You could have a blueprint for reading posts that you pass the post number to and it pulls the data from the db. So, you'd have a post template, and depending on what post id you send it, changes the content.

So, your url might be /post/<id>/ and you're looking up id in your db, and filling it's details into a jinja template you render.

Assuming Flask for all this since you mentioned blueprints.

#

@hollow yoke Same Python. Look up frameworks like Flask or FastAPI or Django (not that any of them are required, just they're frameworks for web dev in python as a place to get started).

hollow yoke
#

do i need to know html for this?

#

i know VERY little html so i'd have to get cracking on that

tidal flame
#

ya if you want to use flask, you should know a bit of HTML

native tide
#

So I'm looking to make a webserver to make a secure authentication system for a project I'm using. If I were to use a raspberry pi using my home-internet would it be safe / if it was ddosed would it effect my router.

#

I know the question is most likely stupid but when it comes to this web development and hosting and ect; my brain hurts.

native tide
#

@native tide home hosting is never safe

#

you will be exposed to the Internet and if you don't have any ddos protection installed (which I howly doubt since ur asking this question) then home hosting is not ideal

native tide
#

alr thank

heady hearth
#

hello, I'm facing a problem in fetching data from the database, while I'm try to do

#
x = mongo.db.fms.find(query1,{"_id":0,"due":1})
print(x)
#

im getting

<pymongo.cursor.Cursor object at 0x7f96939b9198>

#

please anyone help me to fetch the data

lean saddle
#

i am begging u please tell me how to fix the responsive problem on ipad like website is ok on all devices but on i pad it looks like a dustbin is the @lofty orbitia screen and (max-width:770px){} my only solution

#

dude sorry i cant fix the tag

#

med so sorry discord is glitching

sturdy pike
#

peter please turn me into a django god

#

I'm beggn u

lean saddle
#

i am talking html and css

#

and guys saying django

#

mi man i dont even like external stylesheets like bootstrap or any other

#

cause they so complicated for small things

sturdy pike
#

wait. I just realized you were talking up top. I didn't even read it I just saw you typing something when I swapped over to this chat

#

we literally said the same thing "im begging u"

#

I was talking randomness

#

Maybe I can help you

#

What's the deal

marble carbon
#

bruhh you tagged someone named med

lean saddle
#

ik thats y i am sorry

sturdy pike
#

He's got a really aesthetic face tho

#

tbh

lean saddle
#

anyway the site is showing abrupt things when i check it out on ipad

sturdy pike
#

lmao wut. abrupt?

lean saddle
#

aka a mess

sturdy pike
#

What's the problem, peter.

#

Is it not mobile responsive

lean saddle
#

let me show u can i send pics

#

it is

marble carbon
#

ye

lean saddle
#

its not ipad responsive

marble carbon
#

lol

lean saddle
#

cause ipad width 768 px

sturdy pike
#

lol thunder wth

#

hm

#

Use bootstrap

lean saddle
#

noooooooo

sturdy pike
#

lol y not

marble carbon
#

lol show css

lean saddle
#

its weird

sturdy pike
#

thunder always uses it

lean saddle
#

i use pure css

#

and html and js

marble carbon
#

@sturdy pike BRUh wut

sturdy pike
#

OH you're a purest

marble carbon
#

he likes it vanilla

sturdy pike
#

thunder don't lie I know you hate css

lean saddle
#

nope a noob

marble carbon
lean saddle
#

i dont have the time to learn bootstrap

sturdy pike
#

lol

marble carbon
#

lol

#

it is literally just css classes

sturdy pike
#

^^

lean saddle
#

but i never used it

sturdy pike
#

you type words into the class attribute and it does everything

#

dead simple

#

as "net ninja" would say

marble carbon
#

I mean you can either use bootstrap in your project orr

lean saddle
#

can u send me exact code for alligning divs in a column on ipad that too centered ,divs are arranged in a row in the pc version

marble carbon
#

you could change ur breakpoints

#

holdup

sturdy pike
#

I think thunder is going to do it

#

holdup

#

I told you my boys a genius

marble carbon
#
// Small devices (landscape phones, 576px and up) 
@media (min-width: 576px) { ... }
 
// Medium devices (tablets, 768px and up) 
@media (min-width: 768px) { ... }

 // Large devices (desktops, 992px and up)
 @media (min-width: 992px) { ... }

 // Extra large devices (large desktops, 1200px and up)
 @media (min-width: 1200px) { ... }

sturdy pike
#

wtf

lean saddle
#

so i just copy paste this

marble carbon
#

no lol

lean saddle
#

and then define classes in it

marble carbon
#

you didn't even show me ur css

sturdy pike
#

Aw shit.

lean saddle
#

let me

sturdy pike
#

Show us your css peter

#

in

lean saddle
#

.cardContainer:after {
content:"";
display: table;
display: flex;
clear: both;
}

marble carbon
#

uhh buddy

sturdy pike
#

thunders got this

marble carbon
#

can u post it on codepen or smth

lean saddle
#

this is the pc version

#

it stacks the divs in a row

marble carbon
#

@sturdy pike btw you wanna learn django?

#

check out Corey Schafer on YouTube

lean saddle
#

in mobi they are in a column done via a width 100%

#

now on i pad i need 2 divs in 1 row

marble carbon
sturdy pike
#

yeah hes legiti watched it

#

I'm actually not that bad. I just want to take it beyond

#

I still feel scrubish

marble carbon
#

hmm

sturdy pike
#

Wait peter

#

I'm going to invest into you

#

I know css. Tell me what you want to do

marble carbon
#

wait..

sturdy pike
#

wtf

marble carbon
#

if you're using flexbox

#

why do u need media queries ๐Ÿ™ƒ

sturdy pike
#

Don't you need them for changes in your css based on screen size?

marble carbon
#

I mean he only wants the cards to wrap according to width

#

not like he's changing card size or any other style

sturdy pike
#

dang dude.. this is why you dont go to the web dev section in a python discord channel

#

tru

#

He totally gave up on us.

#

So thunder are you good with django?

marble carbon
#

yeah lol I work with it professionally

sturdy pike
#

ah shit!

#

We should be friends

native tide
#

hello everyone

lean saddle
#

so should i learn django

sturdy pike
#

No tran don't do that to us at 1 am

lean saddle
#

no

#

i am just using

marble carbon
#

ig

native tide
#

do I need to know OOP well to start learning Django?

sturdy pike
#

I don't use social media at the moment. literally deleted everything and phone broke but @sturdy pike

#

maybe ill be back

#

well not literally deleted. just the aps

marble carbon
#

Ig > i guess lol

sturdy pike
#

lmao aw shit

marble carbon
#

why would I want ur Instagram

sturdy pike
#

I was like why does he want to see my face. I'll do what i must to be a django god

marble carbon
sturdy pike
#

^ exactly

marble carbon
#

just add me on discord

sturdy pike
#

YES

lean saddle
#

a ok i need to go thank u sir

marble carbon
#

anw back to Peter

#

lol wut... have u given up on us

sturdy pike
#

I totally get it.

#

I guess i'll go back to my endless youtube cycle with django. brb.. maybe*

marble carbon
#

Lol hold up

sturdy pike
#

holding

native tide
#

I would love to XD

sturdy pike
#

I'd accept that offer

#

tran leave

native tide
#

no

marble carbon
#

ok dm me lol

sturdy pike
#

plz this is my shot

native tide
#

I couldn't

marble carbon
#

wdym

native tide
#

I'm new here XD

marble carbon
#

yea bruh u need to add me

native tide
#

just started learning Python

marble carbon
#

oh cool

native tide
#

I'm struggling at OOP

marble carbon
#

hmm u don't need

#

much oop

#

but just basics of classes

native tide
#

I do know classes class/instance vars and objects

marble carbon
#

and how to work with them

#

dead chat

hushed dawn
#

Hello django developers!

#

I wanna add authentication to my website, should I better use default authentication system by django, or should I make my own auth system, or may be there some powerful packagaes for authentication?

hushed dawn
#

Thanks, who will help

tame lintel
#

there's "all auth" third party app for authentication

hushed dawn
#

Thanks, gonna check it

native tide
#

โ˜๏ธI hope someone's going to benefit from it here

flint breach
#

django's auth via permissions is preety satisfactory for a lot of use cases

#

unless you want third party auth or social logins, it should suffice

native tide
#

hey im making my first website, does anyone know what i need to put in the terminal to get the adress?

dapper tusk
native tide
#

app = flask(__name__)

@app.route('/')
def index():
    return render_template('index.html')

if __name__ == "__main__":
        app.run(debug=True)```
unreal fiber
#

Hi, I am a starter with Django and postgresql, is any front-end guy interested in making some cool websites as practice?

native tide
#

@dapper tusk

dapper tusk
#

huh, that should work

native tide
#

im on windows so is there a different command?

dapper tusk
#

try py

native tide
#

cause that the majority of my problems, that cmd's aren't the same as it is on apple

#

oh

#

ok

#

py or py3

unreal fiber
#

Py will just open python shell๐Ÿ™†โ€โ™‚๏ธ

dapper tusk
#

py app.py I meant

native tide
#

okok

unreal fiber
#

Have you added python to path?

dapper tusk
#

yup, windows has python3 open the store page of python, and if you pass any args, it does nothing

#

wonderful

native tide
dapper tusk
#

I think it is from flask import Flask

unreal fiber
#

Just open the html file manualy :)

native tide
#

ahhhh maybe so, the second flask being Flask

#

thank you so much, the whole problmen was me not paying attention to the capitalization

#

problem

#

i think i got it

sudden grail
#

Hey guys,
I am developing an app for discord teams who use it as their main communication channel and i make the front end with react and the design with tailwind.
I'd like to share with you all the version <alpha>, that's going to change, but the main concept is that.
I'm really looking forward to hearing opinions from you all.

The purpose of the app is making remote teams communication better. Its not a replacement of discord, its a third leg, what you can replace the routine meetings/big announcements with.
If you wish, you can notify specific discord channels when you create a post. You just have to enable "Notification" options and add your discord account. Select from the available channels, and the bot's going to send a notification to that channel with the link to the post.
Thats good for managers, team leaders and those, who'd like to get the most important things in one place, and who DON'T really like to ask the same questions each day,week,month etc.
The creator of each routines can have an analytics about the answers, getting the best overview how your team feel today, or what are their biggest goal etc.
Some features will be definitely implemented yet.
But enough of talking, please let me know what do you guys think! I am so excited! ๐Ÿ™‚

#

Is somebody interested in it?

weak lynx
#

@weak lynx You could have a blueprint for reading posts that you pass the post number to and it pulls the data from the db. So, you'd have a post template, and depending on what post id you send it, changes the content.

So, your url might be /post/<id>/ and you're looking up id in your db, and filling it's details into a jinja template you render.

Assuming Flask for all this since you mentioned blueprints.
@warm igloo Can you explainme how to do that?

native tide
#

@native tide did u install flask-sqlalchemy?

#

oml

#

how do i do that

#

do i need to use pip

#

yes

#

actaually my whole problem last night was that the commands were funky cause im on windows

#

what the commans

#

pip install Flask-SQLAlchemy

#

^^^

#

u always have to install flask extentions

#

pip install Flask-SQLAlchemy

#

in the terminal?

#

yes

#

pip is not recongized

#

wait what

#

is that a windows prompt?

#

try it on window prompt

#

no

#

what u using

#

like command prompt?

#

yes

#

i did '

#

same thing

#

that werid

#

pip is not recognized so i need a different command

#

cause i know i have it

#

u have env created

#

yup

#

oh

#

deactivate

#

what

#

just delete it?

#

no

#

wait

#

venv\Scripts\activate

#

activate the env now

#

i have the code to activate it so its fine if i need to delete

#

py -m venv venv

#

u have activated the env right

#

i already activated it

#

show me a pic

#

nice

#

its got the ()

#

now try pip install Flask-SQLAlchemy

#

how the fuck does that

#

work

#

i activated it last night

#

i mean thank you but i just dont understand

#

i think u installed pip while using env that why

#

worked

#

ahhh

#

ok does that install the datetime as well or do i need to do that next

#

datetime is in-built module

#

idk

#

oh

#

SQLALchemy is that supposed to be a l or an i?

#

L or i i mean

#
Requirement already satisfied: Flask-SQLAlchemy in c:\users\jansen\documents\flashintro\venv\lib\site-packages (2.4.4)
Requirement already satisfied: SQLAlchemy>=0.8.0 in c:\users\jansen\documents\flashintro\venv\lib\site-packages (from Flask-SQLAlchemy) (1.3.19)
Requirement already satisfied: Flask>=0.10 in c:\users\jansen\documents\flashintro\venv\lib\site-packages (from Flask-SQLAlchemy) (1.1.2)
Requirement already satisfied: click>=5.1 in c:\users\jansen\documents\flashintro\venv\lib\site-packages (from Flask>=0.10->Flask-SQLAlchemy) (7.1.2)
Requirement already satisfied: Jinja2>=2.10.1 in c:\users\jansen\documents\flashintro\venv\lib\site-packages (from Flask>=0.10->Flask-SQLAlchemy) (2.11.2)
Requirement already satisfied: Werkzeug>=0.15 in c:\users\jansen\documents\flashintro\venv\lib\site-packages (from Flask>=0.10->Flask-SQLAlchemy) (1.0.1)
Requirement already satisfied: itsdangerous>=0.24 in c:\users\jansen\documents\flashintro\venv\lib\site-packages (from Flask>=0.10->Flask-SQLAlchemy) (1.1.0)
Requirement already satisfied: MarkupSafe>=0.23 in c:\users\jansen\documents\flashintro\venv\lib\site-packages (from Jinja2>=2.10.1->Flask>=0.10->Flask-SQLAlchemy) (1.1.1)```
#

sligth issue

#

L

#

what

#

Alchemy is spelt with an L

#

scratch that

#

when i put from app import db in the python shell it says this File "<stdin>", line 1, in <module> File "C:\Users\Jansen\Documents\FlashIntro\app.py", line 2, in <module> from flask_sqlalchemy import SQLALchemy ImportError: cannot import name 'SQLALchemy' from 'flask_sqlalchemy' (C:\Users\Jansen\Documents\FlashIntro\venv\lib\site-packages\flask_sqlalchemy\__init__.py)

#

go to env

#

and what do you mean by that

#

did u type python

#

no

#

i typed py

#

in temerial

#

type

#

python

#

cause im on windows

#

it's ok

#

when i do it opend microsoft dtore

#

u can use python in terminal

#

ok im in

#

woah

#

from app import db

#

and show pic

#

hmm

#

is there something wrong with my code

#
from flask_sqlalchemy import SQLALchemy
from datetime import datetime

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.db'
db = SQLALchemy(app)

class todo(db.model):
    id = db.column(db.integer, primnary_key=True)
    content = db.column(db.string(200), nullabe=False)

    data_created = db.column(db.DateTime, default=datetime.estnow)

    def __repr__(self):
        return '<Task %r>' % self.id




@app.route('/')
def index():
    return render_template('index.html')

if __name__ == "__main__":
        app.run(debug=True)```
#

ok let me test this code

#

wait

#

there are different folders

#

i have app.py, index.html, main.css, and base html

#

u have app.py main file and templates and statics right

#

yes i do

#

it's ok

#

ik what to do

#

what is pychace

#

pychache

#

oh it's useless

#

oh ok

#

don't worry about that

#

@native tide try this command on terminal pip install flask_sqlalchemy

#

ok

#

just in the plain terminal or in the python sub thing

#

terminal where u installed all packages

#

ok

#

using env activated

#

what is teh actuvate code again

#

no

#

venv\Scripts\Activate

#

pip install flask_sqlalchemy

#

^ try this

#

ok

#

after installed

#

type python

#

from app import db

#

requirements satisfied

#

yes

#

now

#

so now i put python in

#

yes

#

then type from app import db

#

yes

#

press enter?

#

yes

#

ok

#

ok wait

#

i will

#

oh

#

what?

#

not from flask_sqlalchemy import SQLALchemy correct from flask_sqlalchemy import SQLAlchemy

#

u typed from flask_sqlalchemy import SQLALchemy

#

which is wrong

#

flask_sqlalchemy import SQLAlchemy

#

flask_sqlalchemy import SQLALchemy isw wrong

#

yes

#

from flask_sqlalchemy import SQLAlchemy is right

#

yes

#

silly mistakes

#

haha

#

now