Re: Unable to deploy heroku app

2022-10-27 Thread Abdul Qoyyuum Haji Abdul Kadir
Hi Aman,

Did you add the Python buildpack to heroku? If you have, maybe clear it
first and re add the buildpack. See here:
https://stackoverflow.com/a/63584726/1431104

On Thu, Oct 27, 2022 at 9:55 PM Aman Nadaf  wrote:

> Hello,
>
> I am following  *Django for Beginners Build websites with Python & Django* by
> *William S. Vincent.*
>
> I am about to end the third chapter but there is last command  *heroku
> ps:scale web=1 *
> but everytime I run it I get error message saying *Scaling dynos... !*
> * !Couldn't find that process type (web).*
>
> *Image 1: *Powershell when I run the command
> *Image 2:* Directory
> *Image 3:* Necessary files opened in VS code
>
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/360e0fbc-59db-4bfa-a916-3c6700e3eed7n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/360e0fbc-59db-4bfa-a916-3c6700e3eed7n%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
<https://about.me/qoyyuum?promo=email_sig_source=product_medium=email_sig_campaign=gmail_api_content=thumb>
Abdul Qoyyuum Haji Abdul Kadir
about.me/qoyyuum
<https://about.me/qoyyuum?promo=email_sig_source=product_medium=email_sig_campaign=gmail_api_content=thumb>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANVqoJ_yXxioe%2Ba7tOa0bRkoNTUVsjRjBQ1D8xASs_Qadqa7XA%40mail.gmail.com.


Re: Help

2022-09-27 Thread Abdul Qoyyuum Haji Abdul Kadir
That Udemy link is no longer valid.

The Django official docs has a tutorial and is more relevant to the latest
version versus older YouTube videos.

https://docs.djangoproject.com/en/4.1/

Abdul Qoyyuum Bin Haji Abdul Kadir
HP: +673 720 8043
about.me/qoyyuum

On Tue, Sep 27, 2022, 10:41 PM peteru mimo  wrote:

> Good morning
>
> Check the
> https://www.udemy.com/course/draft/3427466/learn/lecture/21717840?start=15#overview
> is free on udemy
>
> Regard
>
> On Mon, Sep 26, 2022 at 9:11 PM Balogun Awwal 
> wrote:
>
>> Hello I just learnt python I’m looking to learn django can you recommend
>> some tutorials and it will also be very helpful if I can get a mentor also
>> please
>>
>> Sent from awwal
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CD4750AF-8818-422E-A96C-E193D6E5944A%40gmail.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJBAA1%2Bcfj0vQGxX%2BKYpnnoKpFxmUQ6oW6d2WBsr-d15_Nu4PA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAJBAA1%2Bcfj0vQGxX%2BKYpnnoKpFxmUQ6oW6d2WBsr-d15_Nu4PA%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANVqoJ9FKrtxDu3ViH11OGnfrFX%3Dq953UiONjTLZxAMvPJzc1g%40mail.gmail.com.


Re: Use include template tag in another app template folder

2022-09-02 Thread Abdul Qoyyuum Haji Abdul Kadir
It would be problematic. Just copy and paste the template file from one app
into the other.

Abdul Qoyyuum Bin Haji Abdul Kadir
about.me/qoyyuum

On Fri, Sep 2, 2022, 5:22 PM mohamed khaled 
wrote:

> I have two apps each one has template folder I want to use *include *template
> tag to get template from other app how can I handle that
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/91eeb0b2-304a-4fef-94b1-e407ef82fbfcn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/91eeb0b2-304a-4fef-94b1-e407ef82fbfcn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANVqoJ_L04oFerwgjod3hTUgvOfoDUb2kW8mn%3Dt1pxvsC8swjQ%40mail.gmail.com.


Re: Deploy Django Project in AAPanel

2022-09-01 Thread Abdul Qoyyuum Haji Abdul Kadir
Hi Javier,

This doesn't sound like an issue with Django.

Try raising a ticket on AAPanel GitHub repo with a full error message and
steps to reproduce it.

Abdul Qoyyuum Bin Haji Abdul Kadir
about.me/qoyyuum

On Thu, Sep 1, 2022, 8:11 AM Javier L. Camacaro 
wrote:

