Friday, July 30, 2021

Re: Django-salesforce integration

On 29/07/2021 06.55, Venkatesh Nagandla wrote:
>
> I need to write the code in Django and am not supposed to use any
> existing third-party salesforce integration app.
>

What's the reason you cannot you use any existing thirdparty code?

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/a9b8eac7-ad80-f032-4d33-caf5ac83970c%40stacktrace.dk.

Re: Django-salesforce integration

Hello Django experts, do you have any guide or resources for this task?



On Thu, 29 Jul 2021 at 18:36, Venkatesh Nagandla <venkateshcalifornia@gmail.com> wrote:
Hi,

Please help with this task. Require insights in an easier way.

I have to implement salesforce integration which includes fetching user token from salesforce using OAuth2. Once I have the token then fetch the list of Users, Accounts, and Contacts from salesforce and store it in the database.

I need to write the code in Django and am not supposed to use any existing third-party salesforce integration app.

If you similar projects or resources, please provide.



--
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/3e088842-c6fc-457d-aea3-2273311605d3n%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAH1%2B3vV1PcndsLjm%2B6g-8YL%3Dw_UrDzSgv1JByytfKPyt0a%3DFpA%40mail.gmail.com.

Thursday, July 29, 2021

Re: Please remove me from this user group.

Just click on the unsubscribe button

On Tue, Jul 27, 2021, 3:16 AM Shirley Nelson <star2jem@gmail.com> wrote:
Please remove me from this user group. Thank you.

Regards, Shirley Nelson

--
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/CA%2BN15oZhNz6SYsnN1tiBoyjyn-8nM0tfQ2Ua1MWSrVJTdiWa8A%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/CADkdEzF55QAQXw6QYaJ5jf2MD8Czn96Zr6-rddtrE9w6PgwgNA%40mail.gmail.com.

How to create a user by admin only in django

Hello, can anyone help me with this concept, I'm trying to create a project in django, the attached file is below,
Please read it and help me with it, especially an admin creating a student user, and students need only to log in

--
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/2a8d5fa9-8ecb-46e6-a684-505176284047n%40googlegroups.com.

Wednesday, July 28, 2021

Django-salesforce integration

Hi,

Please help with this task. Require insights in an easier way.

I have to implement salesforce integration which includes fetching user token from salesforce using OAuth2. Once I have the token then fetch the list of Users, Accounts, and Contacts from salesforce and store it in the database.

I need to write the code in Django and am not supposed to use any existing third-party salesforce integration app.

If you similar projects or resources, please provide.



--
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/3e088842-c6fc-457d-aea3-2273311605d3n%40googlegroups.com.

HELP

I have connection data in my mysql database and I want to connect with credentials in the database using django

--
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/f6925aed-9824-42f1-894e-76f9618dceben%40googlegroups.com.

Re: CSS not linking with HTML

Check the spelling of your style

On Wed, Jul 28, 2021, 4:31 AM Baxtiyor Boboraximov <uzbekpy@gmail.com> wrote:
if you want to solve this problem you must sendmi ful project  not html file.


пт, 28 мая 2021 г. в 23:39, sukhy gill <sukhy.gill1989@gmail.com>:
Dear Frnds
                I am unable to  link CSS with HTML
HTML working but CSS not working inside the .html file with the help of LINK in <head> tag 

I am using thefollowings:-
Setting.py -  STATICFILES_DIRS=[os.path.join(BASE_DIR, 'static'),]
HTML- {% load static %}
<Link rel="stylesheet" href="{% static 'css/syle.css %} />
 
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/3ca2aba0-a58f-4298-b248-16c51bdf90a6n%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMG7-GuH2r%2BU231uHqgd-e%3DRm45NQxWsmAOGL5Pw4HtOzt4zCg%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/CAN0Tv2XUGCtU1BSEzJzygdPpv8esosAm-TMzthO83OfhQ52S9A%40mail.gmail.com.

Re: CSS not linking with HTML

syle.css?

On Wed, 28 Jul 2021, 15:24 Aashish Kumar, <aashishkumar12376@gmail.com> wrote:

Do hard refresh 

Ctrl + f5 

On Sat, 29 May 2021 at 12:09 AM, sukhy gill <sukhy.gill1989@gmail.com> wrote:
Dear Frnds
                I am unable to  link CSS with HTML
HTML working but CSS not working inside the .html file with the help of LINK in <head> tag 

I am using thefollowings:-
Setting.py -  STATICFILES_DIRS=[os.path.join(BASE_DIR, 'static'),]
HTML- {% load static %}
<Link rel="stylesheet" href="{% static 'css/syle.css %} />
 
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/3ca2aba0-a58f-4298-b248-16c51bdf90a6n%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACTAcrxpyWHLKwTgzBZ%3DhuRTy7%2Bx%3DASPdkbm6qzovs2nr9k2iw%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/CAJwzOPQtkT1_qGrK21c%3D4uzk_AsMjsyh7nSF3c6Hkf6aG_%2Bvyg%40mail.gmail.com.

