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z4X2qaCpW/GHS+XFccT1h8CxqsFxnAhnecjdMCv/TJLXMNk9LihEeUEZo
4U7bitCfyO17dt6NC/7wbGZCJmNPO7V3YYeI8MwzOkvmXqLcHz0IPQATuLMB1HKr
oG/Vrwq029ftqnuDluS/DzmuIqWLuAT+2nIe1JLWFlS9OUTi4i+y0NDlxWCZOaGp
ucR+ueFKv1de3nVjdd6oN+MIO9gQ3NE53FrO46A3APy6Ex02Mxub8nNnQjXcStHZ
BHO6KilQ+QLzSektD8IpHM7tR6P+5PP6AQ==
=NePe
-----END PGP PUBLIC KEY BLOCK-----
On 25/03/2022 16.44, webmba...@gmail.com wrote:
> Hi,
> how can i get mail notifications per each new django release?
> best regards
>

Subscribe to the django-announce mailing list:

https://docs.djangoproject.com/en/dev/internals/mailing-lists/#django-announce

Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ef745793-44eb-7016-9d3c-a152715eec8e%40stacktrace.dk.

Thursday, March 24, 2022

Re: FileNotFoundError at /login/

I did just that but now this error popped up on my visual code. Will i have to go into my setting.py file and create a new app for my models.py?

Exception has occurred: ImproperlyConfigured

Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
File "C:\Users\delvi\django_project\users\models.py", line 2, in <module> from django.contrib.auth.models import User

I also ran the web page but the same issue occurred. Would it just be the placement of my code that i made a mistake on?

Models.py file
from django.db import models
from django.contrib.auth.models import User
from PIL import Image

class Profile(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE)
    image = models.ImageField(default='default.jpg', upload_to='profile_pics')
   
    def __str__(self):
        return f'{self.user.username} Profile'

    def save(self, *args, **kwargs):
        super(Profile, self).save(*args, **kwargs)
       
        img = Image.open(self.image.path)
        file = open('media.ext')
       
        if img.height > 300 or img.width > 300:
            output_size = (300, 300)
            img.thumbnail(output_size)
            img.save(self.image.path)


On Thursday, March 24, 2022 at 7:19:00 AM UTC-7 shahsawoo...@gmail.com wrote:
1. According to your model, you meant the models.py file and default.jpg are in same directory.
=> But according to the error it smells that they are not same directory, so try to point to the exact relative path of the image.

On Thursday, March 24, 2022 at 10:10:13 AM UTC+5 Delvin Alexander wrote:
would anyone know why this is popping up for me and where can i go to solve this issue?

[Errno 2] No such file or directory: 'C:\\Users\\delvi\\django_project\\media\\default.jpg'

Here is my models.py:
from django.db import models
from django.contrib.auth.models import User
from PIL import Image

class Profile(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE)
    image = models.ImageField(default='default.jpg', upload_to='profile_pics')
   
    def __str__(self):
        return f'{self.user.username} Profile'

    def save(self, *args, **kwargs):
        super(Profile, self).save(*args, **kwargs)
       
        img = Image.open(self.image.path)
       
        if img.height > 300 or img.width > 300:
            output_size = (300, 300)
            img.thumbnail(output_size)
            img.save(self.image.path)


And here is my signlas.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()

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2f327270-7b90-43d1-88ce-65a52d4ed558n%40googlegroups.com.

Re: tutorial 1 problems from djangoproject website - not working, do not exactly understand

On 24/03/2022 08.05, harsh jain wrote:
> Still facing issue ?
> This course will help you - Advanced web development course online
>

Please fuck off with your spam.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bb7049a0-6a0b-4b4a-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IQBdBdAek9F2CX6whDbL4mZFAeY/e6e
mWmP8Y/z4X2qaCpW/GHS+XFccT1h8CxqsFxnAhnecjdMCv/TJLXMNk9LihEeUEZo
4U7bitCfyO17dt6NC/7wbGZCJmNPO7V3YYeI8MwzOkvmXqLcHz0IPQATuLMB1HKr
oG/Vrwq029ftqnuDluS/DzmuIqWLuAT+2nIe1JLWFlS9OUTi4i+y0NDlxWCZOaGp
ucR+ueFKv1de3nVjdd6oN+MIO9gQ3NE53FrO46A3APy6Ex02Mxub8nNnQjXcStHZ
BHO6KilQ+QLzSektD8IpHM7tR6P+5PP6AQ==
=NePe
-----END PGP PUBLIC KEY BLOCK-----
On 23/03/2022 12.55, Prashanth Patelc wrote:
> /I am getting this error /
> /please solve any one thanks in advance./
> /
> /
>
> django.core.exceptions.ImproperlyConfigured: Requested setting
> REST_FRAMEWORK, but settings are not configured. You must either define
> the environment variable DJANGO_SETTINGS_MODULE or call
> settings.configure() before accessing settings.
>

Instead of just copy-pasting an error message, try to learn how to ask a
question someone has a chance to answer.

Reading something like this will help solve your problem:

https://www.propublica.org/nerds/how-to-ask-programming-questions

Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5baee6cc-61d2-1a47-d443-ef84d9a1bd3a%40stacktrace.dk.

Tuesday, March 22, 2022

Recreation of foreign key constraints when changing type of referenced primary key

Hi,

I have a question regarding Django version 3.2.12.

When I change the DEFAULT_AUTO_FIELD to BigAutoField and create&apply
migrations, the foreign keys of auto-generated through tables are dropped.
This can be observed by running sqlmigrate which drops foreign key relations
but never recreates them.

I noticed this is already fixed in Django 4.0.3 (Refs #32743 -- Fixed
recreation of foreign key constraints when alter… · django/django@3d9040a ·
GitHub 1) but not in 3.2.x branch.