> Does someone how to deploy a Django Project in AAPanel?
>
> I tried Python Maganer 2.0 but impossible for me!
> I get this error:
>
> Sorry, something went wrong: Traceback (most recent call last): File
> "class/flask_sockets.py", line 30, in *call* handler, values =
> adapter.match() File
> "/www/server/panel/pyenv/lib/python3.7/site-packages/werkzeug/routing.py",
> line 1945, in match raise NotFound() werkzeug.exceptions.NotFound: 404 Not
> Found: The requested URL was not found on the server. If you entered the
> URL manually please check your spelling and try again.
>
> ...and many others after that
>
> Please help me
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/66e880c0-9561-41bb-93bb-e08475f9eb19n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/66e880c0-9561-41bb-93bb-e08475f9eb19n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANVqoJ8%3DNe7DREP8KKase32F%2B7s9DFt0oh236906ZENe89Lwzg%40mail.gmail.com.


Re: I want to fetch the value of radio field for updation but it only doesn't fetch even i use condition and value does comes but doesn't checked

2022-08-22 Thread Abdul Qoyyuum
You'll need to use a RadioSelect widget. See example in the link as
follows:
https://docs.djangoproject.com/en/4.0/ref/forms/widgets/#django.forms.RadioSelect

On Mon, Aug 22, 2022 at 2:57 PM Abhinandan K 
wrote:

> Email
> 
> {% with val_gen=datas.gender%}
> {{val_gen}}
> gender:
>
>  checked{% endif %} >Male
>  checked{% endif %}>Female
> 
> {% endwith %}
> 
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAA6_Mp44RQjMeWfVW82vvT2-GLrv5Jpu2nb_6edWON_3sgXQwQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAA6_Mp44RQjMeWfVW82vvT2-GLrv5Jpu2nb_6edWON_3sgXQwQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
Abdul Qoyyuum Bin Haji Abdul Kadir
HP No: +673 720 8043

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA3DN%3DVe_NWF4kMxd18zW%3DOzND1YiYkvuyjmZgs5JxcX0UaQAQ%40mail.gmail.com.


Re: tmichroservices in django

2022-08-17 Thread Abdul Qoyyuum
Package each app as a separate django app.

On Wed, Aug 17, 2022 at 10:51 PM yaron amir  wrote:

> do you implement michroservices in django and if so how?
> Like
> Comment
> Send
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/fd81706b-6765-4805-9360-afb35753cc62n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/fd81706b-6765-4805-9360-afb35753cc62n%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Abdul Qoyyuum Bin Haji Abdul Kadir
HP No: +673 720 8043

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA3DN%3DXaaw6c3Az4fDghGsK%3DOXPhW6-C3g9Fzc%2BUO%2BOP7JvOKg%40mail.gmail.com.


Re: dlango MultiValueDictKeyError

2022-08-10 Thread Abdul Qoyyuum
What have you tried to do? Is there a particular key that causes this? Can
you share the full stack traceback please?

On Wed, Aug 10, 2022 at 9:49 PM Benji Zachariah 
wrote:

