Re: Image Uploaded by Ckeditor using Django to AWS S3 gone after certain amount of time

2020-09-09 Thread hans alexander
I tried to put

AWS_QUERYSTRING_AUTH = False
AWS_S3_BUCKET_AUTH = False

on settings.py,

it didn't work.

Thanks.


On Wed, Sep 9, 2020 at 3:16 PM hans alexander  wrote:

> I see on this link
>>
>
>
> https://stackoverflow.com/questions/63096379/django-ckeditor-upload-image-link-expires-after-some-hours
>
> Has no solution yet. He got the same problem as me.
>
> I'm currently still trying to find solution, tinkering aws s3 settings to
> set the expired time.
>
> Any suggestions would help.
> 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/CANV3w%3DZ_Ug%2BSA4%2BSCmje%3DuSUrgrc2cxBG9rwdKj_rUc63Xc6Ew%40mail.gmail.com.


Re: Image Uploaded by Ckeditor using Django to AWS S3 gone after certain amount of time

2020-09-09 Thread hans alexander
>
> I see on this link
>

https://stackoverflow.com/questions/63096379/django-ckeditor-upload-image-link-expires-after-some-hours

Has no solution yet. He got the same problem as me.

I'm currently still trying to find solution, tinkering aws s3 settings to
set the expired time.

Any suggestions would help.
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/CANV3w%3DZeyhDYgxnPBkeLRFUdjjxWH7L%3DKtNWpBD4Q24ZinD_fA%40mail.gmail.com.


Re: Image Uploaded by Ckeditor using Django to AWS S3 gone after certain amount of time

2020-09-09 Thread hans alexander
I checked the file on my bucket, it's there. But somehow the link is not
working.

On Wed, Sep 9, 2020 at 1:13 PM hans alexander  wrote:

> I don't know what happened.
> Need solution for this.
>
> [image: image.png]
> [image: image.png]
>
> Any solutions would be appreciated. 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/CANV3w%3DYqh_76b6envEhehZH4eFmeFEFvvh1Jhbg%3DpdwJtGKb%2BQ%40mail.gmail.com.


Image Uploaded by Ckeditor using Django to AWS S3 gone after certain amount of time

2020-09-09 Thread hans alexander
I don't know what happened.
Need solution for this.

[image: image.png]
[image: image.png]

Any solutions would be appreciated. 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/CANV3w%3DZK%3DGA_emscvN9EDcPQiN5cWutJXoG6UVQXcStcj%3DL6Cg%40mail.gmail.com.


Re: I got this error "ValueError: attempted relative import beyond top-level package "

2020-09-08 Thread hans alexander
Thanks guys.. Already solved it.
I guess the main reason of the problem is that I'm using Pycharm Community
Edition.
So the alert error not accurate.

Anyway I tried to py manage.py with some alerts, and worked.
for example:
[image: image.png]
I left it like that. And sitemap still works.

But now the new problem is when I submitted my sitemap.xml to google search
console, I got this error.
[image: image.png]
I don't know why.

Even when I access the domain/sitemap.xml, the sitemap is showing.

Any suggestions?

Thanks

On Wed, Sep 9, 2020 at 4:20 AM coolguy 
wrote:

> I did this long time ago and here is what i did...
>
> in settings.py
> SITE_ID = 1
> # Application definition
> INSTALLED_APPS = [
># ...
>'django.contrib.sites',
>'django.contrib.sitemaps',
> ]
>
> run migration i.e.
> >>> py manage.py migrateOR python manage.py migrate
> after this step, sites application will be in sync with the database.
>
> create a file sitemaps.py in your blog application. Your sitemap.py seems
> okay to me.
>
> update your main project urls.py file
> 
> from django.contrib.sitemaps.views import sitemap
> from blog.sitemaps import BlogPostsSitemap
>
> sitemaps = {
> 'posts' : BlogPostsSitemap,
> }
>
> urlpatterns = [
>   
>   path('sitemap.xml', sitemap, {'sitemaps': sitemaps},
> name='django.contrib.sitemaps.views.sitemap'),
> ]
>
> Now run the development server and open (assuming you are using default
> configuration) http://127.0.0.1:8000/sitemap
>
> lets try...
>
> On Tuesday, September 8, 2020 at 2:53:12 PM UTC-4 hanz...@gmail.com wrote:
>
>> I followed a tutorial for creating django sitemap, but still got problems
>> along the way.
>> I've seen some videos, but didn't work.
>> Do you have any references for easy way creating django sitemap for blog
>> posts?
>> Sure it would help.
>>
>> Thanks
>>
>>
>>
>> On Wed, Sep 9, 2020 at 12:02 AM coolguy  wrote:
>>
>>> Not sure why you are importing this into your main project urls.py but
>>> its very straight forward
>>>
>>> from blog.sitemaps import BlogPostsSitemap
>>>
>>> question... are you trying to map the application url here? then you
>>> should use path('/' , Include("blog.urls"))
>>>
>>>
>>>
>>>
>>> On Tuesday, September 8, 2020 at 4:39:05 AM UTC-4 hanz...@gmail.com
>>> wrote:
>>>
 Sorry, point no 1 needs to be revised..
 1. In urls.py, I want to import BlogPostsSitemap


 --