Can I expect this commit will in time be applied to Django 3.2.x branch? I
would like to migrate to BigAutoField to be future-proof, but would prefer not
to write migrations by hand.

Regards,
Gregor


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5821193.lOV4Wx5bFT%40delko.

Monday, March 21, 2022

Re: Using Admin to manage users that is not in django

Thank you!!
I will follow your instructions. I think this will be enough for my app.

Em seg., 21 de mar. de 2022 às 00:26, Aldian Fazrihady <mobile@aldian.net> escreveu:
Django admin is so coupled to Django models.
Django admin is customizable.

If you want some "integration" with your existing Django admin that is already linked to your existing models,
you can edit the Django admin index page template and put the link to your Samba AD DC management page.
Your Samba AD DC management page will be an ordinary Django app. 

On Mon, Mar 21, 2022 at 9:52 AM Thiago Luiz Parolin <tlparolin@gmail.com> wrote:
Hi.
I am trying to make a web app to manage samba AD DC.
Using python bindings from samba, i can access users/groups/features of our directory.
What i want is:
 - How can i use the django admin to manage AD? Because all the user base is inside samba, not in django.
 - Or i need to build my own 'admin'?

Thanks for any advice.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANbmKytFbGCezptTES%2BqEBebpsVQg0wYrnM129W7jRyR50xSxA%40mail.gmail.com.


--
Regards,

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAN7EoAaYh2H6A_31ehLktAzN7-W%3DTA_0vzqNiWT34nBovMb5Pg%40mail.gmail.com.


--
Thiago Luiz Parolin

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANbmKytBfy57YDCva1xpYS_q4%2Bau%3Dc5ky5qAhY%2BZPZ6JG-SQ8g%40mail.gmail.com.

Sunday, March 20, 2022

Re: how to split in multiple file class models.py?

Sorry for reviving an old topic, but I have a models.py file that is >15,000 lines and would like to chop it up (PyCharm is groaning under the weight!).

How would I handle the imports between the chopped-up files in a models module where the referenced foreign key model is in a different file?
Is there a risk of circular imports?

Thanks,
Richard Brockie

On Monday, February 1, 2021 at 11:45:25 PM UTC-8 andrea...@hypercode.se wrote:
So,

Boney M's assumption here is correct.

You just need to import all of your models in the __init__.py file using relative imports, so for example:

from .car import Car

and so on.

This works perfectly and I usually try to split the models in that way as not to get a models.py that is over 10000 lines long.

Regards,

Andréas


Den tis 2 feb. 2021 kl 07:27 skrev Benny M <chib...@outlook.com>:
Just a thought, I haven't tested this: you might be able to trick access to subdirectories by importing those models in the top-level models/__init__.py - now that I think about it, you might have to do that with all the models... so your __init__ file would say something like:

```
from .car import SomeModel
from .otherPackage.other_model import SomeOtherModel
# and so on ...
```

Again, I could be way off here. I've never looked at the magic that parses the models on migration creation.

Best,
Benny

On Jan 30, 2021, at 5:44 PM, Manuel <emanue...@gmail.com> wrote:

Hello everyone, I have a question about Django and the use of namespaces or packages to split the models.py file.
I would like to adopt the Java philosophy in which one file corresponds one class and one db table.
I tried to follow this guide, but it doesn't work.
https://docs.djangoproject.com/en/3.1/ref/applications/#namespace-packages-as-apps

when I execute this command: "python manage.py makemigrations myapp"

Return this warning: "No changes detected in app"

Is it possible to do this structure?

/models
    __init__py # if i use package, or without for namespace
         #common import
    car.py # class car
    group.py # class group
    manufactor.py # class manufactor
    /otherPackage
        __init__py
            common import
        otherClass.py

I hope you understand what I'd like to do.
Thank you.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6cdc67de-94cb-4ad3-8c73-bc91da02b8bfn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4d7d9586-5ff6-4012-aa55-96e9f4ab6a5en%40googlegroups.com.

Adding postman generated code to django

Hello everyone, django beginner here. I'm trying to build a whatsapp chatbot using the documentation here: https://api.messengerpeople.dev/docs/authentication I've used postman and generated a token and I also notice there was a python code automatically generated. Would the next step be to create an authentication app inside my project and paste this code inside a function created inside views.py?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3b851426-3e0f-430c-963b-c3dd3dac4296n%40googlegroups.com.

Saturday, March 19, 2022

