#web-development

2 messages Β· Page 62 of 1

native tide
#

practice

earnest osprey
#

Yeah

native tide
#

You just gotta practice

#

@native tide Exactly

#

i found a book again.

#

Post it here

earnest osprey
#

@native tide I have watched already

native tide
#

so..? didn't it help

earnest osprey
#

I want dig deep down@native tide

native tide
#

Oh i understand

#

I'm new to django

#

i'm new to web dev in general xD

earnest osprey
#

Ohhhk
Thats a great video@native tide

native tide
#

I thought you were also a beginner

#

Sorry mate and you're welcome

#

if you like reading

earnest osprey
#

@native tide Thanks

native tide
#

Thanks

earnest osprey
#

I will sure give it a go

native tide
#

i saved it too

#

so i'll check it out when i learn

#

the basics and practice

#

Thanks for the help guys

#

Bye

half bough
#

Hi, a little confused by the action attribute in my <form> in flask. After I submit the form it renders the index page but it doesn't have my flashed message, it just says "Hello Index Page." I have the index page as the action, so shouldn't it display my flashed message?

routes.py

def login():
    form = RegistrationForm()
    if form.validate_on_submit():
        flash('Registration requested from user: {} and remember_me: {}'.format(
            form.username.data, form.remember_me.data
        ))
        print("True")

        #return redirect("/index")
    
    print("False")
    return render_template("login.html", form=form)

@app.route("/")
@app.route("/index", methods=["GET", "POST"])
def index():
    return render_template("index.html")```

index.html
```  <body>
        <h2>Hello Index Page</h2>
        {% with messages = get_flashed_messages() %}
            {% if messages %}
                {% for message in messages %}
                    {{ message }}
                {% endfor %}
            {% endif %}
        {% endwith %}
    </body>
</html>```

login.html
<body>
    <form action="/index" method="POST">
        {{ form.csrf_token }}

        <p>{{ form.username.label }}<br>
            {{ form.username(size=32) }}
        </p>

        <p>{{ form.password.label }}<br>
            {{ form.password(size=32) }}
        </p>

        <p>{{ form.remember_me() }}
            {{ form.remember_me.label }}
        </p>
        <p>
            {{ form.submit() }}
        </p>
    </form>
</body>```
blissful lion
#

I had more of a design question relating to user authentication/authorization rather than a programming one. Is there still a use case for session based authentication? I know that JWT / OAuth2 is fairly mainstream for larger applications, but I was thinking about using sessions for my smaller (pretty much a SPA) project.

#

I assume since I am only consuming the backend from 1 source (the web app), and since there will be not many users, session based auth would be okay for my use case but wanted to see what you guys thought.

dawn ore
#

@blissful lion Absolutely.

glass sandal
#

Guys why aren't u guys chatting bout Django?

tired root
#

@glass sandal Because everyone is using Flask

glass sandal
#

But y not Django?

#

It's better

#

Cooler

#

Batteries included

tired root
#

Because it is often overkill for tasks where you need little overhead

#

There is no "this is better", there is only "this is more suited to the task" in professional IT

#

gotta leave emotions out and concentrate on facts and requirements

glass sandal
#

Django has more job offers

#

Almost 100% more than Flask

obtuse crypt
#

πŸ‘

glass sandal
#

Django is a 1 package including all not like flask_admin , flask_sqlalchemy and ...

#

Django does this itself

#

And since it's rated 2nd in top backend frameworks , it's better than flask that is 5th

tired root
#

@glass sandal What is your problem here? Do you want to sell us on something?

#

I stand by what I said

glass sandal
#

So do I

#

So

tired root
#

Why are you arguing at all? If you came here to stir up trouble, then this is the wrong discord for that

glass sandal
#

I just said it's cooler and you didn't accept

tired root
#

We are trying to help people here

#

Not get lost in pointless like-wars

glass sandal
#

I mean

#

I rarely see any django in this channel

#

I was confused

#

So I asked

tired root
#

Then you aren't here enough

glass sandal
#

I've been here for last 8-7 months

tired root
#

but anyway, I am going to stop replying, this discussion is pointless

glass sandal
#

Yeah sorry for taking your time anyways

obtuse crypt
#

@tired root - I agree. I find myself going down rabbit holes when I'm trying to learn a topic, or I'm bombarded with this framework , that framework, or package and it just confuses the hell out of me and I end lost and lose interest

glass sandal
#

Yeah that happened to me alot too

obtuse crypt
#

We have to stick with a topic

tired root
#

Again, it's all about requirements. There are cases where Django is the choice and there are cases where Flask is the choice. To compare them head on is pointless and moot

obtuse crypt
#

Agree

tired root
#

Flask is really light-weight and runs nicely on my pi for example, for my radio project

#

for a big website I'd go with Django

obtuse crypt
#

It's all about Fit for Purpose

glass sandal
#

Want a Medium - Big project ? Go for django. Have a small - medium Project? Flask is the choice

#

I get it now

tired root
glass sandal
#

Nice !

obtuse crypt
#

That is nice. I like the color scheme

tired root
#

It runs on a Pi on my nightstand with a touch screen and it also serves the interface to my network

glass sandal
#

It's cool

#

You built it with Flask_websocket right?

obtuse crypt
#

@tired root, You got my gears spinning now for Pi projects

tired root
#

No, flask is only used for the web interface and backend

#

The bars come from Javascript Media API

#

well, it's a HTML5 canvas

glass sandal
#

Ik I mean the backend

tired root
#

but I load the stream with javascript and use the fft acquired from media api to display those bars

glass sandal
#

Oh I get it now

#

Well , you're a fullstack developer right?

tired root
#

I am not a developer at all

glass sandal
#

Ummmm

#

I mean

tired root
glass sandal
#

You built a radio using Flask and JS

#

And you're not a developer?

tired root
#

no

#

I work in a data center as Network Administrator, I mostly deal with cables, routers and traffic

glass sandal
#

Oh

#

I see

tired root
#

The most challenging part was the system level scripting actually

#

to make the networking changes etc

glass sandal
#

Oh

tired root
#

and fix the lazyness of radio stations

glass sandal
#

The low level stuff is done with C/C++ . How did you do it in Python?

tired root
#

There is no C++ involved

#

it's just changing config files

#

and restarting services

glass sandal
#

Oh I see

tired root
#

A specific user can run certain scripts with sudo without password

#

that is all the magic

glass sandal
#

Ohhh

#

Nice

#

gj . But you're a developer

tired root
#

I am really not. I am just an idiot with too much free time

glass sandal
#

And in that free time , you turned into a developer

obtuse crypt
#

Quarantine has created some free time for many of us

glass sandal
#

Lol yeah

#

But school holds me back a bit

#

Like we have final exams

#

So

#

Anyways

#

nvm

tired root
#

well, data centers are critical infra, so.. I still have to go to work

glass sandal
#

Oof

tired root
#

can't put it new optics from at home πŸ˜›

glass sandal
#

I see

blissful lion
#

@tired root offtopic but what type of background is needed for that line of work?

tired root
#

@blissful lion I'd say that depends on the company. I have a normal IT background, no special training. Should have some networking knowledge though. Like subnetting, IPV4 , IPV6, know how to read tcpdump and other things

#

maybe also have worked with real routers/switches

#

as in, Cisco/Juniper

blissful lion
#

gotcha, I'm going to school for a BS in Info Systems and an MS in Comp Sci, I really enjoyed my networking course and was thinking about getting some cisco certs myself

tired root
#

and know your way around Linux. Nobody uses Windows in that field

blissful lion
#

I have my own dell r710 server at home for some general automation, seems like a really interesting field to get into

tired root
#

That is sysadmin

#

my work stops at the last switch

blissful lion
#

ah, you do more networking gotcha

tired root
#

well.. it's called Network Admin for that reason

blissful lion
#

haha true

tired root
#

I manage switches and routers and their components, there is no copper in what I do, only fibre

blissful lion
#

I wish I could find an internship for a datacenter just to get a feel for it, but I'm not sure any companies would really have those :P

tired root
#

And about 8000 of them

blissful lion
#

dang thats pretty cool

tired root
#

we have data centers in multiple European Cities and POP all over Europe

blissful lion
#

that's awesome.

tired root
#

Cisco certs are kind of overrated IMHO. From what I know, nobody in my office has CCNA

#

but then, we are using Juniper

blissful lion
#

yeah, I kind of feel like some of the certs aren't that useful

tired root
#

it depends on why you do them. If you really want to learn, they are great. but many places offer brain dumps, only teach what is to know to beat the test

blissful lion
#

so I guess if I wanted to get into that field I'd probably just want to get a few routers / switches to mess around with eh?

tired root
#

Most only have them as decoration for their CVA

#

You don't want to get the routers we use

#

first of all, they are loud as fuck

blissful lion
#

yeah i bet they get pricey too

tired root
#

second, they set you back a couple of ten thousand

blissful lion
#

I mean like.. older L2 routers

#

not sure the goin rate for L3 routers lol

blissful lion
#

sheesh

tired root
#

that router is 160.000$

#

without line cards

quick cargo
#

That is one sexy fucking router

tired root
#

And just to nit pick.. Layer 2 is never routing. But I should really stop the off topic πŸ˜„

blissful lion
#