> I am getting an below error in module GET and POST
>
> MultiValueDictKeyError at /user-details
>
> 'Name'
>
> Request Method:GET
> Request URL:http://127.0.0.1:8000/user-details
> Django Version:4.0.6
> Exception Type:MultiValueDictKeyError
> Exception Value:
> 'Name'
> Exception Location:
>  
> C:\Users\Megha\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\datastructures.py,
> line 86, in __getitem__
> Python Executable:
>  C:\Users\Megha\AppData\Local\Programs\Python\Python310\python.exe
> Python Version:3.10.5
> Python Path:
> ['C:\\Users\\Megha\\django\\form',
>
>  
> 'C:\\Users\\Megha\\AppData\\Local\\Programs\\Python\\Python310\\python310.zip',
>  'C:\\Users\\Megha\\AppData\\Local\\Programs\\Python\\Python310\\DLLs',
>  '
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d62d078b-87b7-40c3-82fe-ad203e724357n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d62d078b-87b7-40c3-82fe-ad203e724357n%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Abdul Qoyyuum Bin Haji Abdul Kadir
HP No: +673 720 8043

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA3DN%3DV43KFnKTM92wBj5L5z9f92WmS0NcRzjkaOrird8Xr0iw%40mail.gmail.com.


Re: Combine Existing React App with Existing Django App

2022-08-03 Thread Abdul Qoyyuum
Yes it can be done. Django to provide API endpoints. React app to connect
to those API endpoints.

Abdul Qoyyuum Bin Haji Abdul Kadir
System Engineer at Card Access Services
HP: +673 720 8043

On Thu, Aug 4, 2022, 8:38 AM Lightning Bit <
thelegendofearthretu...@gmail.com> wrote:

> Is it possible to combine an existing React App with an existing Django
> App?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7e99a963-08bf-4d76-b80e-2c42576b0ca1n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/7e99a963-08bf-4d76-b80e-2c42576b0ca1n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA3DN%3DU_RF%2B1EwcE7FHAndTr5k%3DBR4UStxQYtDSE9h2krpiJgg%40mail.gmail.com.


Re: Hi guys how to run pyscript on local webserver without using cdn ljnk

2022-08-01 Thread Abdul Qoyyuum
Download it from https://pyscript.net/ and load it on your local webserver.

On Fri, Jul 29, 2022 at 10:59 PM Ad Tariq  wrote:

>
>
> Sent from my Huawei 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6ywask-egl8ube6tn3j-gnugz6tq5tn5-981h8o-fbbyrfs04g4p-dy72o68w852c9bhuw0fdasxpttm02p-njks7934b8sl-h99obj3i1f0vq63om8-okzqxt-kcl72n-o861ua-tut0wbuki823ym9cfl.1659106691758%40email.android.com
> .
>


-- 
Abdul Qoyyuum Bin Haji Abdul Kadir
HP No: +673 720 8043

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA3DN%3DXEogAC9pMHaig_%2B-XK%3DkwmFPYr2LxFzSXo6beYJbQf-g%40mail.gmail.com.


Re: Why do we need Django rest framework when our conventional django do what we want?

2022-07-31 Thread Abdul Qoyyuum
It really depends on your usecase. If you find that you can work without an 
API for your ecommerce website, then you don't need it. If you believe you 
need to make your ecommerce as a headless ecommerce site, then you need an 
API or GraphQL or other means of sharing data.

On Sunday, July 31, 2022 at 10:24:17 PM UTC+8 josephb...@gmail.com wrote:

>
> I am stuck in a loop of confusion. I am trying to build an ecommerce 
> website and make it production ready. Do i need to build an API for it?
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1ad7a40e-db94-488a-86fc-bf3654936b48n%40googlegroups.com.


Re: How to create current user field in dango rest framework

2022-07-28 Thread Abdul Qoyyuum
A quick search on Stack overflow shows me this:
https://stackoverflow.com/a/43032332

Abdul Qoyyuum Bin Haji Abdul Kadir
System Engineer at Card Access Services
HP: +673 720 8043

On Thu, Jul 28, 2022, 4:19 AM Ashok garsulla 
wrote:

> Please tell me how can I create current User in dango Rest Framework
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/21baa025-b118-4f15-bba3-52f4875c1d33n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/21baa025-b118-4f15-bba3-52f4875c1d33n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA3DN%3DV4K-xvnN_%2B9w-XpE684qqNhduBPAwXrc54TPM3S1zqDA%40mail.gmail.com.


Re: please help me to solve

2022-07-26 Thread Abdul Qoyyuum
This is a Django group. I don't know how its implemented in Android but for
your use case, you will need to learn Socket programming. Other than that,
I can't help you. Sorry.

On Tue, Jul 26, 2022 at 6:55 PM Chelsea Fan 
wrote:

> Hello, such a question, we plan to implement an application for Android,
> for a TV and for a phone, it will be an application with the broadcast of
> different channels, you will need to stream somehow, i.e. there is no
> direct access.
> which technologies I 'v to use for it?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJwZnde2MU7REjt-GTJc%3DR7NsmND9wVen_EgnghdQQziZcxJMw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAJwZnde2MU7REjt-GTJc%3DR7NsmND9wVen_EgnghdQQziZcxJMw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
Abdul Qoyyuum Bin Haji Abdul Kadir
HP No: +673 720 8043

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA3DN%3DWBB3tCjYZMDo5q7ce85-7u64uUB6eWhkjpb-0BfEVJVQ%40mail.gmail.com.


Re: Best digital ocean plan for a production server

2022-07-24 Thread Abdul Qoyyuum
Not sure what you mean. All of those can be in separate docker images to
build (except for 11 and 13) but have to be docker-composed properly. But
since you're moving to Docker images, you can then instead deploy to any
Kubernetes cluster and scale with X number of nodes. Even better if you
want to test and make sure all of the deploy settings work properly each
time with Terraform but that's my opinion.
https://www.digitalocean.com/community/questions/best-practices-to-deploy-docker-on-digitalocean-using-terraform

On Sun, Jul 24, 2022 at 1:22 AM Ram  wrote:

> Thank you all for your input. I would like to sign up for a plan which can
> let us focus only on coding and still scalabile, but my concern is our
> application requires following:
>
> 1. Linux OS
> 2. Postgres
> 3. Python 3.10
> 4. Django latest
> 5. Vue.js
> 6. Gunicorn
> 7. Nginx
> 8. Let's Encrypt or any SSL
> 9. Redis
> 10. Celery
> 11. Github
> 12. Jenkins CI/CD
> 13. Support for API: Stripe, Twillio, Google and etc.
>
> If these can be packaged into a docker image that would be great. I know
> some of them cannot be in Docker image. I'm planning to check this with
> both Digital Ocean and Heroku anyway, but I wanted to understand experts
> advice in this community.
>
> Best regards,
> ~Ram
>
> On Wed, Jul 13, 2022 at 12:24 AM Abdul Qoyyuum 
> wrote:
>
>> I prefer Heroku and deploying Django as a docker image to Heroku. Less
>> maintenance, worry less about server setups and focus more on code than
>> anything else (i.e. serverless). Start with a hobby plan and if able to get
>> customers, then start paying for scalability features.
>>
>> On Sunday, July 10, 2022 at 11:21:00 AM UTC+8 ram.mu...@gmail.com wrote:
>>
>>> Hi,
>>>
>>> We are planning to launch our application in production once all the
>>> testing is completed after deployment to our development server. We are
>>> using Jenkins CI automation to deploy the code to the development server
>>> and we will do the same in production server too, but we are currently
>>> doing a feasibility study to understand which options are good for Django
>>> web application for both Web and Mobile app.
>>>
>>> If anyone in this Django users community is currently on any Digital
>>> Ocean's production server plan, could you share some details and
>>> suggestions.
>>>
>>> Best regards,
>>> ~Ram
>>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/be3bb62c-7ce7-47c6-8bc1-80951927712dn%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/be3bb62c-7ce7-47c6-8bc1-80951927712dn%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/C_v8NaMOx4Q/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2BOi5F0zneD-%2BmKb8dZcV8iu-5pryw2Yt9djnjJisWr6k381ow%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CA%2BOi5F0zneD-%2BmKb8dZcV8iu-5pryw2Yt9djnjJisWr6k381ow%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
Abdul Qoyyuum Bin Haji Abdul Kadir
HP No: +673 720 8043

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA3DN%3DW03Tpj%3Dxs61o5cNUCn21bOk2xjXuemArcAG4P0oiChkw%40mail.gmail.com.


Re: problem

2022-07-20 Thread Abdul Qoyyuum
Maybe print your "messages" and confirm if there's no "info" attribute or
method to it.

On Wed, Jul 20, 2022 at 11:12 PM chaouch elhem 
wrote:

> [image: image_2022-07-20_133032905.png]
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/02625cc0-2c42-476c-8505-8a9df707b910n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/02625cc0-2c42-476c-8505-8a9df707b910n%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Abdul Qoyyuum Bin Haji Abdul Kadir
HP No: +673 720 8043

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA3DN%3DVNbav0N05fKj%3D1mYoNFCZ%2Bukr9QBJhtnWa8HG3122icw%40mail.gmail.com.


Re: Chat app using django

2022-07-20 Thread Abdul Qoyyuum
Please have a look at how Django channels implements the chat app.
https://github.com/narrowfail/django-channels-chat

On Wed, Jul 20, 2022 at 7:23 PM Lakshyaraj Dash <
dashlakshyaraj2...@gmail.com> wrote:

> Ok I understand but currently I'm using postgresql in my app. So I need it
> for that. Please help me to inject the websockets in django as I'm very
> much new to it *not websockets* but to *integration of websockets in
> django*.
>
> On Wed, Jul 20, 2022, 08:28 Abdul Qoyyuum 
> wrote:
>
>> Hi Lakshyaraj,
>>
>> Chat app relies on quickly sending data between parties. You will need to
>> build it with websockets and a redis database to publish and subscribe new
>> event messages. However, this is basically reinventing the wheel versus
>> using one that already exists (i.e. Django Channels). But all the best to
>> you.
>>
>> On Wed, Jul 20, 2022 at 8:41 AM Lakshyaraj Dash <
>> dashlakshyaraj2...@gmail.com> wrote:
>>
>>> Hello guys!
>>> I'm having a discussion website in django with some sort of user
>>> authentication and I want to inject chat app with rooms made by the users
>>> themselves. I don't want any js framework in the frontend. Just tell me how
>>> to make this type of chat app using django (not Django channels).
>>>
>>> Thanks and regards
>>> Lakshyaraj Dash
>>>
>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAF7qQgD7Ryvnp%2BPp74cs6aogFz32TQiKsH71X3WGcnrPG2FDdQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAF7qQgD7Ryvnp%2BPp74cs6aogFz32TQiKsH71X3WGcnrPG2FDdQ%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>>
>>
>> --
>> Abdul Qoyyuum Bin Haji Abdul Kadir
>> HP No: +673 720 8043
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAA3DN%3DUDSUnjOQTL%2BmPZn15oVnTPyUpNuG4DyukypVa9z%3DySOA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAA3DN%3DUDSUnjOQTL%2BmPZn15oVnTPyUpNuG4DyukypVa9z%3DySOA%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAF7qQgA%2BoqEqisB6djbdQ7NmTMJxczr36h6FdyF_PT0xX1G%3D8w%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAF7qQgA%2BoqEqisB6djbdQ7NmTMJxczr36h6FdyF_PT0xX1G%3D8w%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
Abdul Qoyyuum Bin Haji Abdul Kadir
HP No: +673 720 8043

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA3DN%3DUbifEnMGUKpTYGeMWKuaB%2BmpM0-tBwM27CZau%3DiWBepQ%40mail.gmail.com.


Re: Remote database using ssh

2022-07-19 Thread Abdul Qoyyuum
We don't know if your DB is in the same network or not as your Django App
server but the answer is to open the database port on the database server.
If you're using postgresql on the Database, then install a psql client on
the app server and test connect from there. If it works, then your Django
should also work too.

On Tue, Jul 19, 2022 at 11:32 PM Wennie Catabay 
wrote:

> Hello,
>
> I am stuck on defining how to connect a remote database from another
> server using ssh. I am able to connect the remote database with putty using
> ssh, but but I don't know how to apply it in django.
>
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d0c2f56f-c739-4508-8529-4c5107f08636n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d0c2f56f-c739-4508-8529-4c5107f08636n%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Abdul Qoyyuum Bin Haji Abdul Kadir
HP No: +673 720 8043

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA3DN%3DWPXTKCnK9yS56Rd5zR%3Dqh2FPQbz%3D%3Dr85ayQofnLnjLqA%40mail.gmail.com.


Re: Chat app using django

2022-07-19 Thread Abdul Qoyyuum
Hi Lakshyaraj,

Chat app relies on quickly sending data between parties. You will need to
build it with websockets and a redis database to publish and subscribe new
event messages. However, this is basically reinventing the wheel versus
using one that already exists (i.e. Django Channels). But all the best to
you.

On Wed, Jul 20, 2022 at 8:41 AM Lakshyaraj Dash <
dashlakshyaraj2...@gmail.com> wrote:

> Hello guys!
> I'm having a discussion website in django with some sort of user
> authentication and I want to inject chat app with rooms made by the users
> themselves. I don't want any js framework in the frontend. Just tell me how
> to make this type of chat app using django (not Django channels).
>
> Thanks and regards
> Lakshyaraj Dash
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAF7qQgD7Ryvnp%2BPp74cs6aogFz32TQiKsH71X3WGcnrPG2FDdQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAF7qQgD7Ryvnp%2BPp74cs6aogFz32TQiKsH71X3WGcnrPG2FDdQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
Abdul Qoyyuum Bin Haji Abdul Kadir
HP No: +673 720 8043

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA3DN%3DUDSUnjOQTL%2BmPZn15oVnTPyUpNuG4DyukypVa9z%3DySOA%40mail.gmail.com.


Re: External Authentication with username in header

2022-07-17 Thread Abdul Qoyyuum
That sounds like a Single Sign On or a Central Authentication Service. This
stackoverflow shows some suggestions
https://stackoverflow.com/q/4662348/1431104

Or if your "External Authentication" is a known provider service, you could
take a look at django-allauth.

On Sat, Jul 16, 2022 at 5:30 AM Mark Glass  wrote:

> I would like to change the link that opens a Django app. Currently the app
> is launched with GET http://localhost:8000. I would like to include a
> username and password in the header. The header would be intercepted
> somehow (Middleware?) and the user marked as authenticated. The app will
> then launch for the user with a default role.
>
> This will replace a login page and Django internal authentication.
>
> Can I implement this using middleware? If so, how?
>
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4f1b2a47-6d3d-45e2-9c93-8bbca78d3e34n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/4f1b2a47-6d3d-45e2-9c93-8bbca78d3e34n%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Abdul Qoyyuum Bin Haji Abdul Kadir
HP No: +673 720 8043

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA3DN%3DVj_A-ZVGVW8bWTM-f-5g4P8JXfEgN4kNqeot6d01-xAA%40mail.gmail.com.


Re: Log out via GET requests is deprecated

2022-07-17 Thread Abdul Qoyyuum
Use the logout facility
https://docs.djangoproject.com/en/4.1/topics/auth/default/#how-to-log-a-user-out

from django.contrib.auth import logout

def logout_view(request):
logout(request)
# Redirect to a success page.

Abdul Qoyyuum Bin Haji Abdul Kadir
System Engineer at Card Access Services
HP: +673 720 8043

On Mon, Jul 18, 2022, 12:59 AM אורי  wrote:

> Hi,
>
> Log out via GET requests is deprecated from Django 4.1 and will be removed
> in Django 5.0. I have a view where the user has to be logged in (otherwise
> it redirects to login), and then I check if the user logged in is not the
> correct user, and if they are different - I redirect the user to logout
> (via GET), which should then be redirected again to login, and then
> redirected to the same view:
>
> from django.views import generic
> from django.views.generic.detail import SingleObjectMixin
> from rules.contrib.views import LoginRequiredMixin, PermissionRequiredMixin
>
> class VerifyUserEmailAddressView(LoginRequiredMixin, SingleObjectMixin,
> generic.View):
> ...
> def get(self, request, *args, **kwargs):
> email_address = self.get_object()
> if (not (email_address.user == self.request.user)):
> return
> redirect(to='{}?next={}'.format(reverse('accounts:logout'),
> self.request.get_full_path()))
> assert (email_address.user == self.request.user)
> ...
>
> Now, what should I do instead of redirecting the user to logout view? How
> do I implement it with POST?
>
> Thanks,
> אורי
> u...@speedy.net
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABD5YeE0c%2B17cUgiU2tLp7L0zFjEfTVmJ6B3KvkwEftvGsuQBw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CABD5YeE0c%2B17cUgiU2tLp7L0zFjEfTVmJ6B3KvkwEftvGsuQBw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA3DN%3DWjhN8Mqx56%3DwvDHJ1S-kQcDh5kVTBrvh2-1qLigeyFWw%40mail.gmail.com.


Re: Using activate() to set the timezone in Model Admin

2022-07-13 Thread Abdul Qoyyuum
You can set this up in Admin site with activate() as you found out. This
stack overflow answer shows that the developer uses stackedinline on the
admin site when representing to the user.
https://stackoverflow.com/a/38730431

Abdul Qoyyuum Bin Haji Abdul Kadir
System Engineer at Card Access Services
HP: +673 720 8043

On Thu, Jul 14, 2022, 2:16 AM Paul Tiplady  wrote:

> I'd like to have my Admin site use a different default timezone than the
> rest of my django app.
>
> I prefer the backend and API to operate in UTC, because this is a general
> good practice for geographically distributed teams. However admin users
> (based in a specific timezone) find this confusing, and would like to see
> their datetimes in a local timezone (say, Pacific Time).
>
> The docs state that a local time can be set using activate():
> https://docs.djangoproject.com/en/4.0/ref/utils/#django.utils.timezone.activate
>
> Specifically:
> https://docs.djangoproject.com/en/4.0/topics/i18n/timezones/#default-current-time-zone
> says "You should set the current time zone to the end user’s actual time
> zone with activate()
> <https://docs.djangoproject.com/en/4.0/ref/utils/#django.utils.timezone.activate>.
> Otherwise, the default time zone is used.".
>
> Where should this be done to set the timezone only in the admin?
>
> Simon Wilson has a suggestion to set this globally using Middleware:
> https://til.simonwillison.net/django/show-timezone-in-django-admin
>
> I'm wondering if there's a better way that won't affect the TZ of
> non-admin requests. It seems that this should be configurable somewhere on
> the AdminSite.
>
> Has anyone made this work specifically for the Django Admin?
>
> Thanks!
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7d09876e-5cdf-4010-abb1-bdbf5a71f41fn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/7d09876e-5cdf-4010-abb1-bdbf5a71f41fn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA3DN%3DVtA_Y3T%2B548W5Wt_Oi9iv%2B%2BTb7BtjMmsU3%2BW9LAX-VUQ%40mail.gmail.com.


Re: Upload an image to firebase from django Html Page

2022-07-13 Thread Abdul Qoyyuum
You could instead use Whitenoise if Firebase Storage doesn't work out for 
you. http://whitenoise.evans.io/en/stable/

On Thursday, June 30, 2022 at 2:45:17 PM UTC+8 koushi...@gmail.com wrote:

> I want to get image in input tag in Html page and upload it to the 
> firebase storage when the HTML form(not Django Form) is submitted.
>
> I am unable to find solution for it. Everywhere i notice that all are 
> uploading image via javascript to firebase storage that too with an old 
> version which is not working for the current firebase version, I Need a 
> solution in django if there is no solution in django any documents or blogs 
> that explains how  to do it with the current firebase version is much 
> appreciated!
>
> Help me with your answers or any links related to those questions
>
> Thanks for your Time :)
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/212cafa4-6574-4f07-aa43-40d5c6553a57n%40googlegroups.com.


