Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    jyoost
    @jyoost
    It allows you to do some really nice things without repeating yourself
    jyoost
    @jyoost
    Example in settings.py.
    TEMPLATES = [
    {
    "BACKEND": "django.template.backends.django.DjangoTemplates",
    "DIRS": [os.path.join(PROJECT_ROOT, "templates")],
    "OPTIONS": {
    "debug": DEBUG,
    "context_processors": context_processors,
    "loaders": loaders,
    "string_if_invalid": '<< MISSING VARIABLE "%s" >>' if DEBUG else "",
    },
    }
    ]
    megri
    @megri
    @jyoost I'll have a look. Thanks! :)
    I don't think it will work for my use-case as I don't use templates.
    matrixbot
    @matrixbot
    MARIOREDFOX Any one please suggest me about django channels, how to learn it fast and crisp and deep...
    Sean Parsons
    @seanpar203
    Are there any good django applications for creating online courses?
    Such as sections, videos and tests?
    Jenish
    @jenishacharya_gitlab

    hi
    how can we add image in header of a pdf report?
    i am currently using reportlab to generate a pdf and am having issue adding company's logo in the pdf's header(as letterhead)

    any idea how this can be achieved?

    Novski
    @novski
    @jenishacharya_gitlab do you store the file in static?
    Jenish
    @jenishacharya_gitlab
    @novski yes, it is stored in the static directory.
    i am able to add the image in document 's body but not header
    matrixbot
    @matrixbot
    Ajira Jenish (Gitter) do you have an exemple ?
    :]
    @elcolie
    Hi
    I am having IntegrityError with multiple databases
    Any here who has experience please share
    Jason Stokes
    @jpstokes
    Hey just created a new platform to help developers find jobs. Sign up for an account @ www.quirkycoders.com so that employers can find you.
    babytiger0929
    @babytiger0929
    Hello there!
    I have an error in digital certificate with bit4id.
    I can't sent challenge response to smartengine server.
    Please help me!
    Bush-Lee
    @Bush-Lee
    Hey, I've been looking into generic foreign keys, and I've been wondering if you can limit the field type choices for them

    For example if you have a model like this

    class Message(models.Model):
        message = models.CharField(max_length=100)
    
        source_type = models.ForeignKey(ContentType, null=True, on_delete=models.SET_NULL,)
        source_id = models.PositiveIntegerField(null=True)
        source = GenericForeignKey('source_type', 'source_id', )

    How can you limit the foreign key to be for only two or three types of models ?

    I've thought of adding a validator to the type field but I have a feeling there's a better way
    Max Wittig
    @max-wittig
    Is this the right place to ask questions, if one seached the Internet for a couple of hours?
    Max Wittig
    @max-wittig
    if so. Anybody knows how to do
    SELECT id, name, something FROM something

    without using values and by using database operations, when the model is more complicated?

    Example:

    class SomeComplicatedModel(models.Model):
        id = models.IntegerField(primary_key=True)
        name = models.CharField(max_length=2000)
        description = models.CharField(max_length=2000, null=True, blank=True)
        members = models.ManyToManyField("GitlabUser")
        url = models.URLField(null=True, blank=True)
        namespace = models.CharField(max_length=2000)
        KIND_CHOICES = [(GROUP_TYPE, GROUP_TYPE), (USER_TYPE, USER_TYPE)]
        kind = models.CharField(choices=KIND_CHOICES, max_length=20)
        update_uuid = models.UUIDField()
    
        def __str__(self):
            return f"{self.id} | {self.namespace}"

    How do I access only kind from using values?

    This is complicated as values is only accepting positional arguments. So I might be able to access id and name using
    SomeComplicatedModel.objects.all().values("id", "name")

    but if I don't need name, things get complicated

    Thanks for any help! Hope this is the right channel

    Sundeep
    @pidugusundeep
    Hey
    i need help with some project which i was unable to run as it shows Using the URLconf defined in djangosite.urls, Django tried these URL patterns, in this order: --> The current URL, , didn't match any of these.
    can someone help me
    matrixbot
    @matrixbot
    Ajira Hi sundeep, what is the url you tried to reach and what are the patterns in your djangosite/urls.py file ?
    matrixbot
    @matrixbot
    defiance There is (or used to be) a legit reason to start your urlpatterns with an empty string; I can't remember what that is or if it's still relevant; anyone?
    babytiger0929
    @babytiger0929
    hello, there.
    I have some error with digital signing with bit4id.
    That works on my local, but not on server
    if you have some experience with bit4id, please help me.
    ZhangWei1208
    @ZhangWei1208
    Please send me your screenshots.
    babytiger0929
    @babytiger0929
    thanks just a moment...
    image.png
    as you know, this is bit4id client.
    but it is closed if I send request with server.
    partnerize-mark
    @partnerizemark
    Hey, I'm looking for a bit of guidance, project looking to implement a custom backend database engine provided over HTTP any advice or guides or example i can use to get me started?
    babytiger0929
    @babytiger0929
    hello everybody
    I have an error in django migration
    error message is "relation 'srv_user' already exits
    please help me
    electronauts
    @electronauts

    Hi. How do I print all django 2.2 users?

    https://docs.djangoproject.com/en/2.2/topics/auth/default/

    List users:

    I do python manage.py shell

    and then run:

    from django.contrib.auth.models import User
    
    users = User.objects.all()

    and get nothing.

    Thanks.