Re: ML NER Model not executing completely while running on Django view

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsDNBGBJfrABDACxIFOMQIsP94wTkgf76JEHyTITmYnprsTeRmDet01G5etZ9ZHm
RmrqYVFzXu1aSBbaejm/ppbRrBB7YmFETbpnZepWJnuhridvjV37duRH3g/9ppiy
tNkhOOIYA/l8ppvyaRlrp/jPjAm27HVxi1Nu0syaWwTFKbUTtLKldIhuWvAXkgxp
xyBdB3jfmKoJ4rvTzZU+saKgaFExRmdd5TptwRP9cPRWIoR5fcRA8RQ1X66NkIpl
VBbH7NeLuTtICAa0dnyTh50x+Wapu1kDEWmr8ssUzf6c8yBJAHKBohQowZmQ8sYt
w2h4gX0zT4V3TY9y8TvTFGhPlM7l5QRFBlZqCBp5K/6xkyaAf+VlUwsdMqe8UOz5
mMJ5ZLU9JEzFyfSiM8xScwIzPcyQhOiLAgqIozTag+9B6QgD66Xa80yrFmfXyVtU
OtS6ykQsepR/fq6ySUKjWGFJ/Psq0wNuBaCHzEwEfeShZquL/jXmcUFJhVbeDYIZ
cPngktFCZ30fYuMAEQEAAc0mS2FzcGVyIExhdWR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m6
a80wqUVL6gJSyuWLrZ+2h3NDyMsJWNDB9ThZQBkFxZtXP/HY2skmZJi0WIOfMdyB
hQyZK23xbitGI7ltMkNU81nN5a0/Pj7103AthalS63YY5worNdDeolBDLyI5xH+t
p3Rdu4EAEQEAAcLA/AQYAQgAJhYhBLmmWQG+W3QPqIUOLuXZysZKqlXrBQJgSX6x
BQkFo5qAAhsMAAoJEOXZysZKqlXrbHsL/0rWbmkdYmZ+Wdj9vrhxoxM8WDp3bCdr
5E1bziJYkG+VuEejk60rlURO6dZ9uJMtDnKMTZdJ26cN01iwWG/O83pOL9vyMOj5
q+XC4nmi4DV/N2wneBH4VyNfv1fNubDrE0M8iXX/WECIG2RSE0N6C4RfKIC03ysl
L4lnhSc426Bnxkf8sZm+oFo4ian0GcuNdIQBdBdAek9F2CX6whDbL4mZFAeY/e6e
mWmP8Y/z4X2qaCpW/GHS+XFccT1h8CxqsFxnAhnecjdMCv/TJLXMNk9LihEeUEZo
4U7bitCfyO17dt6NC/7wbGZCJmNPO7V3YYeI8MwzOkvmXqLcHz0IPQATuLMB1HKr
oG/Vrwq029ftqnuDluS/DzmuIqWLuAT+2nIe1JLWFlS9OUTi4i+y0NDlxWCZOaGp
ucR+ueFKv1de3nVjdd6oN+MIO9gQ3NE53FrO46A3APy6Ex02Mxub8nNnQjXcStHZ
BHO6KilQ+QLzSektD8IpHM7tR6P+5PP6AQ==
=NePe
-----END PGP PUBLIC KEY BLOCK-----
On 19/03/2022 02.41, Sunday Ajayi wrote:
>
> I deployed a ML function  via django api . when the API is called , it
> does not execute completely and does not throw any error message.
> But if I run the function via the django shell, it runs completely fine.
>
>
> I am using Gunicorn  and Nginx to deploy in AWS with 30GB RAM and 15GB GPU .
>
> Please, what could be wrong ?
>

That's impossible for anyone to tell since no one here has any idea what
your function looks like or even what it's supposed to do.

Try to ask a question that someone can actually answer if you want help.

Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c0464226-0b63-40ff-77f8-9253947cdd8f%40stacktrace.dk.

Wednesday, March 16, 2022

Re: Got an error creating the test database: database "" already exists

Yes I run migrations still I am seeing the new issue below
```
django.db.utils.ProgrammingError: relation "auth_user" does not exist
```
Thank you 
~Salima

On Wed, Mar 16, 2022 at 9:23 PM DJANGO DEVELOPER <abubakarbryar@gmail.com> wrote:
you need to run migrations first and then run the tests. if the issue still persists. let me know

On Wed, Mar 16, 2022 at 2:15 PM Sebastian Jung <sebastian.jung2@gmail.com> wrote:
Hey salima,

This error is strange. Django try to use a Relation in postgresql which doesn't exist.

I have only tip that you cam reset database. I would delete database in postgresql and create it new with psql tool. After this you must reset all migrations:


And after this when you migrate it, then structure is created in new database.

I am sorry i have no idea how yoz can fix relation exception manual.

Regards


Salima Begum <salima.b@rohteksolutions.com> schrieb am Mi., 16. März 2022, 06:51:
Hi all,
After writing test cases I run test cases I am getting an error below
```
Python manage.py behave
```
After running the above command I am getting this error.
```
Creating test database for alias 'default'...
Got an error creating the test database: database "test_newDataBase" already exists

Type 'yes' if you would like to try deleting the test database 'test_newDataBase', or 'no' to cancel: yes
Destroying old test database for alias 'default'...
Traceback (most recent call last):
  File "C:\Users\USER 1\PycharmProjects\behaveproject\venv\lib\site-packages\django\db\backends\utils.py", line 86, in _execute
    return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedTable: relation "trades_trade_table" does not exist
.....
.....
django.db.utils.ProgrammingError: relation "trades_vk_trade_table" does not exist
```
Please help me to resolve this issue.

Thank you
~Salima

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMSz6b%3DTEv%3DH25L7giQV6w%3DYw6%3D6GJrvh5zPezqQWMger3VNzQ%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKGT9mx2sRizWo8Qd%3Dn6yYFKUB1KvjKH%2Bi92Hj_fdoStRYc%3DWg%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKPY9pkx0hJ3U_DFCia_UUY-ecieMJ0%2BE3uE75aTziehr1KWSg%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMSz6b%3DZTCYy%2BY1NoRSh9t0S0UcLkwcSb_31SYqzOg95SU%2Bq6Q%40mail.gmail.com.