fair enough πŸ‘

zealous siren
#

Off topic but CCNA is not something I’d recommend. More and more is going SDN

tired root
#

@zealous siren Maybe in the developer world, not in the networking world

zealous siren
#

In general, I’m from sysops SRE field

tired root
#

The infrastructure on which all your virtual stuff runs, is old fashioned networks, because the Internet runs on it and needs it. All the things like SDN is layer 7 additions

#

So, if one works in the data center world of networking, these things are meaningless because my job ends before any of my cables come near any server

zealous siren
#

Ot2?

tired root
#

sorry I stop

pale radish
#

Does it make sense to obfuscate API calls between a framework like Angular and flask? I'm trying to figure out a way for users not to abuse the API.

tired root
#

@pale radish no

#

Because you need to deobfuscate it in js anyway

#

and js is user side

#

so save yourself the trouble

#

better idea is to cache, than to limit

#

use e-tags, so the content is only updated and resent if something actually changes

#

otherwise 304 is sent

pale radish
#

Thank you, I'll take a look at this. Have never made a production site but am trying to.

tired root
#

as a starter

zealous siren
#

agingbones, if abuse becomes a big problem, you will have to build anti abuse systems like looking for consistent calls, also requiring tokens and doing token expiration helps as well

tired root
#

drop the first tcp packet of every incoming connection

#

at your firewall

#

it must support flows though

zealous siren
#

We found websockets help just because they are harder to automated

tired root
#

first packet of every tcp connection is S

#

think about what happens if you drop it

zealous siren
#

another Syn is sent?

tired root
#

correct

#

but only if the sender was serious about the connection

#

ddos tools don't work like that

#

or amplification attacks

zealous siren
#

that's dumb as anti abuse setup and most requests libraries will handle that

tired root
#

it maybe dumb but it's very effective

pale radish
#

Hmm, okay, I'll just have to research more into it before I release to production. I don't have any users or sensitive data, but I don't really want all of the data I manually inputted to be mined instantly.

zealous siren
#

I think they are worried about people using the APIs outside a browser

#

it will be

#

selenium will see to that easily

pale radish
#

How do people protect against that or do they not?

zealous siren
#

it's pretty difficult to stop

pale radish
#

I just imagine there's a lot that I don't know about in regards to web frameworks that I'll massively fuck something up when I release

#

But I'll just research into more flask restful prod guides

#

and caching

zealous siren
#

We do SPA with REST API, caching/token expiration

#

there is also API Gateways that will help but they cost money

#

useful for business, not so much individual

pale radish
#

Where can you host SPA, API, MongoDB?

#

Heroku?

zealous siren
#

SPA is all Javascript so anywhere you have static HTTP engine

tired root
#

@pale radish Speaking of amplification attacks, make sure there is no path that release mass amounts of data

#

because otherwise it will be used for amplification

pale radish
#

Good idea, thank you, I'll research into protecting against that as well because I do have a few API calls that have quite a bit of data being returned

#

Looks like Heroku does have Mongo, but barely any space...

tired root
#

Another idea is also to generate a key based on IP and a web beacon, such as the famous browser pixel

#

and use that one as a api key

#

it may not stop the real hackers, but the script kiddies probably

pale radish
#

How do you all do storage in the cloud? without spending a fortune?

tired root
#

not sure how effective that really is though

#

My cloud server costs 5 bucks a month with 20 TB traffic and 20 gb storage. Not sure how much you need

#

you can get 100 gb for about 4 bucks

#

1 tb for 40

pale radish
#

Ah okay, that's not too bad

#

thank you

zealous siren
#

Using Blob Storage

native tide
#

Anyone know why i cant used ma.Nested with flask_marshmallow

static night
little turtle
static night
#

Thx

pulsar ivy
#

Guys how would you create login system without wtforms?

#

With wtforms it seems more complicated than it should actually be

rustic pebble
#

You can use a JWT

#

user puts credentials -> you verify credentials -> you said a JWT -> you use the jwt to identify the user

pulsar ivy
#

I was wondering will basic input field work?

#

I have database

#

I have registrate page

#

That works

rustic pebble
#

of course

pulsar ivy
#

And now i have to chabge everything cuz of log in

#

Or at least because every tut is done with wtforms

#

How?

rustic pebble
#

I would start looking on how JWT (json web tokens) work

pulsar ivy
#

Wont it save data in json file?

#

I am using sqlite

sullen roost
#

Trying to post a file with form data with requests.post
My payload is: {'batch': 1, 'file': opened_file} with opened_file from open.
requests.post(upload_url, files=payload)
But I'm getting error 400 and investigating with Wireshark I see
Content-Disposition: form-data; name="batch"; filename="batch"
And I don't want to send batch as a file. Just as a form item.

#

Wait would sending a int trip it up?

#

Nope, sending a stringified int didn't change it.

#

Still trying to send batch as a "file"

native tide
#

Anyone using flask marshmallow ?

#

its driving me crazy

rustic pebble
#

@pulsar ivy Try reading what a jwt is

sullen roost
#

Okay there we go. You're supposed to use the data keyword arg for other form data.

fiery tapir
#

Does anyone by chance have a link to a very detailed walk through on setting up a flask app on heroku? I keep having issues and it won’t start up the web process and not sure where I’m going wrong

native tide
#

do you have Procfile ?

#

i mean do you use gunicorn

fiery tapir
#

@native tide Yes to both of those

#

my heroku cli is actually telling me my Procfile is mis-cased

#

but it's spelled correctly and only the p is capitalized like it should be...

native tide
#

YOu cant even push on heroku or you get that H10 error on tails ?

fiery tapir
#

@native tide

native tide
#

So depoyment is done

#

when u go to the link you get an error ?

fiery tapir
#

yup, the application error screen

native tide
#

type heroku logs --tail

#

in ur terminal and see what eerror u are getting

#

if its H10 its prolly ur gunicorn set up sorry i have to sleep its really late just google the error u get from terminalk

robust apex
#

How to extract absolute xpath from a webpage without using selenium driver find by (looking for methods like beautifulsoup,lxml)

native tide
#

Hey hello guys

#

Any one online?

#

I am getting an error django is not recognized as an internal or external command

#

I know this is repeated to some path related issue

#

But can someone help me out

rain pawn
#

I know this is repeated to some path related issue
@native tide definitely path related try to install again with command line
If doesn't worked got to installed directory, find django-admin.exe and add it to path or open shell there and run your django-admin.py startproject command there

robust apex
#

Hi I want to use htmldom or advanced html parser to get back xpath from webpage is it possible ?

native tide
native tide
#

When trying to do ''flask run'' in powershell I get the error ''Fatal error in launcher: Unable to create process using \path\to\env\pyton.exe & \path\to\env\flask.exe ''. Yesterday it worked just fine, but today I get this error. I don't think I did anything differently. Anyone has any idea?

pulsar ivy
#

Hmm i am using

#

python -m flask run

native tide
#

well that does work

#

thank you

#

I don't understand why "flask run" worked yesterday though

#

but now it doesn't

limber laurel
#

So I am trying to use a cli command, but for some reason when I say flask command-name, it says that it couldnt find any command with that name

verbal obsidian
#

are you just writting flask command-name

#

?

#

@native tide What did you do to get that error message, be more specific

tame patio
limber laurel
#

@verbal obsidian Yes

verbal obsidian
limber laurel
#

No, but I will do now.

terse surge
#

hi peeps

#

is there a way for django to communicate with java?

#

like

#

i have django on a webserver

#

and

#

i want it to communicate with my gameserver via java

#

how can i do it?

#

except using databases to communicate

jagged lark
#

Well, you can do a web request to do that

#

Requests are following the same standard across languages

terse surge
#

ive made a django rest api before

#

working as it should

#

but then

#

it would make alot of web requests

#

so i removed it

#

on my mind

#

i want it to communicate like this:

#

web: hey someone bought smthing, can you execute the following command(s)?
java: yeah sure. Executed successfully.

#

this may work

half bough
#

I'm learning Flask and have come across url_for() which indicates is better than hardcoding a link. I don't quite understand why it's better because if you change the name of your function in your routes don't you also have to change it in your url_for()?

fluid vessel
#

In Jinja2 template name uses unix style path irrespective of platform?

native tide
#

if something is "app-level", does that mean it's INSIDE of an app folder? or does it mean that it's in the same folder that app folders are in (a.k.a. NEXT TO the app folders)

fluid vessel
#

In Jinja2 template name uses unix style path irrespective of platform?
I am getting "/" style template name even on windows

#

Got answer
jinja2 FileSystemLoader uses .replace(os.path.sep, "/")

stark mauve
#

Hi

#

If I wanted to have a dropdown selection that would query data from a DB and populate matching terms in an HTML table, how would I do that?

#

I already have a DB that does plenty of queries, saving to and from the DB. So the DB and most other functionalities, like an admin page, forms etc. They all work on my Flask project along with templates.

#

I use SQLite, Flask, wtforms

#

I just don't know how to do the opposite of that, which is, have a dropdown selectfield, that once chosen, would populate a table beneath it with matching results.

native tide
#

ah wait, just realized you're using Flask. it's probably similar though

stark mauve
#

Yeah it's similar

#

I found a solution though

#

Thank you!

tired root
#