Re: CSS not linking with HTML


Do hard refresh 

Ctrl + f5 

On Sat, 29 May 2021 at 12:09 AM, sukhy gill <sukhy.gill1989@gmail.com> wrote:
Dear Frnds
                I am unable to  link CSS with HTML
HTML working but CSS not working inside the .html file with the help of LINK in <head> tag 

I am using thefollowings:-
Setting.py -  STATICFILES_DIRS=[os.path.join(BASE_DIR, 'static'),]
HTML- {% load static %}
<Link rel="stylesheet" href="{% static 'css/syle.css %} />
 
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/3ca2aba0-a58f-4298-b248-16c51bdf90a6n%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACTAcrxpyWHLKwTgzBZ%3DhuRTy7%2Bx%3DASPdkbm6qzovs2nr9k2iw%40mail.gmail.com.

Tuesday, July 27, 2021

Re: help creating foreign Key relationship in DRF

I've done that, it still doesn't work, it still return they same error message

On Tue, Jul 27, 2021, 19:48 oba stephen <obastepheno@gmail.com> wrote:
Take the create method out of the meta class 

Let's start with that first. 

Best regards

Stephen Oba

On Tue, Jul 27, 2021, 1:03 PM ola neat <tosinayoola0@gmail.com> wrote:
halo i'm working on creating a foreignKey kinda relationship between multiple table but im getting an err
can anyone help
below is my code & err screenshot






--
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/CAHLKn717ia96CZ%2BnSnXKjz3ubj6JyUUrGrZEbAS9qC2NGMJpAw%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/CAAJsLnrmi%3DFmPu9LvA5YoS73o-GAUAb4w1%3Dty8gv3EyXvKiCQw%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/CAHLKn72CsJdyPfLdfczSfh080p6Vw%2B24Bn1bUfRWp13Tx2aHrg%40mail.gmail.com.

Re: CSS not linking with HTML

if you want to solve this problem you must sendmi ful project  not html file.


пт, 28 мая 2021 г. в 23:39, sukhy gill <sukhy.gill1989@gmail.com>:
Dear Frnds
                I am unable to  link CSS with HTML
HTML working but CSS not working inside the .html file with the help of LINK in <head> tag 

I am using thefollowings:-
Setting.py -  STATICFILES_DIRS=[os.path.join(BASE_DIR, 'static'),]
HTML- {% load static %}
<Link rel="stylesheet" href="{% static 'css/syle.css %} />
 
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/3ca2aba0-a58f-4298-b248-16c51bdf90a6n%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMG7-GuH2r%2BU231uHqgd-e%3DRm45NQxWsmAOGL5Pw4HtOzt4zCg%40mail.gmail.com.

Re: CSS not linking with HTML

I still see an error with that code bro...


On 19:35, Mon, Jul 26, 2021 Baxtiyor Boboraximov <uzbekpy@gmail.com wrote:
hello . you must add to sittings.py  this code. 
STATIC_URL = '/static/'
STATICFILES_DIRS = (str(BASE_DIR.joinpath('static')),)

пт, 28 мая 2021 г. в 23:39, sukhy gill <sukhy.gill1989@gmail.com>:
Dear Frnds
                I am unable to  link CSS with HTML
HTML working but CSS not working inside the .html file with the help of LINK in <head> tag 

I am using thefollowings:-
Setting.py -  STATICFILES_DIRS=[os.path.join(BASE_DIR, 'static'),]
HTML- {% load static %}
<Link rel="stylesheet" href="{% static 'css/syle.css %} />
 
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/3ca2aba0-a58f-4298-b248-16c51bdf90a6n%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMG7-GuaEAfH_e-WFwARBe7%2Bn4Maxx4H%2BX4uv8CK%2BtHSS8HqDA%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/CAJkmis11RibJB4%3D1eywMFaSGNjjU0ow4zLanWssyWmadhCvQ%2BQ%40mail.gmail.com.

Re: help creating foreign Key relationship in DRF

Take the create method out of the meta class 

Let's start with that first. 

Best regards

Stephen Oba

On Tue, Jul 27, 2021, 1:03 PM ola neat <tosinayoola0@gmail.com> wrote:
halo i'm working on creating a foreignKey kinda relationship between multiple table but im getting an err
can anyone help
below is my code & err screenshot






--
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/CAHLKn717ia96CZ%2BnSnXKjz3ubj6JyUUrGrZEbAS9qC2NGMJpAw%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/CAAJsLnrmi%3DFmPu9LvA5YoS73o-GAUAb4w1%3Dty8gv3EyXvKiCQw%40mail.gmail.com.

help creating foreign Key relationship in DRF

halo i'm working on creating a foreignKey kinda relationship between multiple table but im getting an err
can anyone help
below is my code & err screenshot