Re: How do detect if template is being viewed on mobile device?

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsDNBGBJfrABDACxIFOMQIsP94wTkgf76JEHyTITmYnprsTeRmDet01G5etZ9ZHm
RmrqYVFzXu1aSBbaejm/ppbRrBB7YmFETbpnZepWJnuhridvjV37duRH3g/9ppiy
tNkhOOIYA/l8ppvyaRlrp/jPjAm27HVxi1Nu0syaWwTFKbUTtLKldIhuWvAXkgxp
xyBdB3jfmKoJ4rvTzZU+saKgaFExRmdd5TptwRP9cPRWIoR5fcRA8RQ1X66NkIpl
VBbH7NeLuTtICAa0dnyTh50x+Wapu1kDEWmr8ssUzf6c8yBJAHKBohQowZmQ8sYt
w2h4gX0zT4V3TY9y8TvTFGhPlM7l5QRFBlZqCBp5K/6xkyaAf+VlUwsdMqe8UOz5
mMJ5ZLU9JEzFyfSiM8xScwIzPcyQhOiLAgqIozTag+9B6QgD66Xa80yrFmfXyVtU
OtS6ykQsepR/fq6ySUKjWGFJ/Psq0wNuBaCHzEwEfeShZquL/jXmcU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Vh3wIjNsocQprDU9OEBxZ5S8LmiFqFNdPlt6FqzNOb6hTK8Xm6
a80wqUVL6gJSyuWLrZ+2h3NDyMsJWNDB9ThZQBkFxZtXP/HY2skmZJi0WIOfMdyB
hQyZK23xbitGI7ltMkNU81nN5a0/Pj7103AthalS63YY5worNdDeolBDLyI5xH+t
p3Rdu4EAEQEAAcLA/AQYAQgAJhYhBLmmWQG+W3QPqIUOLuXZysZKqlXrBQJgSX6x
BQkFo5qAAhsMAAoJEOXZysZKqlXrbHsL/0rWbmkdYmZ+Wdj9vrhxoxM8WDp3bCdr
5E1bziJYkG+VuEejk60rlURO6dZ9uJMtDnKMTZdJ26cN01iwWG/O83pOL9vyMOj5
q+XC4nmi4DV/N2wneBH4VyNfv1fNubDrE0M8iXX/WECIG2RSE0N6C4RfKIC03ysl
L4lnhSc426Bnxkf8sZm+oFo4ian0GcuNdIQBdBdAek9F2CX6whDbL4mZFAeY/e6e
mWmP8Y/z4X2qaCpW/GHS+XFccT1h8CxqsFxnAhnecjdMCv/TJLXMNk9LihEeUEZo
4U7bitCfyO17dt6NC/7wbGZCJmNPO7V3YYeI8MwzOkvmXqLcHz0IPQATuLMB1HKr
oG/Vrwq029ftqnuDluS/DzmuIqWLuAT+2nIe1JLWFlS9OUTi4i+y0NDlxWCZOaGp
ucR+ueFKv1de3nVjdd6oN+MIO9gQ3NE53FrO46A3APy6Ex02Mxub8nNnQjXcStHZ
BHO6KilQ+QLzSektD8IpHM7tR6P+5PP6AQ==
=NePe
-----END PGP PUBLIC KEY BLOCK-----
On 16/03/2022 21.28, Django2021 wrote:
>
> With Django how is it possible to detect
> * if template is being viewed on mobile device?
> and/or
> * if template is being viewed in portrait or landscape mode?
>
> Any suggestions appreciated.
>

https://www.w3.org/TR/css3-mediaqueries/

Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.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BdAek9F2CX6whDbL4mZFAeY/e6e
mWmP8Y/z4X2qaCpW/GHS+XFccT1h8CxqsFxnAhnecjdMCv/TJLXMNk9LihEeUEZo
4U7bitCfyO17dt6NC/7wbGZCJmNPO7V3YYeI8MwzOkvmXqLcHz0IPQATuLMB1HKr
oG/Vrwq029ftqnuDluS/DzmuIqWLuAT+2nIe1JLWFlS9OUTi4i+y0NDlxWCZOaGp
ucR+ueFKv1de3nVjdd6oN+MIO9gQ3NE53FrO46A3APy6Ex02Mxub8nNnQjXcStHZ
BHO6KilQ+QLzSektD8IpHM7tR6P+5PP6AQ==
=NePe
-----END PGP PUBLIC KEY BLOCK-----
On 16/03/2022 17.20, divya murugulla wrote:
> Can anyone help table data to be exported to excel code examples
>

https://labpys.com/export-data-from-database-into-excel-using-django/

Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/adfd3c4b-e4b9-b90c-8b16-a0cc51ce8eae%40stacktrace.dk.

Tuesday, March 15, 2022

Got an error creating the test database: database "" already exists

Hi all,
After writing test cases I run test cases I am getting an error below
```
Python manage.py behave
```
After running the above command I am getting this error.
```
Creating test database for alias 'default'...
Got an error creating the test database: database "test_newDataBase" already exists

Type 'yes' if you would like to try deleting the test database 'test_newDataBase', or 'no' to cancel: yes
Destroying old test database for alias 'default'...
Traceback (most recent call last):
  File "C:\Users\USER 1\PycharmProjects\behaveproject\venv\lib\site-packages\django\db\backends\utils.py", line 86, in _execute
    return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedTable: relation "trades_trade_table" does not exist
.....
.....
django.db.utils.ProgrammingError: relation "trades_vk_trade_table" does not exist
```
Please help me to resolve this issue.

Thank you
~Salima

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMSz6b%3DTEv%3DH25L7giQV6w%3DYw6%3D6GJrvh5zPezqQWMger3VNzQ%40mail.gmail.com.

Monday, March 14, 2022

