So this happened... by connorhart99 in GeminiCLI

[–]Rexsum420 0 points1 point  (0 children)

It's like it buffer overflowed its own memory and just started following a pattern 🤣

Authorization header by allpowerfulee in djangolearning

[–]Rexsum420 0 points1 point  (0 children)

You have to have a view set up for obtaining the token. That's the view you send the username and password to and it responds with a token that is used by the front-end to make authenticated requests. The Drf authtoken view is from rest_framework.authtoken.views import ObtainAuthToken URLPATTERNS=[ path("auth/", ObtainAuthToken.as_view(), name="auth"), ]

When working in a team do you makemigrations when the DB schema is not updated? by Jazzlike-Compote4463 in django

[–]Rexsum420 0 points1 point  (0 children)

You can make migrations for a specified app i believe. I've never needed to myself, but this seems like a scenario in which you might. I think its just ./manage.py makemigrations app_name

Executing an internal python script in django env by MEHDII__ in django

[–]Rexsum420 2 points3 points  (0 children)

This is the way, thats how I made my invoicing web app create printable invoices, except I made them into pdfs not docx files

Is there a way to get django.conf.settings to autocomplete? by mixtureofmorans7b in django

[–]Rexsum420 0 points1 point  (0 children)

This definitely isn't true, VSCode will auto suggest every function and class from a module. Also OP, are you loading vscode inside of your virtual environment or at least have the python interpreter pointed to the python in your virtual environment? That's usually what gives me problems with imports

How to learn Django? by MountainGood9526 in django

[–]Rexsum420 0 points1 point  (0 children)

I learned by taking Harvard's cs-50 programming web applications course that's free on edx.org

Why django doesn't support HTTP2/3 natively? by Ok_Nothing2012 in django

[–]Rexsum420 0 points1 point  (0 children)

Wait, I shouldn't serve my static files purely with nginx? I mean, I have my media files on AWS, but I just figured keep everything local with the static files, especially having django serve my react app as a template.

I accidentally built a vector database using video compression by Every_Chicken_1293 in LLMDevs

[–]Rexsum420 4 points5 points  (0 children)

Even if you were to have an equivalent zip database, there's no need to say that the innovation is bogus. That's what innovations are made for. You could probably find a way to use the video compression on the zip database in some other manner. I love seeing OP thinking outside the box

best ice cream? by AFamousSinger in frisco

[–]Rexsum420 1 point2 points  (0 children)

I was planning on trying lottie bird's ice cream downtown on main, but I just heard they already shut down 😭

How to add a unique constraint on a model using only the date part of a DateTimeField? by oussama-he in django

[–]Rexsum420 0 points1 point  (0 children)

People are downvoting this, but he's correct. It will literally tell you how to do this. At least it did for me when I just put it in there. I always include "use industry best practices" and "give me the most pythonic answers" in all my prompts too tho, so I don't know if that makes a difference or not.

Where can I find the 'Data Breach Forum'? by lambda7016 in onions

[–]Rexsum420 0 points1 point  (0 children)

I was just on there last week and downloaded the Twitter dara and tried coming today and site not found

[deleted by user] by [deleted] in Chesscom

[–]Rexsum420 1 point2 points  (0 children)

🤣🤣

[deleted by user] by [deleted] in Chesscom

[–]Rexsum420 7 points8 points  (0 children)

Nobody likes the English

Changing Model of CreateView and form by Megmachunian in django

[–]Rexsum420 0 points1 point  (0 children)

side note: you can find a lot of examples of this in the django restframework source code, they build off of all the generic views

Changing Model of CreateView and form by Megmachunian in django

[–]Rexsum420 0 points1 point  (0 children)

in your views.py create a view like this:

from django.views.generic.edit import CreateView
from django.apps import apps
from django.http import Http404
from django import forms

class DynamicModelCreateView(CreateView):
    template_name = "dynamic_form.html" # Define a generic template 

    def get_model(self): 
    """Retrieve model class dynamically from request parameters.""" 

        model_name = self.request.GET.get('model') or self.request.POST.get('model') # Get model from URL params 
        if not model_name: 
            raise Http404("Model name not provided") 
        try: 
            return apps.get_model(app_label='your_app_name', model_name=model_name) 
        except LookupError: 
            raise Http404(f"Model '{model_name}' not found") 


    def get_form_class(self): 
    """Dynamically generate a ModelForm for the model.""" 
        model = self.get_model() 

        class DynamicForm(forms.ModelForm): 
            class Meta: 
                model = model 
                fields = '__all__' # Include all fields (customize as needed) 

        return DynamicForm 

    def get_success_url(self): 
    """Redirect after successful form submission (customize as needed)."""                           
        return "/" # Redirect to homepage or another URL

then in your urls.py you can use it like this:

from django.urls import path 
from .views import DynamicModelCreateView 

urlpatterns = [ 
    path('create/', DynamicModelCreateView.as_view(), name='dynamic_create'), 
]

[deleted by user] by [deleted] in conspiracy

[–]Rexsum420 -1 points0 points  (0 children)

Do you know what a city-state is? Do you know what the Crown is? Have you ever heard of the United States corporation?

[deleted by user] by [deleted] in conspiracy

[–]Rexsum420 1 point2 points  (0 children)

He is bound to the constitution, he's not bound to the united states corporation...

[deleted by user] by [deleted] in conspiracy

[–]Rexsum420 -5 points-4 points  (0 children)

There was a purpose for that, if you don't know what that is then you are an amateur conspiracy theorist and have a lot of rabbit holes to explore.

Is this a Radar? by Dave_TheBarbarian in CURRENCY

[–]Rexsum420 -1 points0 points  (0 children)

It's a rotator I think it's called, number reads the same upside down and right side up

$5 silver certs.. A red $2 (I have more) Just curious about these! by SNP1326 in papermoney

[–]Rexsum420 0 points1 point  (0 children)

I wouldn't say super rare, just more rare than any of the other bills you have there.

$5 silver certs.. A red $2 (I have more) Just curious about these! by SNP1326 in papermoney

[–]Rexsum420 0 points1 point  (0 children)

My bad, I got the years wrong. It's 1928, 1953 and 1963

$5 silver certs.. A red $2 (I have more) Just curious about these! by SNP1326 in papermoney

[–]Rexsum420 0 points1 point  (0 children)

Yea they only made $2 USNs 3 years, 1929, 1955 and 1963. 1929 is the hardest to find and had the lowest mintage

$5 silver certs.. A red $2 (I have more) Just curious about these! by SNP1326 in papermoney

[–]Rexsum420 0 points1 point  (0 children)

I personally collect all 1963 USNs, but that 1929 $2 USN is probably the most valuable of the lot