--
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/CAHLKn717ia96CZ%2BnSnXKjz3ubj6JyUUrGrZEbAS9qC2NGMJpAw%40mail.gmail.com.

Monday, July 26, 2021

Re: Please remove me from this user group.

Farewell. 

On Mon, Jul 26, 2021 at 22:16 Shirley Nelson <star2jem@gmail.com> wrote:
Please remove me from this user group. Thank you.

Regards, Shirley Nelson

--
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/CA%2BN15oZhNz6SYsnN1tiBoyjyn-8nM0tfQ2Ua1MWSrVJTdiWa8A%40mail.gmail.com.
--
Sent from Gmail Mobile

--
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/CAJoAtSnoRK61-z8Lh1-rd2CmKhqYU%2BCo%3D%3D%3DHaaaP8%2BcuO5GokA%40mail.gmail.com.

Please remove me from this user group.

Please remove me from this user group. Thank you.

Regards, Shirley Nelson

--
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/CA%2BN15oZhNz6SYsnN1tiBoyjyn-8nM0tfQ2Ua1MWSrVJTdiWa8A%40mail.gmail.com.

Re: Added new column to model and run migrations but not applied to database table

having had the unfortunate phase of dealing with it , sorting it requires some patience

the issue is the tables in django_migrations is not in sync with rest the rest of your database or migrations files. 

You have to first remove the addition in field etc and make sure the database tables are first in sync with your models, then 1. delete migrations files and 2. delete django_migrations. Then 3.makemigrations and 4. migrate fake.  All risks are yours to take

Then finally just add your fields and makemigrations and migrate

The above might/or not work as it might give some content type errors 




On Wednesday, July 21, 2021 at 2:39:56 AM UTC+8 sebasti...@gmail.com wrote:
Is in settings.py also in installed app? Without that migrations don't work

Salima Begum <sali...@rohteksolutions.com> schrieb am Di., 20. Juli 2021, 19:00:
Hi ,
Thank you for your responses.
 I have tried all the ways Which you people suggested I am not getting any error while running makemigrations or migrate and 
python manage.py migrate --fake-initial. But those migrations are not applying to the database. How can I fix this issue without deleting the database? 

Thank you
~Salima
 

On Mon, Jul 19, 2021 at 7:02 PM Aman Vyas <amanv...@gmail.com> wrote:
if it is saying no changes detected while running makemigrations and you are sure that you changed models.py  then these things you can try:

1: python manage.py makemigrations appname

if this will not work then do that

2: delete migrations folder from your app and delete database then run again python manage.py makemigrations




On Mon, Jul 19, 2021 at 6:07 AM Salima Begum <sali...@rohteksolutions.com> wrote:
Hi all,

I have added a new column to the existing model while developing. Then I run makemigrations and migrate. It is not applied to the database table which is created based on that model. How can I fix this issue? Please help me to complete this issue.

The below issue I am facing in deployment server after adding new field and deployed into server.

```
psycopg2.errors.UndefinedColumn: column shopping_ls_product_search.quality_prdct does not exist
LINE 1: ... Col1 FROM "shopping_ls_product_search" WHERE ("shopping_...
```
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMSz6bnLkeN001UnxO3PdCg06Jc%3Dcr22kZXc71KL4w5CbYq_Cw%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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKZY6%3DAgrWzCmrBHpouSJG_Vfy7i6LQu81Q7EWBRq44Yf3053A%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...@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/f8458021-e0c0-4c30-8188-0c08932b1deen%40googlegroups.com.

OperationalError: foreign key mismatch

Hello,

I'm getting the following error whenever I attempt to save to the table in a SQLite database:

foreign key mismatch - "procedure_tbl" referencing "filename_tbl"

In models.py, these are the tables that the error is refering to:

class FilenameTbl(models.Model):
    rowid = models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='FileID', db_column='rowid')
    filename = models.TextField(blank=True, null=True)
    creation_datetime = models.TextField(blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'filename_tbl'
        ordering = ['rowid']


class ProcedureTbl(models.Model):
    rowid = models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ProcedureID', db_column='rowid')
    ...
    filename_id = models.ForeignKey(FilenameTbl,db_column='filename_id', to_field='rowid',null=True,blank=True,on_delete=models.SET_NULL)

    class Meta:
        managed = False
        db_table = 'procedure_tbl'
        ordering = ['rowid']

Data can be read from the tables and querysets like the following return the correct data:
    queryset = FilenameTbl.objects.values(
        'rowid', 'filename',
        'proceduretbl__rowid')

Raw SQLite commands to write/update to the ProcedureTbl table function properly.

If I removed filename_id from the ProcedureTbl, then data can be saved to the table.

Any insight into the issue would be much appreciated.

Cheers,
Wai



--
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/b90d237f-8c29-42ef-897a-34221704699dn%40googlegroups.com.

What is the necessity of success_url_allowed_hosts on a LogoutView?

success_url_allowed_hosts: A set of hosts, in addition to request.get_host(), that are safe for redirecting after logout. Defaults to an empty set.

What could go wrong if evilwebsite.com is included in success_url_allowed_hosts?

--
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/7f6ee52c-de74-4ca0-8e70-cd97d577cc54n%40googlegroups.com.

Re: CSS not linking with HTML

hello . you must add to sittings.py  this code. 
STATIC_URL = '/static/'
STATICFILES_DIRS = (str(BASE_DIR.joinpath('static')),)

пт, 28 мая 2021 г. в 23:39, sukhy gill <sukhy.gill1989@gmail.com>:
Dear Frnds
                I am unable to  link CSS with HTML
HTML working but CSS not working inside the .html file with the help of LINK in <head> tag 

I am using thefollowings:-
Setting.py -  STATICFILES_DIRS=[os.path.join(BASE_DIR, 'static'),]
HTML- {% load static %}
<Link rel="stylesheet" href="{% static 'css/syle.css %} />
 
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/3ca2aba0-a58f-4298-b248-16c51bdf90a6n%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMG7-GuaEAfH_e-WFwARBe7%2Bn4Maxx4H%2BX4uv8CK%2BtHSS8HqDA%40mail.gmail.com.

Re: AttributeError: module 'polls.views' has no attribute 'index'

as you mentioned that you're using django 3.2 but your urls.py file is following the pattern of django 1.7.
use your urls.py this way : path('your polls url here', views.index, name='index')

On Mon, Jul 26, 2021 at 6:45 PM Zain <zainnathie@gmail.com> wrote:
Had the same issue.

Solved, make sure you run each edited python file during the tutorial.
I guess it needs to update. All I know is this fixed the issue.

On Monday, April 19, 2021 at 2:07:34 AM UTC+10 avi.me...@gmail.com wrote:
I followed the same tutorial on 17th April 2021 with Python 3.9.2 and Django     3.2 and have exactly the same problems as mentioned above.

    path('', views.index, name='index'),

AttributeError: module 'polls.views' has no attribute 'index'

any help on how can I debug this? I am a django noob

On Wednesday, 19 April 2017 at 16:31:59 UTC+2 lce...@gmail.com wrote:
Thanks for your reploy.

Actually I followed the tutorial exactly.

My polls/views.py has:

from django.http import HttpResponse


def index(request):
    return HttpResponse("Hello, world. You're at the polls index.")

My polls/urls.py has:

from django.conf.urls import url

from . import views

urlpatterns = [
    url(r'^$', views.index, name='index'),
]


On Wednesday, 19 April 2017 15:43:57 UTC+2, m712 - Developer wrote:

You didn't give us enough info, but I am thinking that you don't have an index() function in your polls/views.py. Start the tutorial from the beginning and follow it closely.

On Apr 19, 2017 4:17 PM, Billy Lin <lce...@gmail.com> wrote:
I'm following the getting started tutorial 01 and running into issues after creating the polls app. Can someone please help?

I'm using Python 3.6.1 and Django 1.11.

Here's the detailed trace:

Performing system checks...
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x04222810>
Traceback (most recent call last):
  File "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\autoreload.py", line
227, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\commands\ru
nserver.py", line 125, in inner_run
    self.check(display_num_errors=True)
  File "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py", l
ine 359, in check
    include_deployment_checks=include_deployment_checks,
  File "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py", l
ine 346, in _run_checks
    return checks.run_checks(**kwargs)
  File "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\registry.py", l
ine 81, in run_checks
    new_errors = check(app_configs=app_configs)
  File "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\urls.py", line
16, in check_url_config
    return check_resolver(resolver)
  File "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\urls.py", line
26, in check_resolver
    return check_method()
  File "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py", line 25
4, in check
    for pattern in self.url_patterns:
  File "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\functional.py", line
35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py", line 40
5, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\functional.py", line
35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py", line 39
8, in urlconf_module
    return import_module(self.urlconf_name)
  File "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py", line 126, in import_modu
le
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "C:\Users\cephalin\Repos\django\mysite\mysite\urls.py", line 20, in <module>
    url(r'^polls/', include('polls.urls')),
  File "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\conf\urls\__init__.py", lin
e 50, in include
    urlconf_module = import_module(urlconf_module)
  File "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py", line 126, in import_modu
le
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "C:\Users\cephalin\Repos\django\mysite\polls\urls.py", line 6, in <module>
    url(r'^$', views.index, name='index'),
AttributeError: module 'polls.views' has no attribute 'index'

--
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 post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b77a1a74-b07f-4277-98da-23b46ca7d2e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/cc9b3670-d625-4505-91a1-fe63041c1ae3n%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKPY9pnDwZbJW%3DPfuVoDHmPR930iKrYOKO963v%2BSN3V20x8u%2Bw%40mail.gmail.com.

Re: CSS not linking with HTML

<Link rel="stylesheet" href="{% static 'css/syle.css' %}" />
Try it 

On Mon, 26 Jul, 2021, 7:55 PM V. J, <poda.v.j@gmail.com> wrote:
Hello, I'm making a list of potential customers, in about two months, we will have a business plan ready and we will issue a digital token (ICO) based on our product in the company.  Would you be interested in learning more ...?

Dne čt 3. čvn 2021 10:06 uživatel sukhy gill <sukhy.gill1989@gmail.com> napsal:
Dear frnd
        First of all thanks to all for spare your valueable time for me.🙏🙏


 Now my Server is working and inline CSS also working but Internal and External CSS not working.
In my last project, image css was also working but now it is not working.

Another problem is "python manage.py collectstatic"  commd giving error.

My Whatsapp no is - 9493878322 ( Anyone may contact me through my whatsapp also if you feel so)

Regards



On Mon, May 31, 2021, 22:41 Chelsea Fan <allaberdi16yazhanow@gmail.com wrote:
You are welcome))