Re: xlsx file data pasing into array to pgadmin using python

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsDNBGBJfrABDACxIFOMQIsP94wTkgf76JEHyTITmYnprsTeRmDet01G5etZ9ZHm
RmrqYVFzXu1aSBbaejm/ppbRrBB7YmFETbpnZepWJnuhridvjV37duRH3g/9ppiy
tNkhOOIYA/l8ppvyaRlrp/jPjAm27HVxi1Nu0syaWwTFKbUTtLKldIhuWvAXkgxp
xyBdB3jfmKoJ4rvTzZU+saKgaFExRmdd5TptwRP9cPRWIoR5fcRA8RQ1X66NkIpl
VBbH7NeLuTtICAa0dnyTh50x+Wapu1kDEWmr8ssUzf6c8yBJAHKBohQowZmQ8sYt
w2h4gX0zT4V3TY9y8TvTFGhPlM7l5QRFBlZqCBp5K/6xkyaAf+VlUwsdMqe8UOz5
mMJ5ZLU9JEzFyfSiM8xScwIzPcyQhOiLAgqIozTag+9B6QgD66Xa80yrFmfXyVtU
OtS6ykQsepR/fq6ySUKjWGFJ/Psq0wNuBaCHzEwEfeShZquL/jXmcUFJhVbeDYIZ
cPngktFCZ30fYuMAEQEAAc0mS2FzcGVyIExhdWRydXAgPGxhdWRydXBAc3RhY2t0
cmFjZS5kaz7CwQ8EEwEIADkWIQS5plkBvlt0D6iFDi7l2crGSqpV6wUCYEl+sQUJ
BaOagAIbAwULCQgHAgYVCAkKCwIFFgIDAQAACgkQ5dnKxkqqVeuAxQwApU4laVk3
4B2dZpFUMmkO46OeimzLiZaNYgs+SVIDw/WtaVbLUq+KH/TIMTiX5wgGRZ4WEC2L
4w66j8EzVx8vE2fNPx+yP1bM+lfbk1UBbtt9o6F6vIGzV0lHfO8rAPo4wB7lP0QB
dOAaJqnnDecGgse91HAqk1TR7oH4W7QkAshNbWEJfHpgJHNqXUa/2dp8jPAQfVcH
S0j5/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E0M8iXX/WECIG2RSE0N6C4RfKIC03ysl
L4lnhSc426Bnxkf8sZm+oFo4ian0GcuNdIQBdBdAek9F2CX6whDbL4mZFAeY/e6e
mWmP8Y/z4X2qaCpW/GHS+XFccT1h8CxqsFxnAhnecjdMCv/TJLXMNk9LihEeUEZo
4U7bitCfyO17dt6NC/7wbGZCJmNPO7V3YYeI8MwzOkvmXqLcHz0IPQATuLMB1HKr
oG/Vrwq029ftqnuDluS/DzmuIqWLuAT+2nIe1JLWFlS9OUTi4i+y0NDlxWCZOaGp
ucR+ueFKv1de3nVjdd6oN+MIO9gQ3NE53FrO46A3APy6Ex02Mxub8nNnQjXcStHZ
BHO6KilQ+QLzSektD8IpHM7tR6P+5PP6AQ==
=NePe
-----END PGP PUBLIC KEY BLOCK-----
On 14/03/2022 06.19, Gopi Bodduluri wrote:
> database function how to write data saave into table in array data
>

Yes, but maybe no. Definitely maybe though.

Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/04a7aecb-a596-3ed8-d1bc-743a8568df46%40stacktrace.dk.

Re: Deploy django to Windows server

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsDNBGBJfrABDACxIFOMQIsP94wTkgf76JEHyTITmYnprsTeRmDet01G5etZ9ZHm
RmrqYVFzXu1aSBbaejm/ppbRrBB7YmFETbpnZepWJnuhridvjV37duRH3g/9ppiy
tNkhOOIYA/l8ppvyaRlrp/jPjAm27HVxi1Nu0syaWwTFKbUTtLKldIhuWvAXkgxp
xyBdB3jfmKoJ4rvTzZU+saKgaFExRmdd5TptwRP9cPRWIoR5fcRA8RQ1X66NkIpl
VBbH7NeLuTtICAa0dnyTh50x+Wapu1kDEWmr8ssUzf6c8yBJAHKBohQowZmQ8sYt
w2h4gX0zT4V3TY9y8TvTFGhPlM7l5QRFBlZqCBp5K/6xkyaAf+V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U20acCtv6J4YpkYuBtkZHjLj65DBHlelk73N6qY3adHnmWCICFMICBRY4bpx
ay4/RGKodmROzq2PQy2pvRDSEwEGbeMeo7xCda1yPeoFJ0zcraNppVAEPV5efzSE
Mdq9aMJ2N1pKmrVh3wIjNsocQprDU9OEBxZ5S8LmiFqFNdPlt6FqzNOb6hTK8Xm6
a80wqUVL6gJSyuWLrZ+2h3NDyMsJWNDB9ThZQBkFxZtXP/HY2skmZJi0WIOfMdyB
hQyZK23xbitGI7ltMkNU81nN5a0/Pj7103AthalS63YY5worNdDeolBDLyI5xH+t
p3Rdu4EAEQEAAcLA/AQYAQgAJhYhBLmmWQG+W3QPqIUOLuXZysZKqlXrBQJgSX6x
BQkFo5qAAhsMAAoJEOXZysZKqlXrbHsL/0rWbmkdYmZ+Wdj9vrhxoxM8WDp3bCdr
5E1bziJYkG+VuEejk60rlURO6dZ9uJMtDnKMTZdJ26cN01iwWG/O83pOL9vyMOj5
q+XC4nmi4DV/N2wneBH4VyNfv1fNubDrE0M8iXX/WECIG2RSE0N6C4RfKIC03ysl
L4lnhSc426Bnxkf8sZm+oFo4ian0GcuNdIQBdBdAek9F2CX6whDbL4mZFAeY/e6e
mWmP8Y/z4X2qaCpW/GHS+XFccT1h8CxqsFxnAhnecjdMCv/TJLXMNk9LihEeUEZo
4U7bitCfyO17dt6NC/7wbGZCJmNPO7V3YYeI8MwzOkvmXqLcHz0IPQATuLMB1HKr
oG/Vrwq029ftqnuDluS/DzmuIqWLuAT+2nIe1JLWFlS9OUTi4i+y0NDlxWCZOaGp
ucR+ueFKv1de3nVjdd6oN+MIO9gQ3NE53FrO46A3APy6Ex02Mxub8nNnQjXcStHZ
BHO6KilQ+QLzSektD8IpHM7tR6P+5PP6AQ==
=NePe
-----END PGP PUBLIC KEY BLOCK-----
On 14/03/2022 16.26, www.forum-gh.com wrote:
> hey guys, Please I want to deploy my django app on Windows Server with a
> public IP, I don't know how to go about it please someone should guide
> me to do this