Re: Best digital ocean plan for a production server

2022-07-13 Thread Abdul Qoyyuum
I prefer Heroku and deploying Django as a docker image to Heroku. Less 
maintenance, worry less about server setups and focus more on code than 
anything else (i.e. serverless). Start with a hobby plan and if able to get 
customers, then start paying for scalability features.

On Sunday, July 10, 2022 at 11:21:00 AM UTC+8 ram.mu...@gmail.com wrote:

> Hi,
>
> We are planning to launch our application in production once all the 
> testing is completed after deployment to our development server. We are 
> using Jenkins CI automation to deploy the code to the development server 
> and we will do the same in production server too, but we are currently 
> doing a feasibility study to understand which options are good for Django 
> web application for both Web and Mobile app. 
>
> If anyone in this Django users community is currently on any Digital 
> Ocean's production server plan, could you share some details and 
> suggestions.
>
> Best regards,
> ~Ram
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/be3bb62c-7ce7-47c6-8bc1-80951927712dn%40googlegroups.com.


Re:

2022-07-13 Thread Abdul Qoyyuum
You'll need to read the official doc. There is no price in djstripe 
models. https://dj-stripe.dev/reference/models/

On Tuesday, July 12, 2022 at 3:54:01 PM UTC+8 abhin...@snakescript.com 
wrote:

> monthly_price = models.ForeignKey(stripe_models.Price,
> AttributeError: module 'djstripe.models' has no attribute 'Price'
>
>
>
>
> why this error comes again and again
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ca418769-428e-4528-b9a4-215c00aa8286n%40googlegroups.com.


Re: Django email | Gmail | Outlook

2022-06-13 Thread Abdul Qoyyuum
There are other alternatives if you use Django-Anymail package. Go 
to https://anymail.dev/en/stable/ to see a list of supported 3rd party 
email services. Some have free limits for you to use. Good luck!

On Monday, May 30, 2022 at 7:22:38 PM UTC+8 devfem...@gmail.com wrote:

> *Google* no longer support less seureappswhat next?
> is there anyway we can use gmail for Django email?
>
>
> if no way please send the best lesson for *Outlook* configuration :)
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7f261021-456f-49df-8d35-b1b4885c2a25n%40googlegroups.com.


Re: Need best tutorial

2022-06-13 Thread Abdul Qoyyuum
Don't go straight to web development until you understand how Python works, 
especially when dealing with imports and managing variables in different 
scopes.

I recommend learning from https://automatetheboringstuff.com as well as the 
Dive Into Python3. Both have some decent level of practice projects enough 
for you to get into it.

I would rather you try out Flask instead of Django because Django is very 
bloated with lots of packages and dependencies to be familiar with. Flask 
is very basic and simple enough for Web Development. But once you 
understand and have built a Flask Web App or Flask REST API, then you can 
try out Django.