On Mon, 31 May 2021, 6:44 pm sukhy gill, <sukhy.gill1989@gmail.com> wrote:
Thanku so much all of you for your valuable guidance to me 🙏🙏🙏🙂🙂

On Mon, May 31, 2021, 21:07 Chelsea Fan <allaberdi16yazhanow@gmail.com wrote:
Good luck 👍👍👍👍

On Mon, 31 May 2021, 6:31 pm sukhy gill, <sukhy.gill1989@gmail.com> wrote:
I deleted my project and will start project again from begining and then will let you know the progress.
Regards

On Sun, May 30, 2021, 16:48 Mehdi Ismail <mehdizprofile@gmail.com wrote:
you want to mention (provide screenshot) of the error?

On Sunday, 30 May 2021 at 09:14:22 UTC+5:30 sukhy.g...@gmail.com wrote:
Getting error while using using command python manage.py collectstatic
Regarda

On Sat, May 29, 2021, 21:23 Mehdi Ismail <mehdiz...@gmail.com wrote:
python manage.py collectstatic 


try that... and update
On Saturday, 29 May 2021 at 20:44:48 UTC+5:30 sukhy.g...@gmail.com wrote:
Project Folder ➡️static ➡️css➡️style.css➡️

On Sat, May 29, 2021, 19:16 Fabiano Leite <fabiano....@gmail.com wrote:

Where is located your 'css/style.css';
Em sábado, 29 de maio de 2021 às 10:04:50 UTC-3, sukhy.g...@gmail.com escreveu:
No dear

On Sat, May 29, 2021, 18:29 Chelsea Fan <allaberdi...@gmail.com wrote:
Is it working now?

On Sat, 29 May 2021, 3:40 pm lalit suthar, <sutharl...@gmail.com> wrote:
read this https://docs.djangoproject.com/en/2.2/intro/tutorial06/ and check how you are giving paths. Also after loading the page on your browser go to "View Page Source" and click on the CSS file link and check if the file is opening or not.

On Saturday, 29 May 2021 at 17:57:21 UTC+5:30 sukhy.g...@gmail.com wrote:
Yes Sir,There was no mistake in code. Code problem was only in mail content actually code was correct as instruction given by Aniket Sir

Regards


On Sat, May 29, 2021, 13:14 lalit suthar <sutharl...@gmail.com wrote:
have you checked Aniket's answer?

On Saturday, 29 May 2021 at 11:09:07 UTC+5:30 sukhy.g...@gmail.com wrote:
Done Sir, but not working

On Sat, May 29, 2021, 10:50 Venu Gopal <reachme...@gmail.com wrote:
In Firefox ---- Goto Preferences ---> Choose Privacy and Security ---> scroll down until you get cookies and site data --> clear data
Chrome ---- Goto Settings ---> Choose Privacy and Security ---> select cookies and other site data --> select see all cookies and site data --> Remove all

On Sat, May 29, 2021 at 9:50 AM sukhy gill <sukhy.g...@gmail.com> wrote:
@Venu Gopal

No Sir, I don't know, how to do this.

May I know Sir, how to do the same?

Regards

On Sat, May 29, 2021, 09:41 Venu Gopal <reachme...@gmail.com wrote:
Hi, Have you tried deleting existing cache and cookies in the browser?

On Sat, May 29, 2021 at 12:08 AM sukhy gill <sukhy.g...@gmail.com> wrote:
Dear Frnds
                I am unable to  link CSS with HTML
HTML working but CSS not working inside the .html file with the help of LINK in <head> tag 