https://lmgtfy.app/?q=deploy+django+windows+server

Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/feeea629-5feb-859d-b3d6-07ff6b6a3a72%40stacktrace.dk.

Sunday, March 13, 2022

Re: How Important Is Writing Unit Tests For Django Applications?

Hello,

This topic is always interesting for me.

What is an integration test?

First, I'm always confused about what "integration tests" means. Apparently I'm not the only one. Here's what Edd Yerburgh says in his excellent book, "Testing Vue.js Applications" (p. 9):

People define integration tests differently, especially on the frontend. Some think tests that run in a browser environment are integration tests. Some think any test that tests a unit with module dependencies is an integration test. Some think that any fully rendered component is an integration test.

His definition of end-to-end tests is also relevant (p. 5):

In frontend applications, end-to-end tests automate a browser to check that an application works correctly from the user's perspective.

An additional complication is that people often use the term "unit testing" as all encompassing, that is for any kind of automated testing. This is especially true in Python, where the module for automating testing is called "unittest", and even more so in Django, where its TestCase subclasses contain functionality which some people would consider inappropriate for "unit tests" and appropriate only for "end-to-end" tests or "integration" tests, whatever that means.

On the other hand, why is a Django view NOT a unit of functionality? I think it is. Therefore why testing a Django view isn't unit testing? I don't really know, this is just food for thought. I think I'd talk about low-level testing and high-level testing, this labeling of end-to-end vs. unit doesn't always work well I think.

How to do a high level test

def add(a, b):
    return a + b

def multiply(i, j):
    result = 0
    while i:
        result = add(result, j)
        i -= 1
    return result

These are very stupid and I haven't tried them at all but it doesn't matter, the point I'm trying to make is that "multiply" is my high level function here, because it is calling "add", which is a lower level function.

How do you test "multiply"? A purist might say that you have tested "add" with some unit tests, and that when testing "multiply" you should mock "add". This way, if a unit test for "multiply" fails, you know the problem was in "multiply" and not in "add".

But, frankly, mocking is such a pain that I avoid doing it unless doing it without mocking would be harder. That is, my rule of thumb is to mock or not to mock based on how easy it will be to write a test. If you don't mock, an error in "add" should cause some "add" unit tests AND some "multiply" unit tests to fail. Usually it won't be hard to locate and fix the error.

At other times, I don't do low level testing at all. If the low-level function is just an implementation detail of the high level function, then often I don't test the lower level.

Conclusion

The purpose of writing tests is usually to save time. It's really hard, if not impossible, to measure how much time and money you saved (or lost) by working one way vs. another. Ultimately we just have a feeling guide us. I feel ok with my testing experience, but I always wonder whether I'm testing insufficiently or whether I'm testing too much.

I didn't expect this reply to become that long, neither that I would not answer the question in the end. I hope it was helpful anyway. Good luck!

Antonis Christofides  +30-6979924665 (mobile)


On 12/03/2022 20.00, Daniel Coker wrote:
I understand the importance of unit testing. However, if we are going to write integration tests (testing the views), this test will step through all of the modules that we would otherwise unit test.

So, I'm wondering, it it really necessary to write unit test for Django Applications when we will still test the views?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d0cf2d7c-79cb-41a5-801a-4240c3c0c1c1n%40googlegroups.com.

Saturday, March 12, 2022

Re: How Important Is Writing Unit Tests For Django Applications?

On 13/03/2022 5:00 am, Daniel Coker wrote:
> I understand the importance of unit testing. However, if we are going
> to write integration tests (testing the views), this test will step
> through all of the modules that we would otherwise unit test.
>
> So, I'm wondering, it it really necessary to write unit test for
> Django Applications when we will still test the views?

1.    If you don't unit test your bits and pieces AND you call them in
your views they might pass with wrong values. Subtle errors can creep in
if your views are tested too coarsely.

2.    The more fine-grained the unit tests the easier it is to refactor
your view code.

3.    Do you use Coverage? You will see all the Django code is tested.
Only your own code to test

I do integration testing at a high level as well as down low. Really
does wonders for refactoring confidence.

YMMV

Mike

> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d0cf2d7c-79cb-41a5-801a-4240c3c0c1c1n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d0cf2d7c-79cb-41a5-801a-4240c3c0c1c1n%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d076ee0f-6b30-408d-9bd8-df83a0deb893%40dewhirst.com.au.

Re: Reusable django templates

On 12 Mar 2022, at 17:43, Heman Okumbo wrote:

> How comes I'm not able to modify my templates after extending from
> a base template.eg can't add extra contents,the template only
> display contents of the inherited template.

Some code might help. It's not really clear to me what you are asking.

But at a guess, you can use the {% include … %} template function to
extend templates.


-- Clive

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2B3DC48B-D567-45A9-B182-66D13D81B4AF%40indx.co.uk.

Wednesday, March 9, 2022

Re: How to create dynamic models in django??

On Sun, Feb 27, 2022 at 09:10:05AM +0530, Prashanth Patelc wrote:
> How to create dynamic models in django rest framework?
> Is there any chance to create dynamic models with APIs
>
> Any examples please send me thanks in advance..
>
> 1) Requirement is need create table name and fields in frontend
> 2) we are getting the data and store in to the db create db structure
> 3) get the table name and fields create table in backend &postgresql store
> to
> 4)this code don't update or add into the models
> 5)store the data into the tables
> 4)get the data into the tables using orm or any raw queries