Good luck!

On Monday, June 13, 2022 at 2:59:39 AM UTC+8 ghalib...@gmail.com wrote:

> hi there, i am beginner in python. can anyone share python best tutorial 
> for web development please

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/36e59af6-ab8a-4fdf-a036-362e21f2482an%40googlegroups.com.


Re: Can't login with Username

2022-06-13 Thread Abdul Qoyyuum
Create another superuser with 

python manage.py createsuperuser --username=joe --email=j...@example.com

And then, login with joe and your new password.

On Monday, June 13, 2022 at 9:39:04 PM UTC+8 sudip.flyon...@gmail.com wrote:

> Hi All,
>
> I am practicing Django since 3 months and recently I encountered an issue 
> with my practice project as I made a super user and didn't added email to 
> it.
> Then after I set email as the USERNAME_FIELD = 'email' in my django model 
> to access the database. But not I don't know how to add email after making 
> migrations to it.
> I had also tried by commenting *USERNAME_FIELD = 'email'* and 
> *REQUIRED_FIELDS 
> = [], *but didn't worked well and I'm unable to login to my django admin 
> database.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b8fd6ea3-9dba-4e53-8f1a-08d6ef9c5a9en%40googlegroups.com.


Re: error save to model on a onto many relationship

2021-06-10 Thread Abdul Qoyyuum
What happens if you try and save choice#3 in question 1 only? Can you try 
in the Python shell? 