I am using thefollowings:-
Setting.py -  STATICFILES_DIRS=[os.path.join(BASE_DIR, 'static'),]
HTML- {% load static %}
<Link rel="stylesheet" href="{% static 'css/syle.css %} />
 
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3ca2aba0-a58f-4298-b248-16c51bdf90a6n%40googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAOhYkiyqw8k5zCL1XZo9U%2BY9_JR57p55xf-%3DtFf6Fa4HVskPSw%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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJ8btZave0utnYTAcrxafKes6sUZ3%2BX%2B0v1EGs-pJSF1%2BT4qxw%40mail.gmail.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe.
To unsubscribe from this group and all its topics, 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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6270c1f5-a1d9-4904-a5ed-85e21030b894n%40googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe.
To unsubscribe from this group and all its topics, 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/3e26aaf1-212c-42fe-b7fe-b770dac85e4en%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJ8btZYb461qqot%2BMNRB4bNq4qcdAVWGni_uhfo1Yr6hzmJ0oA%40mail.gmail.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAJwZndcDCN5U7SAzYpuq%2BtPM0QCQz0XKw74jQsLvnPKXKUzLNw%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/CAJ8btZaTm3UwH%3D6YKyC1LzXWtdiEzuqEGhm3XgoXOGFNH%2BVW1w%40mail.gmail.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAJwZndeBykTGKzXBYT94dV-EqwyRzWKoXRHFM5QhDDqtSFC8VQ%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/CAJ8btZaosJD1Pfht-kRQiQtLdqQKrRnhkoop_hhA7HYD8WBRzA%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/CA%2BCuM3BfVbvcuF%3D3H402mEh3uVNTxihRQx4ZFLgCBWS0e3Ow3g%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/CA%2Bohtm8Mq9c4FKNJBEccvTRYjWru-Tz5Pte2E4ayvgWiHJ45uQ%40mail.gmail.com.

Re: use of annotate in django query

Hello, I'm making a list of potential customers, in about two months, we will have a business plan ready and we will issue a digital token (ICO) based on our product in the company.  Would you be interested in learning more ...?

Dne so 5. čvn 2021 19:09 uživatel Lalit Suthar <sutharlalit.97@gmail.com> napsal:
just replied to your mail

On Sat, 5 Jun 2021 at 11:48, Eugene TUYIZERE <eugenetuyizere@gmail.com> wrote:
Dear Suthar,

Can I have your private contact?

regards, 

On Fri, 4 Jun 2021 at 06:25, Lalit Suthar <sutharlalit.97@gmail.com> wrote:

my pleasure :) 


On Thu, 3 Jun 2021 at 20:28, Eugene TUYIZERE <eugenetuyizere@gmail.com> wrote:
Dear Suthar,

Thank you very much. It works well.


On Thu, 3 Jun 2021 at 16:48, Lalit Suthar <sutharlalit.97@gmail.com> wrote:
not sure but maybe this can work inside views replace 
chart = {
      'chart': {'type': 'column'},
      'title': {'text': 'Previous statistics'},
      'xAxis': {'replist': replist},
      'series': [arriva_days]
}
with 
chart = {
      'chart': {'type': 'column'},
      'title': {'text': 'Previous statistics'},
      'xAxis': {'categories': replist},
      'series': [arriva_days]
}

On Thu, 3 Jun 2021 at 18:00, Eugene TUYIZERE <eugenetuyizere@gmail.com> wrote:
This what I have in summarizedchart.html:

{% extends "layouts/base.html" %}
{% load static %}
{% block title %} Repport {% endblock %}

<!-- Specific CSS goes HERE -->
{% block stylesheets %}{% endblock stylesheets %}

{% block content %}

<div class="pcoded-main-container">
<div class="pcoded-content">
<div class="col-lg-12">
<div class="card table-card">
<div class="card-header">
<h5>Report</h5>

<hr>

<script src="{% static 'assets/js/chart.js' %}"></script>

<div id="container"></div>
<script>
Highcharts.chart('container', {{ chart|safe }});
</script>
</div>
</div>
</div>
</div>
</div>
{% endblock content %}
{% block custom_js %}

{% endblock custom_js %}

On Thu, 3 Jun 2021 at 14:22, Lalit Suthar <sutharlalit.97@gmail.com> wrote:
so the view is not giving error right now but maybe we are passing the data in different format then the chart is expecting.
What are you using for drawing the chart? can I see the code inside "summarizedchart.html"

On Thu, 3 Jun 2021 at 17:43, Eugene TUYIZERE <eugenetuyizere@gmail.com> wrote:
Dear Suthar,

You saved my day. Once more, the chart is displayed but the date is not displayed on Xaxis. This how it is:



Th codes are:
def reqChart(request):
current_date = date.today()
days_before = date.today()-timedelta(days=30)
datelist = Customer_Requests.objects.values("arrival_date").annotate(num_req=Count("request_name")).order_by('-arrival_date')[:20:-1]
replist = list()
sumdata = list()
for listd in datelist:
replist.append(listd['arrival_date'])
sumdata.append(listd['num_req'])
arriva_days = {
'name': 'Datess',
'data': sumdata,
'color': 'green'
}
chart = {
'chart': {'type': 'column'},
'title': {'text': 'Previous statistics'},
'xAxis': {'replist': replist},
'series': [arriva_days]
}
dump = json.dumps(chart,cls=DjangoJSONEncoder)
return render(request,'summarizedchart.html',{'chart': dump})