The WQ project uses the Entity-Attribute-Value data model:

https://v1.wq.io/1.2/docs/eav-vs-relational

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20220309235228.GH4556%40fattuba.com.

Monday, March 7, 2022

Re: Periodic Execution of django functions or tasks

If celery is too much, consider django-background-tasks.

To be totally honest, I am an old dog, and I generally do the following:
* Write a management command.
* Deploy a crontab to run my management command.

This is not so container or cloud friendly, but none of my cloud deployments run "long" tasks.  So, I've been able to translate this old pattern like this:
* Have a Lambda hit a web URL which runs the management command through django.core.management.call_command (for brief commands)
* Deploy to Lambda using Zappa and have a scheduled event in CloudWatch events run the command.

I think doing this same pattern with AWS Batch would work for longer commands - and only AWS is relevant to me.

Anyway, django-background-tasks or a simple management command are both less to deploy than celery.



On Tuesday, October 20, 2020 at 10:34:44 AM UTC-4 Derek wrote:
Ryan's suggestion is a very good one. 

If you don't need Django-specific commands, you can even write a stand-alone Python script which accesses your database to do the work. An alternative to cron that we use, on occasion, is https://pypi.org/project/APScheduler/ which runs in a container (a Python scheduler like this is also useful if you want to run on a non-Unix operating system). 

On Tuesday, 20 October 2020 at 01:53:50 UTC+2 Ryan Nowakowski wrote:
On Mon, Oct 19, 2020 at 04:53:35PM +0300, MUGOYA DIHFAHSIH wrote:
> Hello fellow django developers, i am working on a web app in which reports
> are archived in the database at the end of every month automatically, i
> have searched on internet and many folks are suggesting celery which i have
> tried but not fruitful, is there any other library i use to accomplish this.
>

Yeah, celery is great! But sometimes it's too complex a beast for
simple things. Usually I write a custom Django management command[1].
In your case it would probably be named something like archivereports.
Then add a cron entry to run it at the end of every month.

[1] https://docs.djangoproject.com/en/2.2/howto/custom-management-commands/
[2] https://help.ubuntu.com/community/CronHowto

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3c58c400-ba48-4512-9f4a-0e1998a44190n%40googlegroups.com.

Thursday, March 3, 2022

Re: Error : Circula import

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsDNBGBJfrABDACxIFOMQIsP94wTkgf76JEHyTITmYnprsTeRmDet01G5etZ9ZHm
RmrqYVFzXu1aSBbaejm/ppbRrBB7YmFETbpnZepWJnuhridvjV37duRH3g/9ppiy
tNkhOOIYA/l8ppvyaRlrp/jP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1de3nVjdd6oN+MIO9gQ3NE53FrO46A3APy6Ex02Mxub8nNnQjXcStHZ
BHO6KilQ+QLzSektD8IpHM7tR6P+5PP6AQ==
=NePe
-----END PGP PUBLIC KEY BLOCK-----
On 03/03/2022 20.38, Ruzindana Kent wrote:
> Hello everyone,
>
> I'm new to django and also new in the group, I wanted to know how to
> solve circula import errors. here is a screenshot of the error from the
> terminal.
>
> Any reply about that will be helpful, thank you
>

Remember that Django is a Python framework, so circular imports are
mostly a Python thing not specific to Django:

https://www.pythonpool.com/python-circular-import/

Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e259dd34-1578-7540-35c7-132550a1955c%40stacktrace.dk.

Re: ValueError: Field 'id' expected a number but got ' '.

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsDNBGBJfrABDACxIFOMQIsP94wTkgf76JEHyTITmYnprsTeRmDet01G5etZ9ZHm
RmrqYVFzXu1aSBbaejm/ppbRrBB7YmFETbpnZepWJnuhridvjV37duRH3g/9ppiy
tNkhOOIYA/l8ppvyaRlrp/jPjAm27HVxi1Nu0syaWwTFKbUTtLKldIhuWvAXkgxp
xyBdB3jfmKoJ4rvTzZU+saKgaFExRmdd5TptwRP9cPRWIoR5fcRA8RQ1X66NkIpl
VBbH7NeLuTtICAa0dnyTh50x+Wapu1kDEWmr8ssUzf6c8yBJAHKBohQowZmQ8sYt
w2h4gX0zT4V3TY9y8TvTFGhPlM7l5QRFBlZqCBp5K/6xkyaAf+VlUwsdMqe8UOz5
mMJ5ZLU9JEzFyfSiM8xScwIzPcyQhOiLAgqIozTag+9B6QgD66Xa80yrFmfXyVtU
OtS6ykQsepR/fq6ySUKjWGFJ/Psq0wNuBaCHzEwEfeShZquL/jXmcUFJhVbeDYIZ
cPngktFCZ30fYuMAEQEAAc0mS2FzcGVyIExhdWRydXAg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80wqUVL6gJSyuWLrZ+2h3NDyMsJWNDB9ThZQBkFxZtXP/HY2skmZJi0WIOfMdyB
hQyZK23xbitGI7ltMkNU81nN5a0/Pj7103AthalS63YY5worNdDeolBDLyI5xH+t
p3Rdu4EAEQEAAcLA/AQYAQgAJhYhBLmmWQG+W3QPqIUOLuXZysZKqlXrBQJgSX6x
BQkFo5qAAhsMAAoJEOXZysZKqlXrbHsL/0rWbmkdYmZ+Wdj9vrhxoxM8WDp3bCdr
5E1bziJYkG+VuEejk60rlURO6dZ9uJMtDnKMTZdJ26cN01iwWG/O83pOL9vyMOj5
q+XC4nmi4DV/N2wneBH4VyNfv1fNubDrE0M8iXX/WECIG2RSE0N6C4RfKIC03ysl
L4lnhSc426Bnxkf8sZm+oFo4ian0GcuNdIQBdBdAek9F2CX6whDbL4mZFAeY/e6e
mWmP8Y/z4X2qaCpW/GHS+XFccT1h8CxqsFxnAhnecjdMCv/TJLXMNk9LihEeUEZo
4U7bitCfyO17dt6NC/7wbGZCJmNPO7V3YYeI8MwzOkvmXqLcHz0IPQATuLMB1HKr
oG/Vrwq029ftqnuDluS/DzmuIqWLuAT+2nIe1JLWFlS9OUTi4i+y0NDlxWCZOaGp
ucR+ueFKv1de3nVjdd6oN+MIO9gQ3NE53FrO46A3APy6Ex02Mxub8nNnQjXcStHZ
BHO6KilQ+QLzSektD8IpHM7tR6P+5PP6AQ==
=NePe
-----END PGP PUBLIC KEY BLOCK-----
On 03/03/2022 04.04, Suresh_Chilukuri wrote:
> Hi All,please find below images for the "ValueError: Field 'id' expected
> a number but got ' ' " as the error.
>
> I am expecting quick response from you guys
>