On Friday, June 11, 2021 at 8:38:37 AM UTC+8 suabiut wrote:

> I am running to some issue saving to models in a one to make relationship. 
> The error is described Here 
> 
>   
> . I would appreciate it if you could point me in the right direction.
>
> cheers,
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fec74c27-ac8e-4b8b-a88e-9b2b55099954n%40googlegroups.com.


Re: reagrding "{% csrf_token %}"issue on my web site login module

2019-05-30 Thread Abdul Qoyyuum
When you run the application and test the login, what do you see in the 
devtool's Network tab? Did you see if csrf_token is null? How about 
document.cookie? Is that also null? Is the document.cookie being passed to 
csrf_token in other ways?

Lots of ways to complete this in Angular/jQuery/Ajax or otherwise is 
presented in this document: https://docs.djangoproject.com/en/2.2/ref/csrf/

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/38a443bb-26be-45e2-8707-f0f9bf6522ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Create a real small business website with Django as soon as possible!!

2019-05-30 Thread Abdul Qoyyuum
Then just use a CMS like https://wagtail.io/. Wagtail is built on top of 
Django and its enough to cover all of your requirements. But its 
recommended that you go through Django tutorial in the docs first before 
trying out Wagtail though.

On Saturday, May 25, 2019 at 3:30:56 AM UTC+8, Siavash Siavashi wrote:
>
> I am new to Django and I want to create a personal business site using 
> this platform. I should say that i have some experience working with python 
> and html.
> In general in my business , customers on home page click on the type of 
> services that they want.Next, they should register some information about 
> the  service interesting.The content of my site should be display as the 
> language that is  selected. Then , I would study the registered requests 
> and response them by email.If a costumer want to check her/his request, it 
> will be informed on website by a tracking number and a note that I write 
> down after processing that request(only a small note about the request 
> checking situation and that the result is emailed to the costumer email).
>
> I could design and create model and database for my website,but my main 
> problem is views and templates.So i have some questions:
> 1- Is there a sample project to use its views and templates for my website 
> ?
> 2- is it possible to use built-in admin app views and templates in my 
> website? how ?
> 2- how to change the language of my website content? is there a sample 
> project?
>
> Thanks alot
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/1b0e9d2a-dd4b-4424-99a6-0db503345f5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Forbidden (CSRF token missing or incorrect)