>>> 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/0f74b537-3fa8-4725-8098-b602417ea41bn%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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/030f483b-fb0c-428c-ab8d-8e7d3b82eb40n%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANV3w%3DaDYQ5tGzNsr1r5bqCbcqAe5qEfnX7uBY%2BU2OK-%3DR09iw%40mail.gmail.com.


Re: I got this error "ValueError: attempted relative import beyond top-level package "

2020-09-08 Thread hans alexander
I followed a tutorial for creating django sitemap, but still got problems
along the way.
I've seen some videos, but didn't work.
Do you have any references for easy way creating django sitemap for blog
posts?
Sure it would help.

Thanks



On Wed, Sep 9, 2020 at 12:02 AM coolguy 
wrote:

> Not sure why you are importing this into your main project urls.py but its
> very straight forward
>
> from blog.sitemaps import BlogPostsSitemap
>
> question... are you trying to map the application url here? then you
> should use path('/' , Include("blog.urls"))
>
>
>
>
> On Tuesday, September 8, 2020 at 4:39:05 AM UTC-4 hanz...@gmail.com wrote:
>
>> Sorry, point no 1 needs to be revised..
>> 1. In urls.py, I want to import BlogPostsSitemap
>>
>>
>> --
> 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/0f74b537-3fa8-4725-8098-b602417ea41bn%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANV3w%3DaB3ipwfJuJQC-W3c9qq6AruPqqfqnV7ykJ%2BRjAYq1sLw%40mail.gmail.com.


Re:

2020-09-08 Thread hans alexander
I have seen that link, still got errors after trying to install twisted.
Guess the problem is that I'm using python 3.8.5. Guess it's not supported
for Django Channels.
Is there any safe way to downgrade python version ?
Or how to separate Global Python Version and Virtual Environment Python
Version?
I already have my virtual env for my project.

Please advise. Thanks

On Tue, Sep 8, 2020 at 5:48 PM RANGA BHARATH JINKA 
wrote:

> Hi,
>See this link.
>
> https://stackoverflow.com/questions/57000214/how-do-i-pip-install-twisted-without-getting-an-error
>   All the best
>
> On Tue, Sep 8, 2020 at 4:14 PM hans alexander  wrote:
>
>> I got errors when installing Django Channels.
>> I'm using Python 3.8.5, Django 3.1
>>
>> Installing using :
>> pip install channels
>>
>> I got error like this:
>>
>> Installing collected packages: twisted, daphne, channels
>> Running setup.py install for twisted ... error
>> ERROR: Command errored out with exit status 1:
>>(many error lines below)
>>
>> Please help. 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/CANV3w%3Db69GCOjap31KiAF%2BemS-zsDDDw96vHiMsKcWu9qW2hJg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CANV3w%3Db69GCOjap31KiAF%2BemS-zsDDDw96vHiMsKcWu9qW2hJg%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>
>
> --
> Thanks and Regards
>
> J. Ranga Bharath
> cell: 9110334114
>
> --
> 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/CAK5m315f%3D72cjw2R2WHu3xnRHdVyzCzuXW_1y7waFJreegRhbg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAK5m315f%3D72cjw2R2WHu3xnRHdVyzCzuXW_1y7waFJreegRhbg%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/CANV3w%3DY07FdRyNB%3DDw3cGq5%2BbPJ2k_jXZEh%3D-3RquQxJo8SYtA%40mail.gmail.com.


[no subject]

2020-09-08 Thread hans alexander
I got errors when installing Django Channels.
I'm using Python 3.8.5, Django 3.1

Installing using :
pip install channels

I got error like this:

Installing collected packages: twisted, daphne, channels
Running setup.py install for twisted ... error
ERROR: Command errored out with exit status 1:
   (many error lines below)

Please help. 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/CANV3w%3Db69GCOjap31KiAF%2BemS-zsDDDw96vHiMsKcWu9qW2hJg%40mail.gmail.com.