@half bough Yes, but function names should be changed very rarely anyway. API should be stable, routes can be more fluid

nocturne goblet
#

Hallo

#

I need help here! The problem I installed djangorestframework in anaconda and I don't get the path django-admin

#

It says no directory and file

#

What path I need to add in cmd

#

Will anyone know?

terse surge
#

i hope u ran

#

have u added djangorestframework in installed apps?

#

if not

#

add 'rest_framework',

#

did u do pip install djangorestframework?

#

i havent used anaconda

distant trout
#
app.config['MAIL_PASSWORD'] = os.environ.get('EMAIL_PASSWORD')```
#

why is this giving me an authentication error

#

smtplib.SMTPAuthenticationError: (535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8 https://support.google.com/mail/?p=BadCredentials m33sm5709484qte.17 - gsmtp')

#

but when I use my real email and password instead of the environmental variables, it works fine

queen bough
#

@distant trout Print them and see if there are any trailing spaces or something.

distant trout
#

ok I misspelled my email on the environmental variables 😦

#

1 letter mistake and had me stressed out

terse surge
#

may you help me? ^

distant trout
#

who me?

terse surge
#

someone

distant trout
#

πŸ˜…

thick cove
#

Is it possible to change the scopes with django-allauth?
I'd like to request other permissions such as guilds, and remove email,

maiden tulip
#

Hi, I heard you can make django accessible in the network by using python manage.py runserver 0.0.0.0:8080 or simiar, but I dont get it to work. First time I tried there was a firewall popup which I allowed, program didnt have any issues. But I cant access the server, no matter if I try on the same machine or on my phone for example.
(windows)

tiny siren
native tide
#

Downloaded a website?.. What?

tiny siren
#

@native tide ?

#

The files

hallow jacinth
#

Could someone possibly help me with a question I have about flask?

quick cargo
#

whats up?

hallow jacinth
#

so from the tutorial I have seen after writing the app.py to start a local host, the adress comes up in the terminal. But when I run my file nothing happens πŸ˜† I don't even get an error so I am not sure what happened

cold anchor
#

slap this at the bottom of your file:

if __name__ == '__main__':
    app.run()

(assuming "app" is the name of the Flask app variable you created)

hallow jacinth
#

I have that at the bottom

#

i also have debug=True

cold anchor
#

this might be better suited for a help channel, then

#

as I'm not sure I really understood what's happening and I'd ask to see the app.py file and the command you're running to help more

hallow jacinth
#

okay, do I just go into one and claim it?

cold anchor
fickle fox
#
    username = StringField('username')
    password = PasswordField('password')


@app.route('/form', methods=['GET', 'POST'])
def form():
    form = LoginForm()
    return render_template('login.html', form=form)
#


{% block head %}
<title>Log in</title>
{% endblock %}


{% block content %}
    <div class="container">

      <form class="form-signin" method="POST" action="{{ url_for('form')}}">
        <h2 class="form-signin-heading">Please sign in</h2>
          {{ form.csrf_token }}
          {{ form.username.label }}
          {{ form.username }}
          {{ form.password.label }}
          {{ form.password }}

        <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
      </form>
#

why i dont see forms????

distant trout
#

@fickle fox is this from a tutorial?

fickle fox
#

yes qwq

distant trout
#

if so, this seems kind of confusing. I recommend you watch Corey Schafer

#

im following his flask tutorial

#

and i have learned so much

#

here is the playlist

fickle fox
#

oh okay ASpikaThink

distant trout
native tide
#

cs50w edx harvard

warm igloo
#

why i dont see forms????
@fickle fox

Do you see them in inspect element or view source?

cold horizon
#

I have a database with articles. Like, Articlename, Price, Description, Photos etc. Now im using flask with jinja-templating. When I want to display each article, I just do:

{% for item in article %}
  item.item['articlename']
  item.item['articleprice']
  <img src="https://loremipsum.com/{{ item['articlephotos'] }}">
{% endfor %}

Now when I have more than one photo I run into problems.
Right now I have Links of these photos in the DB like this:
(All links in one attribute and with comma seperated)

/static/images/artikel_1.jpg, /static/images/artikel_2.jpg, /static/images/artikel_3.jpg

Of courseI can seperate all these links and add to a new List but then they are not assigned to a single article anymore. All links of whole table are in that array.

Should/must I make a new attribute for every photo in my table?

frozen widget
#

What grant_type is better to use with django DRF + oAuth Toolkit? ROPC or Authorization_grant. Also could someone explain why.

feral minnow
#

how I can add a load animation to my page when the user click something I tried this ```html
{% if load == True %}
<p style="font-size: 15px;">Downloading</p>

      {% endif %} ``` but its not working also im using flask
terse surge
#

u need to add {% else %} the case if its not downloading

#

@feral minnow

feral minnow
#

@terse surgeI did it still not working

#

or its not going to work if I add else statment already?

#
    if request.method=="POST":        
        print("hi end")
        session["endChapter"]=form.endChapter.data
        print(session["endChapter"])
        return render_template("endCh.html",load=True)
        return redirect(url_for(re_direct))```
#

here's my flask code

terse surge
#

may you give me all the html?

#

theres prob a problem with if load

#

prob not defined

feral minnow
#
    <form method="post" name="ch"  action="/endChapter">
                <label>End Chapter</label>
                   {{form.hidden_tag()}}
                {{ form.endChapter }}
                {{form.submit}}
          </form>
          {% if load == True %}
              <p>yo</p>
              <p style="font-size: 15px;">Downloading<div class="loader"></div></p>
          

           
          {% else  %}
              <p style="font-size: 15px;">Downloading<div class="loader"></div></p>
              yo
        {% endif %}```
#

Im trying to add the animation to it

terse surge
#

undefined load

#

you need to define it

#

with a template tag

feral minnow
#

you mean something like this {{load}}

terse surge
#

no

#

even if the user is not downloading it

#

it will be displaying downloading

#

which you dont want to

#

could result in loss of users

feral minnow
#

I mangaed it in a way so when the user come to this point it must be downloading

terse surge
#

with django we add {% load static %} to load static files, so what you need to do is make a template tag and load it {% load templatetagnamehere %}

#

then

#

in ur template tag

#

you define load

#

i dont have time rn

feral minnow
#

ok np,thx for the help I will try to fix it somehow

terse surge
#

for flask

#

gl and have a good day

feral minnow
#

Thanks u 2 (:

little crater
#

Is flask around as good as javascript for web development, or is it kinda' janky and roundabout?

zealous siren
#

They serve different functions

#

Flask is backend, JS is used for front end

little crater
#

Dang it! I figured I might not know which was for which purpose but I took the risk anyways and I look more stupid now than if I had just asked πŸ€¦β€β™‚οΈ

pliant falcon
#

Hi guys, I made some changes in one of my template files(html) in my flask app, while the app is running, how can I restart and apply this changes

#

?

#

for now I just see the same as was before I made the changes

#

I tried to restart nginx but it's doesn't affect it

#

I just changed text

quick cargo
#

you dont restart the server

#

you just reload the page

#

If its deployed reload Cache

pliant falcon
#

I tried to reload on incognito mode and it's still didn't made the changes

#

now I rebooted the server and it's works

#

but I have to reboot each time?

#

I founnd that I can set a configuration of ```py
TEMPLATES_AUTO_RELOAD = True

#

I did it but it's not helping

#

maybe my python files don't affect aswell till I reboot?

#

Im using AWS so it's actually just pressing a button the reboot

rustic pebble
#

@pliant falcon you are using aws with a forwarded domain?

pliant falcon
#

@rustic pebble you mean.. if I point my domain to aws ns?

#

If so, yes I do

cold anchor
#

can you tell us more about your setup? AWS EC2 instance running both nginx and flask (gunicorn? waitress?) server to serve your flask application?

#

any cloudfront to serve static files? is nginx using a cache? is flask using a cache?

severe swan
#

Has anyone ever used Flask w/ Bootstrap & Autocomplete via JQuery? I am having issues with the styling of the StringField / SearchField.

bleak bobcat
#

hf with your mute

pliant falcon
#

@cold anchor Im using lightsail server linux-ubuntu, nginx and gunicorn installed I never setted a cache in any way with this app

native tide
#

hey peeps

#

I have a issue

#

It says no module named flask

#

even thought when I do pip install flask it says requirment already satisfied

#

so I know I have it installed

severe swan
#

whats the name of your file?

native tide
#

what could be wrong?

severe swan
#

what editor are you using? vscode?

native tide
#

yes

severe swan
#

and does it give you an issue when you run it or just in the intellisense thing?

native tide
#

issue

#

when I run

severe swan
#

You using a virtualenv?

native tide
#

oh

#

wait

#

there ya go

#

that's what I missed

rocky flume
#

vs code is good

native tide
#

yeah

#

hey

#

I get this issue

#