On Thu, 3 Jun 2021 at 13:27, lalit suthar <sutharlalit.97@gmail.com> wrote:
Hi there! 
make these couple of changes 

1) from django.core.serializers.json import DjangoJSONEncoder
2) dump3 = json.dumps(chart3, cls=DjangoJSONEncoder)
On Thursday, 3 June 2021 at 16:18:15 UTC+5:30 eugenet...@gmail.com wrote:
Dear Suthar,

Your idea works well , but I want now to display the result on chart. Below is the code I am trying to use:
but Am getting the error message:

Exception Value:
Object of type date is not JSON serializable

def reqChart(request):
aa = Customer_Requests.objects.values("arrival_date").annotate(num_req=Count("request_name")).order_by('-arrival_date')[:20:-1]
print(aa)
datesb = list()
sumdata = list()
for dd in aa:
datesb.append(dd['arrival_date'])
sumdata.append(dd['num_req'])
arriva_days = {
'name': 'Datess',
'data': sumdata,
'color': 'green'
}
chart3 = {
'chart': {'type': 'column'},
'title': {'text': 'Previous statistics'},
'xAxis': {'datesb': datesb},
'series': [arriva_days]
}
dump3 = json.dumps(chart3)
return render(request,'summarizedchart.html',{'chart3': dump3})

Please once again

regards, 



On Thu, 3 Jun 2021 at 09:00, lalit suthar <sutharl...@gmail.com> wrote:
this will do 
Customer_Requests.objects.values("arrival_date").annotate(num_req=Count("request_name")).order_by("-id")[:30:-1]

On Thursday, 3 June 2021 at 11:37:26 UTC+5:30 abubak...@gmail.com wrote:
to display last 30 records you can write your code like this: Customer_Requests.objects.all()[-30]

On Thu, Jun 3, 2021 at 10:51 AM Eugene TUYIZERE <eugenet...@gmail.com> wrote:
Dear Latit,

Thank you very much. Now how can I display 30 last records? Regardless of how many records I may have ! Just the last 30 records!

Thank you

On Thu, 3 Jun 2021 at 06:51, Lalit Suthar <sutharl...@gmail.com> wrote:
> in brief, I want to transform this query in django query
this will be equivalent to this query in django 
Customer_Requests.objects.values("arrival_date").annotate(num_req=Count("request_name"))


On Thu, 3 Jun 2021 at 02:02, Eugene TUYIZERE <eugenet...@gmail.com> wrote:
in brief, I want to transform this query in django query

image.png

On Wed, 2 Jun 2021 at 21:56, Eugene TUYIZERE <eugenet...@gmail.com> wrote:
Dear Sebatian,

This is what I get:

SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-03 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-04 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-05 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-06 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-07 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-08 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-09 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-10 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-11 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-12 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-13 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-14 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-15 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-16 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-17 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-18 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-19 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-20 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-21 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-22 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-23 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-24 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-25 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-26 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-27 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-28 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-29 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-30 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-05-31 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-06-01 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL
SELECT `crms_customer_requests`.`arrival_date`, COUNT(`crms_customer_requests`.`request_name`) AS `count` FROM `crms_customer_requests` WHERE `crms_customer_requests`.`arrival_date` >= 2021-06-02 GROUP BY `crms_customer_requests`.`arrival_date` ORDER BY NULL

On Wed, 2 Jun 2021 at 21:53, Sebastian Jung <sebasti...@gmail.com> wrote:
Hi Eugene,

Please make Print(report.query) then you get SQL querys and Most of time i get an Idea what's wrong

Regards

Eugene TUYIZERE <eugenet...@gmail.com> schrieb am Mi., 2. Juni 2021, 21:41:
Dear Team,

I need help. I am working on a project where one of the tables is about requests. I want to have a report of the number of requests on each day in the last 30 days, something like this:
image.pngI I used the code below just before displaying on the chart but the code gives me wrong information

def reqChart(request):
current_date = date.today()
days_before = date.today()-timedelta(days=30)
for dt in daterange(days_before,current_date):
reports = Customer_Requests.objects.filter(arrival_date__gte=dt).\
extra({'day':"date(arrival_date)"}).\
values('arrival_date').annotate(count=Count('request_name'))
print(reports)


And I need help
--
TUYIZERE Eugene

Msc Degree in Mathematical Science

African Institute for Mathematical Sciences (AIMS Cameroon)
Crystal Garden-Lime, Cameroon


Bsc in Computer Science

UR-Nyagatare Campus

Email: eugene....@aims-cameroon.org
           eugenet...@gmail.com

Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