Re: I got this error "ValueError: attempted relative import beyond top-level package "

2020-09-08 Thread hans alexander
Sorry, point no 1 needs to be revised..
1. In urls.py, I want to import BlogPostsSitemap

-- 
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/CANV3w%3Db2gom-wc_jkB_Zdgy_xPUP6CSydRxO5T_0iysfu0otJg%40mail.gmail.com.


I got this error "ValueError: attempted relative import beyond top-level package "

2020-09-08 Thread hans alexander
my structure is like this:

my_project
   blog
  
  sitemaps.py
  
   my_project
  
  urls.py
  

Inside sitemaps.py :

from django.contrib.sitemaps import Sitemap
from .models import *

class BlogPostsSitemap(Sitemap):
changefreq = 'daily'
priority = 0.9
def items(self):
return PostModel.published.all()

def lastmod(self,obj):
return obj.updated


my case:
1. In settings.py I want to import BlogPostsSitemap.
2. I tried like this
[image: image.png]

but then I got an error "ValueError: attempted relative import beyond
top-level package" when I ran the server.

Is anyone here got the solution? Or maybe some references how to
create sitemap on django?

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/CANV3w%3DYhzmvdPakW%2B%2BgwNjG%3DzGiZ61wpmuDPdDOO%2BgxFJnU%3DSQ%40mail.gmail.com.


Re: Integrating User Accounts into Django Website

2020-09-05 Thread hans alexander
Try this one :
https://jawaban.online/forum/discuss/52/django-login-and-authentication/


On Sat, Sep 5, 2020 at 9:52 PM King Niko 
wrote:

> My apologies, I should have been more clear. I did not mean integrating
> users but rather building user accounts for a Django Website. I have a site
> up and running, the admin page works, but I do not know how to make a login
> page for visitors of the site.
>
> On Sat, Sep 5, 2020 at 9:56 AM hans alexander  wrote:
>
>> What do you mean by Integrating User? Django actually has built in
>> features for user accounts.
>>
>> On Sat, Sep 5, 2020 at 8:40 PM Lightning Bit <
>> thelegendofearthretu...@gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> Does anyone have experience with integrating user accounts into a Django
>>> Website? Are there any quality tutorials online?
>>>
>>> --
>>> 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/913e77c6-a9f3-4410-8b7a-46f36f20ae77n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/913e77c6-a9f3-4410-8b7a-46f36f20ae77n%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/CANV3w%3DbJEA_dcSNamTtvK6AvkcMFN0u5PKjuTq4rXYB3PTkd%3Dg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CANV3w%3DbJEA_dcSNamTtvK6AvkcMFN0u5PKjuTq4rXYB3PTkd%3Dg%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/CAO1EWpHsLgpEuioHCT2Gq0JO%3DUC6%3DX4QCgzGMRRe-FSL5cR_6w%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAO1EWpHsLgpEuioHCT2Gq0JO%3DUC6%3DX4QCgzGMRRe-FSL5cR_6w%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/CANV3w%3DaN%3D_9TkMaScUN465EzsOcRhuUfo6opCe3zPEsDxeDFSA%40mail.gmail.com.


Re: Integrating User Accounts into Django Website

2020-09-05 Thread hans alexander
What do you mean by Integrating User? Django actually has built in features
for user accounts.

On Sat, Sep 5, 2020 at 8:40 PM Lightning Bit <
thelegendofearthretu...@gmail.com> wrote:

> Hi all,
>
> Does anyone have experience with integrating user accounts into a Django
> Website? Are there any quality tutorials online?
>
> --
> 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/913e77c6-a9f3-4410-8b7a-46f36f20ae77n%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANV3w%3DbJEA_dcSNamTtvK6AvkcMFN0u5PKjuTq4rXYB3PTkd%3Dg%40mail.gmail.com.


Re: Image upload using django-summernote is ok in admin panel but not showing to user

2020-09-05 Thread hans alexander
You can use CKEditor 5 for creating content.
Check this

https://jawaban.online/scope/outlink/6025/django-ckeditor-pypi/


On Sat, Sep 5, 2020 at 6:46 PM sourav chakraborty 
wrote:

> Yes, but please suggest what should be the type of field then? As I want
> to use an editor to write content as well as upload images specific to
> content.
>
> On Sat, Sep 5, 2020 at 4:59 PM Ogunsanya Opeyemi <
> ogunsanyaopeye...@gmail.com> wrote:
>
>> You are rendering the image tag img inside a textbox area.
>>
>> On Saturday, September 5, 2020, sourav chakraborty <
>> devops.sou...@gmail.com> wrote:
>>
>>> Hi All,
>>>
>>> I'm testing on Some Quiz project, while in admin panel using Summernote
>>> admin can see the text editor and upload and the uploaded image
>>>
>>> class QuestionAdmin(SummernoteModelAdmin):
>>> summernote_fields = ('text',)
>>>
>>> admin.site.register(Question, QuestionAdmin)
>>>
>>> However, the user/student cannot see the image, instead they see only
>>> the image link.
>>>
>>> [image: image.png]
>>>
>>>
>>> Please suggest to rectify the issue, thanks.
>>> Regards,
>>> Sourav
>>>
>>> --
>>> 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/CA%2B5wCfausgwCE%2B5aucOzvUgdhZ%3DnpydEk2k8Oa5BAYmQztH%3DBA%40mail.gmail.com
>>> 
>>> .
>>>
>>
>>
>> --
>> OGUNSANYA OPEYEMI
>>
>> --
>> 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/CABJxPrHivLTs8yXWthQvCu36JTMs_D%3DYa4-Tp223ncjC1cRJCw%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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2B5wCfaoYwNq0m%3Dg5CF_vMivw6QozhuFfwyOHs-NzBupWshc8Q%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANV3w%3DYiLt7rKVdyNNPi0F9ibYB8ZHWot90oFoSmP2UZ5PaUvg%40mail.gmail.com.


Re: Help. if i runserver I get this error

2020-09-05 Thread hans alexander
You need to set your index path in urls.py like this:
path(' ', , )

On Fri, Sep 4, 2020 at 11:49 PM Boi Deekay  wrote:

> Page not found (404)Request Method:
> GETRequest URL:
> http://127.0.0.1:8000/
>
> Using the URLconf defined in myFirstPy.urls, Django tried these URL
> patterns, in this order:
>
>1. text/
>2. admin/
>
> The empty path didn't match any of these.
>
> You're seeing this error because you have DEBUG = True in your Django
> settings file. Change that to False, and Django will display a standard 404
> page.
>
> --
> 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/bb0fa594-2099-4128-a500-f70e0a846e6cn%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANV3w%3Da1FAvityOkJAAXdccKQSuRkuFFt%3DZuk-SYoQ3VRcjRZA%40mail.gmail.com.


Re: How to pass a set of objects in between two views?

2020-08-24 Thread hans alexander
Can you share the views.py that you wrote?
Actually If the page for random set of questions is same for User NOT
Logged In and User Logged In, the data you called from database will still
showing up.

On Mon, Aug 24, 2020 at 9:19 PM vipul shinde 
wrote:

>
> I'm building a quiz app in which I'm storing questions in the database by
> creating a model class. I am retrieving a random question set for each user
> from the database and then rendering them on an HTML page. The problem is
> after logging a user in, a random set of questions appears but that random
> set is lost after refreshing the page.
> How do I solve this
> One thing that I thought was retrieving the object set in another
> viewsay after logging a user in and passing it as a dictionary to
> another view.
> But I can't find the syntax or any function (if it exists). Please help.
> I'm using django 3.1 and MySQL as my 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/CANE4xcuDmZCAaB4pzTqvH1d2eGf2b12%2BBPwN90e5_hmK%3DUBeQw%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANV3w%3DYE%3DP6OW4cow0q%3D8uocbUSKoi259CJbRWrJYPo7A51oEw%40mail.gmail.com.


Re: data too long in a CharField column

2020-08-21 Thread hans alexander
I changed my database from mysql to postgresql. 
But when I tried saving data on forms, I got this error " value too long 
for type character varying(50)"
I don't know why, because when I was using MYSQL, I didn't get any error.
Can someone help me with this Postgresql?
On Monday, May 4, 2009 at 10:46:53 PM UTC+7 MS wrote:

> Hi,
>
> I have a problem with django+postgresql:
> I have a model with a CharField(max_length=255) field, and I'm
> assigning some much longer value to this field, like:
>
> m = MyModel()
> m.myfield = 'very long text - say 400 chars'
> m.save()
>
> In save() I'm getting an error "ERROR: value too long for type
> character varying(255)", and the SQL statement contains the 'very long
> text - say 400 chars' intact.
>
> I thought that if django knows that a field is restricted to 255
> chars, then it will validate it and
> truncate excessive chars before saving. But it doesn't. How can I get
> rid of that problem?
>
> Thanks,
> MS
>

-- 
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/a4bbb62c-1ad7-4ad8-a361-08cf71df47d6n%40googlegroups.com.