virtualenv : The term 'virtualenv' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
At line:1 char:1

  • virtualenv env
  •   + CategoryInfo          : ObjectNotFound: (virtualenv:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    

PS C:\Users\Julia Frank\Desktop\Flask Introduction> virtualenv flask
virtualenv : The term 'virtualenv' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:1

  • virtualenv flask
  •   + CategoryInfo          : ObjectNotFound: (virtualenv:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
native tide
#

can anyone explain me what format this cookie is in and how to convert to string?

raw drum
#

Hi guys, where would the best place be to add a styles folder for .css in your Django project?

native tide
#

static

native tide
#

how to remove excess whitespace

burnt mirage
#

@native tide Depends, but you might be looking for strip()

native tide
#

can you show me an example

burnt mirage
#

' okay '.strip()

native tide
#

i tried making the margin zero but it doesn't work

feral minnow
#

@native tide Did you close the tags?

feral minnow
#

Guys how to make "download" and the animation in the same line?

#
    position:relative;
    width:48px;
    height:48px;
    margin: auto;

}
``` the main css code
#
                <div id="circularG_1" class="circularG"></div>
                <div id="circularG_2" class="circularG"></div>
                <div id="circularG_3" class="circularG"></div>
                <div id="circularG_4" class="circularG"></div>
                <div id="circularG_5" class="circularG"></div>
                <div id="circularG_6" class="circularG"></div>
                <div id="circularG_7" class="circularG"></div>
                <div id="circularG_8" class="circularG"></div>
            </div>```
#

html

wild yew
#

Would web-scraping questions fall under python web-development?

feral minnow
#

@wild yew I see people ask about that here so I think its fine

cloud path
#

guys how can i render the datetime from the data in the database to the data of the user who is watching the page? (i'm using flask)

ionic ermine
#

need help with selenium webdriver

thick cove
#

Is it possible to change the scopes with django-allauth? (discord login)
I'd like to request other permissions such as guilds, and remove email?

limber laurel
#

Is the only way to get a variable from python into my htmp file using the custom variables whem rendering?

rustic pebble
#

@thick cove yes it is, check the discord docs

thick cove
#

@rustic pebble I'm using django-allauth for the verification

#

They dont provide a method to change the scopes as far as I can see

native tide
#

how do i post data w headers?

rustic pebble
#

@thick cove I believe you can

thick cove
#

@rustic pebble Can you reffer me to where I would do that, or the documentation for doing so?

distant trout
#

127.0.0.1 - - [30/May/2020 12:44:22] "GET / HTTP/1.1" 404 -
127.0.0.1 - - [30/May/2020 12:44:26] "GET /home HTTP/1.1" 404 -

#

when i run my flask project

#

no errors

#

when i go to the localhost itself, it gives me 404

quasi ridge
#

maybe you haven't defined routes for '/' and '/home'

#

can't tell without seeing it

distant trout
#

hmm, im following a tutorial and i might have missed something ill just double check everything

dry raft
#

Currently I'm experimenting, and I've made a couple endpoints for User and Group objects using the django rest framework's tutorial. I wanted to make a frontend list view that uses the user endpoint instead of directly using the User manager. I did get this working using the requests library. However, there's an incredibly large speed difference between hitting the endpoint directly in a browser, which returns in something like 20ms, and the requests.get('<endpoint url>') which takes something like 2-3 seconds. The relevant snippets of code, though I've done the requests.get() call in a terminal and also got the same speeds, so I imagine that specific line is the issue.

class UserViewSet(viewsets.ModelViewSet):
    queryset = User.objects.all().order_by('-date_joined')
    serializer_class = UserSerializer
    # permission_classes = [permissions.IsAuthenticated]


class TestConsumeJson(ListView):
    template_name = 'quickstart/list.html'
    context_object_name = 'user_list'

    def get_queryset(self):
        response = requests.get('http://localhost:8000/users.json') # Why is this part so slow? 2 whole seconds?
        users = response.json()
        return users['results']
#

I guess for completeness, the template is just this simple thing, which functions as expected and I don't expect it's problematic:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Lists</title>
</head>
<body>
    <h1>Lists works</h1>
    {% for user in user_list %}
        <p>{{user.username}}</p>
    {% endfor %}
</body>
</html>
#

Any ideas on why this slowdown is happening, or ideas on what I can check to investigate?

dry raft
#

Additional information: The headers sent with requests.get are {'User-Agent': 'python-requests/2.23.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}, and send a request to http://www.google.com with requests.get, using the same default headers, is not slow. I tried sending Connection: close due to a stackoverflow post I saw, but that didn't seem to help in my case.

glass sandal
#

Guys what is the best website to find HTML and CSS templates

#

Cause I don't like to waste time coding front end

#

Ummmm this channel is dead ?

dry raft
#

Might be dead, might be that nobody knows of a website like that off hand

wet yacht
#

if someone is familiar with flask and ajax, I could use some help figuring out why i'm getting dulicate POSTs sent

tiny siren
#

How can i stick on some background music on my website

#

And have it play automatically

verbal obsidian
#

if someone is familiar with flask and ajax, I could use some help figuring out why i'm getting dulicate POSTs sent
@wet yacht Give us some context & code

wet yacht
#

I have an input in my html file (doesn't make a difference if it's in a form or not)
<input type="search" class="monster-search" name="monster-search" id="monster-search">
I get each character typed by jquery
$('.monster-search').on('input', function() {
var monster_id = Number($('#monster-search').val());
console.log('.monster-search called with id ' + monster_id);

    //Send value to database and get monster information
    $.ajax({
       url: '/',
       type: 'POST',
       contentType:'application/json',
       data: JSON.stringify(monster_id),
       success: function(response) {
           console.log(response);
           //generate html to show result list in a div
       },
       error: function(error) {
           console.log(error);
       }
    });
});

In my app.py I get the data
if request.method == 'POST':
monster_id = json.dumps(request.get_json())
...do stuff with it and return...
return jsonify(monster_result=monser_data_reformatted)

#

hmm. it seems that adding event to the ajax function call and
event.preventDefault();
event.stopImmediatePropagation();
fixed it but why would it be posting in addition to the ajax call when there's no form being submitted?

tiny siren
#

@verbal obsidian That doesn't play automatically

#

Just adds music controls to the web page

wet yacht
#

ok here's an easy one:

<input type="hidden" name="csrf_token" value="IjJkNjgzZDExOTBjMTQ4MDJhNjIzZThkZTNhMGNiZmY0ZDVhOWU5YTgi.XtLYDg.MhTAe2BvGrut_ZCS30ixkAR83P4"/>

but $('#csrf_token').val() is showing undefined

#

why is it undefined and not the value of the csrf_token input?

dry raft
#

#csrf_token looks for something with the id csrf_token. Your input has that as a name, not an id

warm igloo
#

Have you tried the autoplay attribute of the audio tag?

Keep in mind: users are not particularly fond of autoplay music or videos. And browsers are moving to disable allowing it (if they haven't already).

paper sparrow
#

When you’re displaying image content with headers and you send the url (for example web.site/image.php)

Discord will show the image as intended. But it also caches it regardless of any cache headers. Any way to stop that?

cyan kettle
#

change the url to something like /image/randomstringlikeanuuid
then configure your routing to serve the image to any requests starting with /image or whatever you chose

#

there's also a clever method using url parameters for example

#

/thisthing.jpg?time=unixtimestamphere

normal vapor
#

Hello everyone, can someone explain me or give some resources about hosting a web app made in flask? I have previous expierience with PHP programming making websites ant hosting them is very easy and not expensive, but now I fell in love with python and flask and i tried to host my app on raspberry pi using docker (following advice form user from this discord) but it seems it is not possible becouse of some docker modules aren't aviable on raspberry pi. I started to look for some other solutions and it looks like its only possible on big services like azure aws etc. but they are pretty expensive, and i wonder why is that? Is there a cheap way to host/deploy a flask app? Wish you all health!

verbal obsidian
#

@normal vapor Check out, digitalocean, scaleway and companies as such's tutorials, they have many tutorials on how to deploy apps in vpss, these

#

are rather cheap, I use them alot for testing, can be as cheap as 3.5€ per month

#

Also you can definetely deploy flask apps in your raspberry pi, I'have done that many times

normal vapor
#

When you deployed on raspberry pi, were you using docker or just on the base system?

verbal obsidian
#

Docker

#

as of right now, I have 1 discord bot, 1 ngrok instance, 1 postgreesql cluster and 1 django app

normal vapor
#

I tried to deploy an app with 3 containers, one with app, one with mysql db and one with phpmyadmin, but i couldn't istall them on raspi becouse of the arm

verbal obsidian
#

what coulnd't you install of those three?

#

the arm shouldn't be an issue since there are versions for arm

#

with just a quick google search

normal vapor
#

I was looking on docker hub for those and didn't found, but now i see there are some actually, i will try again, thank you for advice!

verbal obsidian
#

You are welcome

native tide
#

had a question regarding django transactions, the documentation states that I cannot use try and except blocks within a transaction, however in my use case I'd like to be able to display an error specific to the nested transactions.

movie = Movie(title=title, plot=plot)        
with transaction.atomic():
    movie.save()

    with transaction.atomic():
        for a in actor:
            actor = Actor.objects.get(name=a)
            scene.actors.add(actor)
    # how do I catch an exception here to show actors failed to be added
    
    with transaction.atomic():
        for s in studios:
            studio = Studio.objects.get(name=s)
            scene.studios.add(studio)
    # how do I catch an exception here to show studios failed to be added
wise plank
#

Can almost everything that’s written in Js with websites be replaced with Python?

#

I’m have decent python experience but like no JS or web experience

hasty remnant
#

Javascript is front end

#

Python is used for backend

wise plank
#

Right, I’ll work with that

marsh canyon
#

you could look into brython tho

native tide
#

i want to ask sth too guys

#

for a simple web site which designed with fe langs(htm,css,js and more)

distant roost
#

How should i proceed creating an website in Python ? I've just heard about Django in general

native tide
#

and serving tihis site which one i should better to use

#

Django, Nodejs or Laravel

#

or others maybe

wise plank
#

Django vs Brython?

marsh canyon
#

brython is for frontend whereas django is used in the backend

native tide
#

@native tide yes, it is a tradition

#

when you open a site and press f12 or similar you can see a lot of stylesheets

#

index.html ->index-style.css
help.html -> help-style.css
.. -> general.css

#

.. stands for all

#

have fun πŸ˜„

native tide
#

well πŸ˜„ np

#

@marsh canyon do you have experience with any of these similar python/js things iv heard about jython too but man it looks like meme to me . I could understand a one time use for something really simple but how hard can it be to learn some jquery then to get minimal reactivness ...

marsh canyon
#

I am sorry, I don't

native tide
#

even better πŸ˜›

#

!paste

#

@native tide yes

#

Jython: is a Python library for writing java-like python code, its real :d

#

and you want to use python and javascript both

#

?

#

what about jsthon

#

is there even such a thing

#

@native tide i know what it is iv asked because someone was posting questins about it and @marsh canyon gave and answer so i tough he had some experience wiht it

marsh canyon
#

I have just seen people use it(or try it), example travery media on youtube has a video on brython, I just watched out of curiosity

native tide
#

ok, then

#

@native tide

toxic marten
#

About django user, should i use allauth or develop from scratch a custom user model. Allauth has a lot of features, and save time. I can allow users to login with socials network, email system features, built-in views, and more... But is it worth? Or should i develop from scratch? I dont know... someone can help me?

#

Im reading about it, and seems to be a nice ways to manage users

cold anchor
#

Don’t do it from scratch if you don’t need to. If allauth provides what you need, use it

dark hare
#

Good practice in django is to always use a custom user model before your first migration to make it easier to customise later on down the line. You shouldnt be writing a user login library from scratch, allauth provides pretty much everything you could want

distant trout
#

do you guys use camel case or snake case for writing javascript

cold anchor
#

Camel case is the norm for javascript

#

But since my apis are python I end up dealing with snake case api data anyway

distant trout
#

ahh okay, thanks

tiny siren
#

How fast would my website be if i compiled all of the web pages into a single html file

quick cargo
#

depends if youre loading it all at once with no AJAX or other bits of stuff it'll be slow as shitballs

#

and code will be messy af

cold anchor
#

Also depends how you define β€œfast”

verbal snow
#

How could i use mardown in HTMl

turbid onyx
#

Soo, im wondering if there's a way I can host my python script on a website, so i can access it anywhere?

#

It's also terminal based

quasi ridge
#

sure

#

there are so many ways, it's overwhelming

#

the way I do it: I "rent" an "ec2 instance" (just a virtual Linux machine) and just run the thing

#

tons of other ways though

turbid onyx
#

oh cool

#

ideally im looking for something free, it's just a little hobby thing im doing

quasi ridge
#

I think ec2 has a "free tier", but I bet there are others

#

I wouldn't expect a free setup to last more than a month or two, though.

#

unless the service is run by some long-haired commies πŸ™‚

#

(i.e., an open-source project or something)

turbid onyx
quasi ridge
#

I've never heard of it, but probably worth a shot

#

report back πŸ™‚

fiery tapir
#

What's best practice when it comes to Django/flask? Like where do you keep your web app's code itself. Currently on my first project I have my code in my flask's main.py file where I also hold my flask routes etc. Is it okay to keep it in there or should I split it off into it's own file and then import that into my main.py file?

#

I ask this because I'm trying to transition to using django but have no idea where to put my code. Models, views, etc.. im a lost man

quasi ridge
#

up to you

#

whatever works

native tide
#

vid_src = article.find('iframe', class_='youtube-player')['src']TypeError: 'NoneType' object is not subscriptable
What does 'NoneType' object is not subscriptable mean?

toxic marten
#

Good practice in django is to always use a custom user model before your first migration to make it easier to customise later on down the line. You shouldnt be writing a user login library from scratch, allauth provides pretty much everything you could want
@dark hare Ok thank you, i appreciate! @dark hare do you use allauth? And can you suggest me good reference?

tiny siren
#

Hi, how can i disable directory listing?

burnt mirage
#

@tiny siren That's usually a function of your web server

tiny siren
#

How do i do it

#

@burnt mirage

burnt mirage
#

@tiny siren I'd search the web server's documentation

tiny siren
#

Ok

tiny siren
#

Hello, i need some help auto playing music in html, nothing works

onyx crane
#

Django:
How can get "simple" user input without using forms. For example a button that increments a value in my database.
Would even that be done using a form or whats the normal procedure here ?

dry raft
#

@fiery tapir Flask I'm not sure on since I've only done a bit of it and have a narrow experience, but django has a pretty decent tutorial on the website. It'll walk you through a small project and should help you get a feel for what stuff goes where. It's sort of a lot initially, but give it a go and come back with questions!

fading forge
#

Greetz. I am looking for some EMT Dispatch software. My requirements are minimal just weekly dashboard and I can code/add options like moving events/trucks around the timeline

verbal obsidian
#

@onyx crane button that calls an ajax that calls a view that incrementes a value of your desired model.

#

Subscriptable means whether they implement the _getitem()

#

method

#

using [ ] calls that method

#

in that context

#

Most likely because vid_src = article.find('iframe', class_='youtube-player') returned None, It didn't find it

versed crest
#

Can any one help me to host flask web app to heruko?

verbal obsidian
#

What's your issue

native tide
#

Hi everyone! Is there any web app project on GIT that you could suggest for wrapping my head around all the basics? (Flask, SQLAlchemy, Werkzeug...)

This is going to be my first Python project, I eventually want to delve into ML after getting comfortable with the language though... so perhaps a WebApp with a bit of extra zing for added inspiration?

fading vortex
#

@native tide django

#

dont want to bust ur balls but ml is really hard

#

if its ur first python project then maybe something a little easier?

rustic pebble
#

up to you
@quasi ridge That is not really true, splitting up the views and the functions into services, helpers, views and more is crucial to building a correct hierarchy in which you can develop and maintain the product without having to go through hours of understanding your code. Having a main.py file contain only a small number of lines that really just launches the web server is ideal

strange pawn
glad swallow
#
def create_test_user():
    test_emp_name = 'test_employee'
    ​
    try:
       test_user = User.objects.get(username=test_emp_name)
    except User.DoesNotExist:
        person = create_full_person()
        test_user = create_user(person, default_role_name='Product Manager')
        
        view_track_tool_tab_perm = Permission.objects.get(codename='can_view_tracker_tools_tab')
        view_track_tab_grp_perm = Permission.objects.get(codename='can_view_tracker_tab_group')
        can_assign_items_perm = Permission.objects.get(codename='can_assign_items')
    ​
        password = test_user.__class__.objects.make_random_password()
        test_user.set_password(password)
        test_user.is_superuser = True
        test_user.user_permissions.add(
            view_track_tool_tab_perm, view_track_tab_grp_perm, can_assign_items_perm)
    ​
        test_user.save()
    ​
        return test_user, password
    ​
class ViewTests(TestCase):
    ​
    client = Client(HTTP_HOST=settings.TESTING_URL)
    test_user, password = create_test_user()
     
    def setUp(self):
        self.client.login(
            username=self.test_user.username,
            password=self.password)
    ​
    def test_enforce_kit_assign_limit_country_level_user_no_perm_with_tracker_setting(self):
        can_override_max_assign_items = Permission.objects.get(codename='override_max_assigned_items')
        ​
self.test_user.user_permissions.remove(can_override_max_assign_items)
self.test_user.save()
        ​
self.test_user = get_object_or_404(User, pk=self.test_user.id)

I would like to reset the permissions of my test user in order to test what the view displays when the given user does not have the specified permission. I am removing the permission as shown in the code above and then refreshing the database object. However, when I step through the code with a debugger, the test_user still has the permission I am trying to remove.

#

Is there a way to change this behaviour?

glad swallow
#

This is in Django by the way.

native tide
#

I follow along with Django Beginner tutorials

#

and with every single one of them that i follow along i get stuck here

#

python manage.py runserver and get this error ImportError: DLL load failed: The specified module could not be found.

#

before i ran python manage.py runserver i ran the following commands pipenv shell django-admin startproject personal-project .

#

i learned about pipenv hours ago

#

Hi guys,

CONTEXT:
I'm looking to contribute in a flask open source project some what beginner friendly.

CHALLENGE:
What I've fund so far are either no longer active for a year+ or not beginner friendly

NEEDED HELP:
Please share a link of an active ones that you know that helped you when you first started with flask.

thank you

tiny siren
#

How do i add username/password text here

native tide
#

with the html placeholder attrubute

glass sandal
#

Like :

<input type="text" placeholder="Username">
native tide
#

just like that

young grove
#

Hello, is here anyone that made a webshop/stock counter with python, flask and mongodb as database? please dm me asap

native tide
#

Since you brought up .txt

#

ohh let me look at thi ty

#

all i was really looking for was a way to make it visually obvious from looking at files what is being included how. I use inheritance, overriding blocks, and inclusuion

#

Ah, gotcha. Then yeah you'd want to pay attention to the extensions.

#

Would a better way not just be to to batch markdown all the mds at runtime and then include generated html to avoid that

#

having to do autoescaping

#

that is

#

You can enable escaping as well

silver flare
#

Hello! Is there any better/more simple way to count and display anonymous users browsing than with cookies? Using Django

dark hare
#

@toxic marten https://learndjango.com/tutorials/django-allauth-tutorial

WS Vincent is a fantastic resource.
The source code is good to take a look at once you understand urls-->views-->models etc
https://django-allauth.readthedocs.io/en/latest/
https://github.com/pennersr/django-allauth

native tide
#

I think its possible that Flask takes it out of the ballpark with homerun win for error messages that are never helpful and full of useless information lol

quick cargo
#

i get hardly any errors with flask tbh

#

and theyre normally very readable

dark hare
#

what errors are you getting?

native tide
#

Its typically issues with templates. i think.

#

Otherwise they arent that bad.

#

Im not having any atm but they arent very descriptive. They have a way of showing me something completely unrelated to the problem, and a lot of what they show is code i didnt even write so if tits the problem then there is something wrong deeper than my implemenation

#

sometimes you can make sense from it if you only read the top [art and ignore everything else it shows you

#

it might be more accurate to say that is a jinja2 thing

quiet solstice
#

@native tide You should run pip directly in the terminal, you are currently inside of the python repl.

#

You can type exit or press control + D to leave it.

native tide
#

I just ended up hacking it by adding a script on top of it that finds the spot in the document model and fucks it around

#

its hacky but whatever

native tide
#

I cant find templates

fickle basin
#

hey, am struglin to allow users to upload images inside posts with flask can anyone give a help ?

cold anchor
#

I can help with that, are you using wtforms?

fickle basin
#

yes

#

i got how to let the user upload a profile pic but when i begin to work on how to add images to content i struggled

distant trout
#

@errors.app_errorhandler

#

why is this not working with flask

quasi ridge
#

you've defined a tuple named errors on (I think) line 3.

#

See it?

#

Then later you use it as a decorator, Lord only knows why.

#

decorators gotta be functions, not tuples.

distant trout
#

OHH

#

i didnt realize that

#

thank you @quasi ridge

quasi ridge
#

sometimes it takes another pair of eyes

#

πŸ‘€

distant trout
#

πŸ‘

quasi ridge
#

πŸ’

high panther
#

I want to make a module that uses flask or aiohttp (or both) that will expose the public ip of a machine, taking over port 80 for it and handle certain requests sent to it
Does anyone know of a way to expose flask/aiohttp, assumedly the target machine will have to have a static ip registered in their router

drifting thunder
#

Hello everyone, Hope you are doing well.

I am building a website with django which will be used to view different documentation related to the construction industry, in an easy to use and share format.

The main viewer page will have a vertical nav bar with different chapters and sections. And the right side will be the content.

What I am trying to figure out is instead of doing a hardcoded HTML css static file, use the database to create a html file . What do you think is the best way to go about ir. I thought about it a lot and the problems I see is where there are lists/tables/images in content. I am having a hard time deciding what models should I create.

tiny siren
#

i have a custom login/register page in php in laravel... will it work in core php?

native tide
#

um @tiny siren this is the Python discord not The Coding Den or a php server

native root
#

You need to implement allow_migrate so that migrations only run on one or the other database

pseudo fjord
#

I'm facing an issue where I want to run a method that's bound to my app context, to return dynamic values to a FlaskWTForms SelectField... Does anyone have some ideas on an implementation..?

native tide
#
@import url('https://fonts.googleapis.com/css2?family=Montserrat&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

header {
    text-align: center;
    width: 100%;
}

.navbar {
    background-color: #2f2626;
}

.nav-logo {
    margin: 0 10px;
    color: #c5aa6a;
    border: 2px solid #c5aa6a;
    padding: 10px;
    font-family: 'Montserrat', 'san-serif';
    font-size: 20px;
}

.navbar ul li a {
    color: #c5aa6a;
    text-decoration: none;
    text-transform: uppercase;
    font-family: 'Montserrat', 'san-serif';
}

.navbar ul li {
    display: inline;
    font-size: 20px;
    padding: 10px;
    margin: 0px 20px;
}
``` css
#
<!DOCTYPE html>
<html>
<head>
    <title>Website</title>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <link rel="stylesheet" type="text/css" href="styles.css">
    <!-- CSS only -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
</head>
<body>
    <header>
        <nav class="navbar">
            <h1 class="nav-logo">NAV LOGO</h1>
            <ul>
                <li><a href="#">Home</a></li>
                <li><a href="#">Projects</a></li>
                <li><a href="#">About</a></li>
                <li><a href="#">Donate</a></li>
            </ul>
        </nav>
    </header>
    <!-- JS, Popper.js, and jQuery -->
    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
</body>
</html>
#

html

jagged lark
#

vertical-align:center

verbal obsidian
#

Green is navbar ul

#

if you set margin-top and bottom to auto

#

perfectly centered @native tide

#

I don't think vertical-align would do it

#

tho

native pasture
#

Hello everyone.
A quick question: I'm developing a website/app with Flask with dozens of pages. What's the best way I can keep a consistent css style? Like have themes, be able to change colors quickly, compile colors from a palette.
I have had previous experience with drupal and scss, I don't know if it's applicable here.

fossil thicket
#

i have a couple of colours and want to generate a scheme from them, any good suggestions on tools to use?

cloud path
#

guys, can i specify a maximum file size besides FileAllowed?

class UpdateAccountForm(FlaskForm):
    email = StringField('Email', validators=[DataRequired(), Email()])
    pic = FileField('Carica l\'immagine di profilo', validators=[FileAllowed(['png','jpg'])])
    cover = FileField('Carica la cover del profilo', validators=[FileAllowed(['png','jpg'])])
    submit = SubmitField('Aggiorna')
cloud path
#

done i think but i've another issue

#
            picname = secure_filename(form.pic.data.filename)
            pic_path = os.path.join(app.root_path + '/static/profile_pics/' + picname)
            form.pic.data.save(os.path.join(pic_path))
            current_user.image_file = picname

the image that i upload saves itself with its own name as i was not using secure_filename

native pasture
#
            picname = secure_filename(form.pic.data.filename)
            pic_path = os.path.join(app.root_path + '/static/profile_pics/' + picname)
            form.pic.data.save(os.path.join(pic_path))
            current_user.image_file = picname

the image that i upload saves itself with its own name as i was not using secure_filename
@cloud path what secure_filename should do is just remove reserved characters and make the filename safe for storage (ie. remove slashes and so on). Were you intending to do something else?

cloud path
#

oh no i thought it was a number generator for the filename

#

but

#

what if a user uploads two pictures with the same name?

native pasture
#

You're probably looking for a uuid or hashing function (+timestamp) then. I would go for the former.

cloud path
#

alright

#

thanks

native pasture
cloud path
#

thank you

native tide
#

@strange pawn Thanks for the Octoprint suggestion ! Hit the nail right on its head

strange pawn
#

Wasn't sure about that. But it's a webforntend in python that I use regulary and (at least plutgin dev) it's easy to learn. πŸ™‚

left flame
#

hello i've question what is the different between flask-restful and flask-marshmallow

wild thunder
#

guys, about jinja
i want to reference the profile pic of the user using the username,

I tried to do something like this :

<img src="{{url_for('olympo.static', filename='images/{{current_user}}.jpg')}}" class="user-image-twt"/>

but it's not working

mint umbra
#

hi, sorry if it's a bit of a random question but does anyone know how I can get this?

#

the preview thing when you send a link on a discord with a red bar to the left and all

native tide
#

@jagged lark @verbal obsidian Ok thanks guys it worked! btw how do you do that green part

#

it would help me

verbal obsidian
#

it's the equivalent of putting print's everywhere to see where you are at

#

it's not pretty but it works

#

just add inline style background-color = "whatevercoloryouwant"

#

@native tide

#

This is 'inline style' btw

#
<div style="background-color: red"></div>```
coarse surge
#

guys, about jinja
i want to reference the profile pic of the user using the username,

I tried to do something like this :

<img src="{{url_for('olympo.static', filename='images/{{current_user}}.jpg')}}" class="user-image-twt"/>

but it's not working
@wild thunder

mint umbra
#

does anyone know how to implement a discord preview thing

native tide
#

@verbal obsidian Thanks! i thought of using a text editor that does that automatically, so instead of sublime text i just found out brackets does it!

mint umbra
#

sorry if that was really unclear

wild thunder
#

i'm using flask, it changes anything?

@wild thunder
@coarse surge

mint umbra
#

trying to do something like the box that's showing under here

coarse surge
#

i'm using flask, it changes anything?
@coarse surge
@wild thunder u could try atleast

wild thunder
#

i did it now

#

thank you @coarse surge

#

worked nicely

lament sapphire
#

Hi is there anybody in here that uses a Mac that can help me with some Warnings I'm getting?

gritty barn
#

Is it possible to make a e-commerce website using only django? Or do I need to learn JS aswell

rustic pebble
#

@gritty barn Ideally you need to learn javascript as well in order to make good user-service interactions

distant trout
#

can someone help me understand how does deploying your flask website work?

#

i thought it was simple as taking my flask project folder and putting it in a cloud hosting sevice

gritty barn
#

@rustic pebble aight, thanks :)

rustic pebble
#

@distant trout what service are you using?

distant trout
#

@rustic pebble i was thinking of digitalocean free

rustic pebble
#

Flask uses gunicorn

#

You need to make an initialization file

distant trout
#

oh

#

ill look up a tutorial for that

#

also do u know how does deployment work in general

#

like I need a cloud service and what else

rustic pebble
#

For flask?

distant trout
#

yes

rustic pebble
#

You just need a web server service

distant trout
#

and thats guinicorn, that flask uses?

rustic pebble
#

gunicorn yes

distant trout
#

awesome, thanks

marsh canyon
#

@distant trout explore a bit about wsgi, then you will understand what gunicorn actully is and why u need it, its kinda interesting too xD

distant trout
#

ahh okay, ill read into that right now

#

thanks

severe mica
#

Hey all, anybody familiar with Django, I have a question about an error I am receiving while trying to edit models in the admin interface

#

<@&267629731250176001>

marsh canyon
#

Just put down your question and we are happy to help

#

you don't really need to ping mods

#

!ask

lavish prismBOT
#

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

β€’ Don't ask to ask your question, just go ahead and tell us your problem.
β€’ Don't ask if anyone is knowledgeable in some area, filtering serves no purpose.
β€’ Try to solve the problem on your own first, we're not going to write code for you.
β€’ Show us the code you've tried and any errors or unexpected results it's giving.
β€’ Be patient while we're helping you.

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

eager hornet
#

@severe mica don't ping moderators to ask for help, somebody will help in time

severe mica
#

ok will do in the future, my question is as follows: So i recently attempted to add another row to a model I created. I ran the makemigrations command as well as migrate and registered my model within the admin.py file. My question is why when I log into the admin page on my local server and go to add rows to my column, I am recieving an operational error which is telling me that one of my columns does not exist

#

my bad on pinging the mods as well, I am new to this group

marsh canyon
#

can you show the error page and code

severe mica
#

Is there a possibility that I need to move the durations column into the 0001 migrations file

marsh canyon
#

no

#

delete the migration files and the db.sqlite3 file then further do makemigrations and migrate again and see if it works

severe mica
#

ok ill try that

marsh canyon
#

did you delete the database file

severe mica
#

the db.sqlite3 file? sorry I am very new to Django, ill send a pic of the project im working in as I have just been following along from plural sight, so there is no db.sqlite3 file in the current app Im working in

marsh canyon
#

there will only be 1 db.sqlite3 file in the entire project, so delete that one

#

makemigrations generates all the sql code and then migrate executes it all into the database

severe mica
#

ok ill delete that and the 0001 file and try again

marsh canyon
#

kay

severe mica
#

do i need to create another superuser account after doing this

marsh canyon
#

yep

severe mica
#

ok one sec

#

ok that worked, thank you. also in the future am I able to simply edit my model class and add another column without going through this process

#

and then run the makemigrations and migrate commands

marsh canyon
#

yes

pure ice
#

Anyone know how to prepopulate fields on an inherited form in Django?

#

Maybe i dunno

minor horizon
#

Hey, is there a way to check how much time it takes to complete when a function runs in a flask server? I can create a decorator and add every function to it, but is there any easier and neat way?

pure ice
#

@minor horizon Can't you just put a datatime variable at the start of the function, then one at the end, and subtract the two then print the difference?

minor horizon
#

Yea I mean there are too many functions and I'm going to do it for every one of them. Sorry I forgot to specify that

cold anchor
#

is the function a view route?

#

I use this in all my apps:

def register_response_timer(app):
    """Add a response timer and logger to the app."""
    @app.before_request
    def start_request_timer():
        g._request_time_start = dt.utcnow()

    @app.after_request
    def end_request_timer(response):
        ms_elapsed = round(
            (dt.utcnow() - g._request_time_start).total_seconds() * 1000,
            2
        )
        Logger.info('finished request in {} ms'.format(ms_elapsed), extra={
            'ms_elapsed': ms_elapsed,
            'status_code': response.status_code,
        })
        return response
compact hedge
#

Hi, I'm learning Python Flask and followed a tutorial on how to make a blog (by Corey Schafer). Now I want to do an own beginner project. Does anyone have a suggestion?

valid ice
solar obsidian
#

hey im not like sure where to put it so ill put it here but i have a vps that i want to run a python website from with flask and i've install all it's dependencies but when i go to run the py file it says not module named... and so i was wondering if i would have to put this py file in a directory or something

heavy patio
#

Hey

solar obsidian
#

im running ubuntu-16.04-x86_64

heavy patio
#

I am on a web project in django and I need a guide, can you help me please?

solar obsidian
#

@heavy patio what do you need help wit

heavy patio
#

@solar obsidian
Part of my project is presence control and I want to generate a qr code that will contain the geographic coordinates of the presence control place.
Then I want to recover the coordinates, by scanning the code, and compare them with the coordinates of the one who scans the code (its geographical position).

#

I was able to write the qr code by inserting the coordinates of the presence control place. I also wrote the code to retrieve the user's contact details. But I still don't see how to make comparisons and approximations to manage this properly.

solar obsidian
#

im not that good

severe mica
#

quick question I am currently running the makemigrations comman to try and migrate the new models I just created and it says no changes detected after I run it. I have already registered my models within the admin.py file and am curious as to why it is not detecting my models

#

nvm just realized i forgot to install the app in settings LMAO

distant trout
#

im having trouble making a "delete account" button for my flask website, id appreciate sum help

#

i mean i got the button down, i just dont know how to make it so it deletes that currently logged in account from my Flask SQLAlchemy database

tiny siren
#

@distant trout i can't really help you.. i just wanted to say that it looks cool

distant trout
#

oh thanks lol :p

empty mantle
#

@distant trout , make an Ajax post request to your flask server with userID and perform the delete from the SQL database there. Can't help with the SQL query though sorry

distant trout
#

oh okay ill try to do that, thank you @empty mantle

empty mantle
#

In flask you will want something like

@app.route('deleteAccount',methods=['POST'])
def delete() :
   id=request.data["ID"]
   # do delete
cold anchor
#

make sure you authenticate it! don't want users deleting other users' accounts

upbeat shuttle
#

If I have a question about initializing a sqlite db from json in django, is that better asked here or in the databases channel?

lapis stump
#

Do people have recommended resources for learning about things like WSGI, Gunicorn, etc, basically anything deployment related? I've written Flask sites for personal use but never anything deployed.
(I know some tutorials cover basic setup for hosting, but I'd like to learn more background if possible.)

marsh canyon
#

he has bunch of articles on django, you can find the links at the bottom of his page

lapis stump
#

cool, thanks!

#

wow the recommended list at the bottom is all the questions I had

marsh canyon
#

πŸ‘

#

@lapis stump

lapis stump
#

πŸ‘

swift furnace
#

Hi all, I am creating a twitter based app and want to let other people authorise their account to be used by the app. where do I find good code implementation

native tide
#

Implement OAuth for that

frigid basin
#

Hi everyone) I`m creating web-app with chat with DRF and channels2.
I have a question: how I can add message to db and return to frontend new serialized message?
P.S. Sorry for my english

silent knoll
#

can anyone help me with flask installation?

jagged lark
#

Sure, what's up?

silent knoll
#

i did a pip install but i am not able to run flask
when i do pip list it shows flask but when i try to run it says command not found

quick cargo
#

you dont need todo flask run

#

an alternative is todo

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

which will achieve the same thing if flask isnt in PATH

silent knoll
#

@quick cargo thanks when i added if name == "main":
app.run() at the end of file it worked

quick cargo
#

πŸ‘

kind steppe
#

@young grove please don't offer money here, keep things in the server and free.

#

see #rules, specifically rule 6

tranquil steeple
#

I'm close to using my mac to smash my own head in

#

I've been trying to use flask to create a landing page for the last four/five days.

#

the only resources I can find online seem to either be for login pages or to do apps.

#

I'm trying to get information from a form using post

#

and then save it in a sqlalchemy data base is that correct?

silent knoll
#

@tranquil steeple django is popular these days

tranquil steeple
#

@silent knoll so you'd recommend using django over flask even for a simple email capture landing page.

#

?

silent knoll
#

depends; if you can't find any resources then you could use your time to build the app in django rather than flask

tranquil steeple
#

😫

#

more to learn

#

feel like not executing anything

young grove
#

Who can help me with a stock/inventory system for my python flask website. I prefer the database mongodb. Please @ me or dm me if you know how or you already have a system

verbal obsidian
#

I mean, I'm sure there are tons of flask resources for such a simple task

#

@tranquil steeple Is that all your landing page does? Form -> Save to db?

#

@young grove Do you have any specific question?

young grove
#

Yeh i want a stock inventory system

#

So i have a checkpoint on the atc button and on the checkout page where he checks the stock

#

If it is instock the user can purchase if he is out of stock the user can’t

#

@verbal obsidian

stiff totem
#

how can i join all ManyToMany field's values(name) in Django?

verbal obsidian
#

@young grove Okay that's great, any specific question or issue tho?

#

@stiff totem by join you mean associate?

stiff totem
#

@verbal obsidian well, i got these models

class Artist(models.Model):
    name = CICharField(max_length=600, unique=True)

class Track(models.Model):
    artist = models.CharField(...)
    artists = models.ManyToMany(Artist, ...)

verbal obsidian
#

The example here is almost the same as your model

stiff totem
#

sometimes there is artist value is None so i have to write manager method that gets artist value, if not i have to return artists name joined by space

young grove
#

@verbal obsidian i have to begin but i don’t know how so i ask here help to someone that already made a system like that or something like that

vestal hound
#

@stiff totem why do you want to do it that way?

#

seems a bit weird

mint umbra
#

I currently am trying to make a simple form

#
<form action="form" method="POST" class="formone">
    <input type='text' name='name' placeholder='John Doe' /><br/>
    <input type='text' name='message' placeholder='Your message'/><br/>
    <input type='submit' value='submit' />
</form>
#

however, I am not completely sure how I can make the form text boxes larger

peak dirge
#

Is there anyone that has alot of experience using Flask?

turbid glen
limber spade
#

hello, can someone experienced please DM me, i need answers to a couple of questions. THX

fickle fox
#

just post ur questions in here @limber spade

#

btw what would be csrf token??/

limber spade
#

Well, I'm a beginner in programming and I have an idea for a project. But my doubt is whether I should use Python or JS.

#

Basically I want to make a website where a user writes a letter and sends it, without knowing to whom

#

And only one random user receives it

#

and so on

#

Can I do this with Django?

zealous siren
#

@sour mulch Django and Flask are popular python options

#

fotea, you can use either JS or Python

fickle fox
#

u can do it easilywith flask

zealous siren
#

JS is worth learning even if you use Python framework for backend

limber spade
#

i tried flask and django and i like django more

fickle fox
#

then do it with djanfo if u are more comfortable with it

limber spade
#

i dont want to use multiple languages since im a beginner

zealous siren
#

do you wantt o be a web developer?

limber spade
#

i can make the front end with django too, right?

zealous siren
#

if so, JS

limber spade
#

i guess so

#

so then i should make my project in JS and node.JS

zealous siren
#

that will work

limber spade
#

ok, what tutorials should i follow for getting to learn JS and make a basic website for understanding, before i start with my idea?

zealous siren
#

find a JS discord server

limber spade
#

i did

shadow hornet
sour mulch
#

@zealous siren Thank you, sorry I didn't see this channel at all.

distant trout
#

<a class='btn btn-danger btn-md' data-toggle='modal' data-target='#deleteModal' href="{{ url_for('users.delete_account', user_id=user.id) }}">Delete Account</a>

#

can someone tell me why this is not working

limber spade
#

@shadow hornet wow that server useless

#

are corey's tutorials still good on JS, or are they outdated?

shadow hornet
#

i just pasted the one that you put down

limber spade
#

well thats the biggest one i managed to find

shadow hornet
sour mulch
#

Okay, so I'm super new to web development and I want to see if the website I'm going to have to refactor is able to use Django. Right now it uses ASP.NET and I'm unsure what I'm doing, how would I find out if it supports Django?

#

(As a note, Google really isn't helping me and despite my best efforts, I'm really not the brightest in terms of web development.)

zealous siren
#

.Net is Microsoft language and does not support Django

#

Microsoft has web frameworks, there is C# server that could probably recommend some

shadow hornet
#

you'll have to be patient @limber spade. you can't expect an answer immediately

sour mulch
#

Are there any resources to teach me about website domains and frameworks (at a definitive level) you guys would recommend?

zealous siren
#

frameworks are so unique that wikipedia article is about in depth as you need before you go with set of frameworks

sour mulch
#

Right, I'll try to look through it then.

pulsar ivy
#

Guys is role required module secure or nah?

nova sandal
#

@turbid glen did you find the answer for you transition??

turbid glen
#

@nova sandal no, I tried to change the css many times but still doesn’t work

nova sandal
#

@turbid glen i did some changes

#

i think it's working

turbid glen
#

I tried yours but the black circle moved. I want to hover the black circle and the cube move

nova sandal
#

@turbid glen ohh

turbid glen
#

Sry, didn’t make it clear lol

verbal obsidian
#

Strictly using CSS?

finite shell
#

What you guys use for REST apis ?

quick cargo
#

i personally use flask or quart

#

django also has a rest_framework

opaque vigil
#

Hello guys. I am a bit desperate for help. I need to figure out how to represent one to many relationship using Django Rest Framework with ImageField. Basically I want one of my objects to be able to have a list of images as his field.

native tide
#

I can program in html

peak dirge
#

Is there anyone that can explain to me how to pass information from my user through to a function i have created in my flask app?

candid totem
#

What do you mean @peak dirge ? Is this information comming from a form ?

peak dirge
#

I'm really new to all of this, but essentially it will be connected using AJAX

#

the form will be a match 3 game

#

which when the user clicks, will send the location of the 'gem' they clicked on

candid totem
#

gem ?

peak dirge
#

like in candycrush

candid totem
#

oh I see

#

Well the ajax doesn't matter really. What you want is to look at the request data. Let me show you two examples, one using GET and the other POST request.

#
from flask import Flask, request

app = Flask(__name__)


@app.route('/get', methods='GET')
def using_get():
    data = request.args

    return f'Data: {data}'

@app.route('/post', methods='POST')
def using_post():
    data = request.form

    return f'Data: {data}'
#

This is a really naive example but should help you getting started

peak dirge
#

cheers thanks for the help πŸ˜€

candid totem
real hare
#

Using Django here, and two of my paths use the same view. I want to modify one based on a user by user basis. What would this be called, and can someone point me in the way of docs for this?

#

so for example /posts/ and /profile/posts both use this same view

late gale
#

Guys i have spent 5 hours trying to solve this Here is my signals.py

from django.db.models.signals import post_save
from django.contrib.auth.models import User
from django.dispatch import receiver
from .models import Profile


@receiver(post_save, sender=User)
def create_profile(sender, instance, created, **kwargs):
    if created:
        Profile.objects.create(user=instance)


@receiver(post_save, sender=User)
def save_profile(sender, instance, **kwargs):
    instance.profile.save()

models.py

from django.db import models
from django.contrib.auth.models import User

class Profile(models.Model):
    user = models.OneToOneField(User, on_delete= models.CASCADE)
    bio = models.TextField()
    image = models.ImageField(default='default.jpg', upload_to='profile_pics')

    def __str__(self):
        return f'{self.user.username} Profile'

Views.py

@login_required
def update_profile(request):
    if request.method == 'POST':
        user_form = UserUpdateForm(request.POST, instance=request.user)
        profile_form = ProfileUpdateForm(
            request.POST, 
            request.FILES,
            instance=request.user.profile,
            )
        if user_form.is_valid() and profile_form.is_valid():
            user_form.save()
            profile_form.save()
            messages.success(request, 'Profile is updated')
            return redirect('/profile')

        
    else:
        user_form = UserUpdateForm(instance=request.user)
        profile_form = ProfileUpdateForm(instance=request.user.profile)

    context = {
        'user_form': user_form,
        'profile_form': profile_form,
        }

    return render(request, 'users/update_profile.html', context)
#

I have found that the error is coming everytime i add this
instance=request.user.profile

late gale
#

Please if someone found the mistake mention me

onyx crane
#

Django
views.py

def logout_request(request):
    logout(request)
    messages.info(request, "Logged out.")
    return redirect("main:home")

This works fine, as long as my current url is a basic one. For example website/faq. But whenever i got a dynamic url like : website/user/tickets/ticket_id
i get an error: website/user/tickets/ticket_id/logout doesnt exist.

zealous siren
#

@finite shell if you need nothing besides REST APIs, I highly recommend taking a look at FastAPI

native root
#

@late gale none of that code you have written implies that already present user objects will have profiles created until they are edited

#

As a result, the object does not exist, error

late gale
#

@native root I was following a tutorial and each user who registers have a profile and i did the same as he did and it didnt give the same error for him but for me

native root
#

In the comments is the same issue

#

when . you create your initail database it comes with a default admin user

#

whcih crucially never gets a profile created

#

The comments suggest either recreating it or creating a new superuser, but I suggest having a simple check to ensure the profile object exists before attempting to access it

late gale
#

but creating a new super user or creating user from the database is impossible because i wont make a profile for each user i just want it to be done programmatically

native root
#
@receiver(post_save, sender=User)
#

happens when a user is first created or edited

#

your current admin user was last created or edited before this code existed

#

Therefore it never ran, and therefore there's no profile associated

late gale
#

so that only happens when i create a super user

native root
#

Only on the very first development one

#

I believe if you restarted your db at the moment it would start working, but that's not a very elegant solution

late gale
#

what about if i want a user who just registered from the registration form to have a profile

native root
#

They would with what you have

late gale
#

I dont understand

native root
#

You're following this tutorial right?

late gale
#

Yes

native root
#

Ok

#

so at one point, you created an empty django project

#

and ran it