--
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/CABxpZHstWyfMVKQhJb%3DxGKff3p3V%2BFQ_w3DkYVpOe-pEW2ySKg%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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKGT9myp4HU6%2BZo6d-JqeaTPsevFBMi_DzU_xuwo3LUja%3DxzRw%40mail.gmail.com.


--
TUYIZERE Eugene

Msc Degree in Mathematical Science

African Institute for Mathematical Sciences (AIMS Cameroon)
Crystal Garden-Lime, Cameroon


Bsc in Computer Science

UR-Nyagatare Campus

Email: eugene....@aims-cameroon.org
           eugenet...@gmail.com

Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38


--
TUYIZERE Eugene

Msc Degree in Mathematical Science

African Institute for Mathematical Sciences (AIMS Cameroon)
Crystal Garden-Lime, Cameroon


Bsc in Computer Science

UR-Nyagatare Campus

Email: eugene....@aims-cameroon.org
           eugenet...@gmail.com

Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

--
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/CABxpZHtJhxd3-B%3DpzsAhqg_kR68zTvbJKd%2BgeBUqRjGMP%2BxgxQ%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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGp2JVGM87kRnp%2BZY_J8fKb2d_mU5Vvxv033oQSZ-ChHAeiFCA%40mail.gmail.com.


--
TUYIZERE Eugene

Msc Degree in Mathematical Science

African Institute for Mathematical Sciences (AIMS Cameroon)
Crystal Garden-Lime, Cameroon


Bsc in Computer Science

UR-Nyagatare Campus

Email: eugene....@aims-cameroon.org
           eugenet...@gmail.com

Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

--
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...@googlegroups.com.


--
TUYIZERE Eugene

Msc Degree in Mathematical Science

African Institute for Mathematical Sciences (AIMS Cameroon)
Crystal Garden-Lime, Cameroon


Bsc in Computer Science

UR-Nyagatare Campus

Email: eugene....@aims-cameroon.org
           eugenet...@gmail.com

Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

--
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/63a82f60-e533-41f5-b1e9-0159b37b58b0n%40googlegroups.com.


--
TUYIZERE Eugene

Msc Degree in Mathematical Science

African Institute for Mathematical Sciences (AIMS Cameroon)
Crystal Garden-Lime, Cameroon


Bsc in Computer Science

UR-Nyagatare Campus

Email: eugene.tuyizere@aims-cameroon.org
           eugenetuyizere@gmail.com

Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

--
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/CABxpZHsJVbdpwEwpp-_kM3PN6xZ59reCvbJbzMgE_2pSxMeiRA%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/CAGp2JVHmjfN3_KFB9eMk%2BzMtii9QeDy4dL1qFKMT%2BRVjQOFrFA%40mail.gmail.com.


--
TUYIZERE Eugene

Msc Degree in Mathematical Science

African Institute for Mathematical Sciences (AIMS Cameroon)
Crystal Garden-Lime, Cameroon


Bsc in Computer Science

UR-Nyagatare Campus

Email: eugene.tuyizere@aims-cameroon.org
           eugenetuyizere@gmail.com

Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

--
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/CABxpZHuvFye2tB2rSS_uWB4g2DXAjLTG2i0zvzO1rDpdqJtvNQ%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/CAGp2JVGh3zGsJ%2BtwRqKYxdoUEo3-Pr72uHC7B8LZRPbQm%3DHwQQ%40mail.gmail.com.


--
TUYIZERE Eugene

Msc Degree in Mathematical Science

African Institute for Mathematical Sciences (AIMS Cameroon)
Crystal Garden-Lime, Cameroon


Bsc in Computer Science

UR-Nyagatare Campus

Email: eugene.tuyizere@aims-cameroon.org
           eugenetuyizere@gmail.com

Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

--
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/CABxpZHsFtuHWY0rJuxfPOteAUZuPG%2BJ3G-av%3DSeP8DiWYAs6kw%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/CAGp2JVHSq%3DC2wyp%3D8arnm1xn1BkuU53nb6J2YyW%2BFwYBnB9UNA%40mail.gmail.com.


--
TUYIZERE Eugene

Msc Degree in Mathematical Science

African Institute for Mathematical Sciences (AIMS Cameroon)
Crystal Garden-Lime, Cameroon


Bsc in Computer Science

UR-Nyagatare Campus

Email: eugene.tuyizere@aims-cameroon.org
           eugenetuyizere@gmail.com

Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

--
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/CABxpZHtM-tgH77BN%3DHa5zyHgkR8APBU5%3DVHu4TFKYe6_PRSeRQ%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/CAGp2JVHuZ%2BxF9nQMBCC4g8XqN74n7ZAWNWK4%3D5XDMcXKS6m%2BFQ%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/CA%2BCuM3CFG5NiGsvMjSf9CmVOpsRtBF8TW83y8c1A1zkcqMA-wA%40mail.gmail.com.