You cannot expect a quick response or even a response at all if you
cannot be bothered to take the time to write a proper question yourself.

This might help solve your problem:

http://www.catb.org/~esr/faqs/smart-questions.html

Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1f1bc903-9746-f783-aa77-813b6fa9e5f7%40stacktrace.dk.

Wednesday, March 2, 2022

Re: The SECRET_KEY setting must not be empty - os.environ.get('SECRET_KEY')

Am 03.03.22 um 04:43 schrieb Adeyemi Deji:
> What do u mean by on installation @On installation, the file is then copied to localconfig.py, where it is *ignored* by svn, git, etc. The file is then customized for production, development, …
>
> Do u mean during deployment?

During development, you create two files:

localconfig.example
This file contains only example data, comments/instructions and *irrelevant* data, such as *fake* secret keys, fake database passwords, etc. This file is committed to the repository. Its *only* purpose is to serve as an example and be copied to filename localconfig.py later.

localconfig.py
Created from a copy of localconfig.example, during development you must make sure that this file is never committed to your repository. This is achieved by telling the repository to ignore it, e.g. Git by editing the .gitignore file appropriately, Subversion with the svn:ignore property. Still during development, you customize the file as needed for development, i.e. insert the required database details, DEBUG = True, etc.

For deployment, when you first clone the repository on the production server, it will come with the localconfig.example file, but not with the localconfig.py file, as intended. As part of the installation, you copy localconfig.example to localconfig.py and customize it for production (production database, etc.). Done.

Variants of this approach are possible, e.g. keeping the localconfig.py file entirely outside of the project directory, where it is in even less danger to be accidentally committed. Or to store the values not in a py, but in a json, ini, txt, ... file that is loaded and parsed in settings.py.

Best regards,
Carsten


> On Wed, Mar 2, 2022 at 7:49 AM Carsten Fuchs <carsten.fuchs@cafu.de <mailto:carsten.fuchs@cafu.de>> wrote:
>
> Am 02.03.22 um 04:23 schrieb Mike Dewhirst:
> > ... where you write get_secret_key() to pull it from the environment or a file somewhere which is not in your repository.
>
> A variant of this that I like is to have a file like localconfig.example in the repository next to settings.py that contains e.g.
> DATABASES = ...  # dummy or default config
> SECRET_KEY = 'example'
>
> On installation, the file is then copied to localconfig.py, where it is *ignored* by svn, git, etc. The file is then customized for production, development, …
>
> In settings.py, there is
>
> from project_dir import localconfig
> # ...
> DEBUG = localconfig.DEBUG
> SECRET_KEY = localconfig.SECRET_KEY
> DATABASES = localconfig.DATABASES
> # ...
>
> This works very well and is simple, safe and convenient.
>
> Best regards,
> Carsten
>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/08a9d115-235f-3538-70fa-e6e9ecdb404f%40cafu.de.

Re: The SECRET_KEY setting must not be empty - os.environ.get('SECRET_KEY')

Thanks Carsten, It's also a great method.
What do u mean by on installation @On installation, the file is then copied to localconfig.py, where it is *ignored* by svn, git, etc. The file is then customized for production, development, …

Do u mean during deployment?

On Wed, Mar 2, 2022 at 7:49 AM Carsten Fuchs <carsten.fuchs@cafu.de> wrote:
Am 02.03.22 um 04:23 schrieb Mike Dewhirst:
> ... where you write get_secret_key() to pull it from the environment or a file somewhere which is not in your repository.

A variant of this that I like is to have a file like localconfig.example in the repository next to settings.py that contains e.g.
DATABASES = ...  # dummy or default config
SECRET_KEY = 'example'

On installation, the file is then copied to localconfig.py, where it is *ignored* by svn, git, etc. The file is then customized for production, development, …

In settings.py, there is

from project_dir import localconfig
# ...
DEBUG = localconfig.DEBUG
SECRET_KEY = localconfig.SECRET_KEY
DATABASES = localconfig.DATABASES
# ...

This works very well and is simple, safe and convenient.

Best regards,
Carsten

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/27159e6a-0472-97c5-8816-7c5a46a3eb89%40cafu.de.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEO1GrqUrHfxBL_J1cGHDjjVdbbfciBTpc322%3DZZFOMckcx-qw%40mail.gmail.com.