2019-05-21 Thread Abdul Qoyyuum
Hi Django Devs,

Got a problem that I don't understand what's going on or why its gone 
missing.

Logs says:
csrf.py:process_view#184: Forbidden (CSRF token missing or incorrect.)


The necessary code is in there:

$("document").ready(function () {

//
//Setup X-CSRFToken header for
//XHR requests.
//
$.ajaxSetup({
beforeSend: function (xhr, settings) {
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we 
want?
if (cookie.substring(0, name.length + 1) == (name + 
'=')) {
cookieValue = decodeURIComponent(cookie.
substring(name.length + 1));
break;
}
}
}
return cookieValue;
}

if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings
.url))) {
// Only send the token to relative URLs i.e. locally.
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
}
}
});



However, on the Network DevTools, it shows that the CSRFToken is null

Host: django.project.localhost
User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:66.0) Gecko/20100101 
Firefox/66.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Referer: https://xxx.xxx.xxx.xxx/someURL
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-CSRFToken: null
X-Requested-With: XMLHttpRequest
Content-Length: 347
Connection: keep-alive
Cookie: cookiesession1=05D05AA6TMRNUKHVEOY2WSF7DYB0F3; 
csrftoken=CY9TvQT97LpOZDhF6xZldBrAX4Igyt; 
sessionid=1e4c34b81175fb33465c0197e4ec3a

So as we can see the csrftoken is there, but not able to get it and store 
in X-CSRFToken, even though the code hasn't changed, now its not working.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/06c22757-9814-4d02-b340-3e7e4373c420%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.