Re: I Am A Begginer Web Developer - Need Help With Finding A Term

2019-04-01 Thread ANi
Just query the data maybe by filtering and set the results in different 
variables, then pass them and you can get different data in one template.
for querying you can see the document
https://docs.djangoproject.com/en/2.1/topics/db/queries/

 
hope it helps


Rok Klancar於 2019年4月2日星期二 UTC+8上午9時22分59秒寫道:
>
> Hello developers!
>
> Much respect to you all.
>
> I have just finished a couple of hours browsing the web, but found no 
> solution. I guess my problem is simply *not knowing the right term *for 
> the thing that I am trying to make (in Django of course).
>
> Brief description:
> I have made a class 'Post' in *models.py *that represents four different 
> kind of data:
>
>- Date
>- Int
>- Text 1
>- Text 2
>
> It is sort of like a blog post. Now, in the official Django tutorial I 
> have learned how to make posts appear on separate pages.
> But I want the different instances of this class 'Post' appear one under 
> another on a single page (Today's post is on top, yesterday's is bellow the 
> today's, etc.).
>
> I hope I made my issue clear.
> I would be happy, just if you told me, how do you call this shape of a 
> page in Web Dev jargon.
>
> Have a nice day
> Rok
>
>

-- 
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/d572f625-015e-4a32-87b3-b3105477591a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrading Django from 1.11 to 2.2

2019-04-01 Thread dvij parekh
always go for 2nd last or 3rd last release of any framework or any language 
it will be more stable but if you want to go with 2.2 you can because it 
comes with LTS

On Friday, March 29, 2019 at 2:22:10 PM UTC+5:30, Uri Even-Chen wrote:
>
> Hi,
>
> I want to upgrade Django from 1.11 to 2.2. Do I have to upgrade first to 
> 2.0 and then to 2.1, or can I upgrade directly from 1.11 to 2.2?
>
> By the way, we use many third-party packages and I'm not sure which 
> version of Django they support. Maybe not all of them already support 
> Django 2.2.
>
> 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 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/8bd204d9-dcfb-41f7-b62e-5976d7320c1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrading Django from 1.11 to 2.2

2019-04-01 Thread dvij parekh
always go for 2nd last or 3rd last release of any frame it will be more 
stable but if you want to go 2.2 you can because it comes with LTS

On Friday, March 29, 2019 at 2:22:10 PM UTC+5:30, Uri Even-Chen wrote:
>
> Hi,
>
> I want to upgrade Django from 1.11 to 2.2. Do I have to upgrade first to 
> 2.0 and then to 2.1, or can I upgrade directly from 1.11 to 2.2?
>
> By the way, we use many third-party packages and I'm not sure which 
> version of Django they support. Maybe not all of them already support 
> Django 2.2.
>
> 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 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/c326d8e9-2eaf-4a07-81e1-a75abbce39f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I need help please

2019-04-01 Thread dvij parekh
1. go and change admin url to drunke-octo-lama in main urls file i.e where 
your setting.py and wsgi.py is present
2. put {% url 'path_to_adminpannel/drunke-octo-lama' %}

hope this helps you else please elaborate problem so i can get it right 

On Monday, April 1, 2019 at 6:32:31 PM UTC+5:30, Nanjuki Saidat wrote:
>
> Hi all,
> I am Saidat a new django developer, i need help on how to go about this  " 
> Change 
> admin portal URL to more obvious path and add link in side menu to admin 
> settings for admin users". In summary:
>
>
>1.  i want to change URL string to more intuitive URL (i.e. 
>fhp.example.com/drunken-octo-lama/ to fhp.example.com/admin/)
>2. If a user is an admin user, show a link in the side menu to access 
>admin settings page.
>
>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 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/5916908f-b503-4d35-b4a5-6c8808d61702%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Showing old data

2019-04-01 Thread Swetank Subham Roy
Hello folks,
I have created a hosted a django web app on apache2 using mod_wsgi, the
content should automatically refresh everyday. But it is not getting
refreshed automatically. I need to manually restart or reload the apache in
order to make the changes reflect. I don't want to set cron to restart
apache every single day.

Kindly help me out.

-- 
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/CADQ%3DdppkR52xv5dUaJdD6fM2GpAbAdJcLMAL%3DdoemKQbW%3DpRPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Urgently need help with deploying django on plesk.

2019-04-01 Thread Saurabh Jaiswal
Got django running gracefully on plesk.
The issue was on the mod wsgi alias.


On Mon, Apr 1, 2019 at 8:43 AM Mike Dewhirst  wrote:

> On 1/04/2019 1:47 pm, Saurabh Jaiswal wrote:
> > Hey Mike,
> > I have access to the pesk server as root user.
> > I have been facing issue with the mod_wsgi setup process.
>
> Have you seen ... https://modwsgi.readthedocs.io/en/develop/
>
>
> >
> > On Mon, Apr 1, 2019 at 6:03 AM Mike Dewhirst  > > wrote:
> >
> > On 1/04/2019 3:29 am, Saurabh Jaiswal wrote:
> > > Can someone please help me with deploying django on plesk onyx
> > 17.08.
> > > Been unsucessful trying to launch it.
> >
> > Plesk is written by and for sysadmins and php people to insulate them
> > from needing access to the machine. That means you won't gain easy
> > access unless you have a very friendly sysadmin willing to install
> > stuff
> > for you and happy to implement a system for ongoing software updates.
> > You need access to Apache config files and an ability to reload the
> > webserver. I would say it will be awkward at best and impossible at
> > worst. You might be able to use .htaccess files to tweak Apache to
> > suit
> > your needs
> >
> > I would be looking to find a VM and do it myself with root access or
> > find a Django-friendly hosting provider.
> >
> > My preference is the former.
> >
> > Good luck.
> >
> > Mike
> >
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Django users" group.
> > > To unsubscribe from this group and stop receiving emails from
> > it, send
> > > an email to django-users+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/CAOsmX4_PFaw%3DBFhufC%3DU%2Bc_iW%2BSN9MH2gfD%3DpQ1nS%3DHnBKN0bA%40mail.gmail.com
> >
> > >
> > <
> https://groups.google.com/d/msgid/django-users/CAOsmX4_PFaw%3DBFhufC%3DU%2Bc_iW%2BSN9MH2gfD%3DpQ1nS%3DHnBKN0bA%40mail.gmail.com?utm_medium=email_source=footer
> >.
> > > 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+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/0342039b-cbd0-1df9-ec73-0c51dbb0850f%40dewhirst.com.au
> .
> > 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+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/CAOsmX49LfhN2wJdmywUyi3bUUcwiZ%2BTB4AxqgrY9tz1F2C-%2Byg%40mail.gmail.com
> > <
> https://groups.google.com/d/msgid/django-users/CAOsmX49LfhN2wJdmywUyi3bUUcwiZ%2BTB4AxqgrY9tz1F2C-%2Byg%40mail.gmail.com?utm_medium=email_source=footer
> >.
> > 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+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/b19a0657-3e65-3a7b-b174-afd20e2d0804%40dewhirst.com.au
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 

Re: Upgrading Django from 1.11 to 2.2

2019-04-01 Thread Tim Graham
The advice is to go from one the major version to the next. Don't try to skip 
versions.

-- 
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/f86c4ebd-b81e-4239-a561-ba196c67e40b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django module view has no attribute?

2019-04-01 Thread Sithembewena L. Dube
I don't know the contents of the course you are taking, but it looks like
the last import of views, which is "from counters import views" is
overriding all the others and in it you have not defined a "posts" view.

1. You could solve this by aliasing your imports, e.g.:
```
from django.contrib import admin
from django.urls import path
# from . import views as a
from posts import views as b
from redactors import views as c
*from counters import views as d*
urlpatterns = [
  path('admin/', admin.site.urls),
  path('^$', a.home, name='home'),
  path('^b/', views.result, name='result'),
  path('^b/', views.counters, name='seth'),
  *path('^d/', views.posts, name='james'),*
  path('^d/', views.redactors, name='simon'),
]
```

... although this is not what you should be doing with django.

2. (much better) you could use the `include` function of the django.urls
module and pass in the string representation of each urls module's name.
You would not need to import each app's urls.py module for this.

```
from django.urls import *include*, path

urlpatterns = [
  path('admin/', admin.site.urls),
  path('^james', *include*('posts.urls')),
]
```

...etc.

I would recommend doing a short Python tutorial to understand some key
basics, such as how imports work (
https://www.w3schools.com/python/default.asp) and doing the official Django
"Getting Started" guide and tutorial (you can find the latest version on
https://www.djangoproject.com/start/).


Kind regards,
Sithembewena


*Sent with Shift
*

On Tue, Apr 2, 2019 at 3:59 AM drone4four  wrote:

> I’m taking a Udemy course by Nick Walter and rather than copying line by
> line, I’m trying to branch out and experiment on my own.
>
> The purpose of the website I am creating is for a small blog, with the
> ability to redact string input (in an HTML form) from the user. There is
> also a word counter for the body content of the blog.
>
> I got Django running but as soon as I started adding the code I wrote,
> Django stopped running properly.
>
> Here is the traceback in full: https://pastebin.com/8HtdNwPP
>
> The main issue shows at the bottom:
>
> File
>> "/home//dev/projects/python/2018-and-2019/CC_Redact_Iter2/CC_Redact_Iter2/urls.py",
>> line 28, in 
>>* path('^james/', views.posts, name='james'),*
>> *AttributeError: module 'counters.views' has no attribute 'posts’*
>
>
>
> Based on this traceback, I gather I have probably misnamed a function or a
> file name or template but I can’t for the life of me figure which one or
> where.
>
> My entire source code repo can be found here:
> https://github.com/Angeles4four/CC_Redact_Iter2
>
> Here are some of the relevant files involved.
>
> urls.py:
>
> from django.contrib import admin
>> from django.urls import path
>> # from . import views
>> from posts import views
>> from redactors import views
>> from counters import views
>> urlpatterns = [
>>   path('admin/', admin.site.urls),
>>   path('^$', views.home, name='home'),
>>   path('^result/', views.result, name='result'),
>>   path('^seth/', views.counters, name='seth'),
>>   path('^james/', views.posts, name='james'),
>>   path('^james/', views.redactors, name='simon'),
>> ]
>
>
>
> counters/views.py:
>
> from django.http import HttpResponse
>> from django.shortcuts import render
>> def home(request):
>>   if 'ccEntry' in request.GET:
>>   number = request.GET['ccEntry']
>>   redacted_num = '   {}'.format(number[-4:])
>>   return render(request, 'result.html', {'number':number,
>> 'redacted_num':redacted_num})
>>   else:
>>   return render(request, 'home.html')
>> def result(request):
>>return render(request, 'result.html')
>> def counters(request):
>>   return render(request, 'counters/james.html')
>
>
> Here is my file tree: https://imgur.com/a/BUTKKEH
>
> Contents of requirements.txt:
>
>> Django==2.0.13
>> Pillow==5.4.1
>> psycopg2==2.7.7
>> psycopg2-binary==2.7.7
>> pytz==2018.9
>
>
>
> If there are other files in my project that you wish to view, you can
> click through the file tree as it appears on GitHub (linked to above).
>
> --
> 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/353c83b5-1f37-4e23-b6c7-f488cb05805e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are 

Django module view has no attribute?

2019-04-01 Thread drone4four


I’m taking a Udemy course by Nick Walter and rather than copying line by 
line, I’m trying to branch out and experiment on my own.  

The purpose of the website I am creating is for a small blog, with the 
ability to redact string input (in an HTML form) from the user. There is 
also a word counter for the body content of the blog.

I got Django running but as soon as I started adding the code I wrote, 
Django stopped running properly. 

Here is the traceback in full: https://pastebin.com/8HtdNwPP 

The main issue shows at the bottom:

File 
> "/home//dev/projects/python/2018-and-2019/CC_Redact_Iter2/CC_Redact_Iter2/urls.py",
>  
> line 28, in 
>* path('^james/', views.posts, name='james'),*
> *AttributeError: module 'counters.views' has no attribute 'posts’*



Based on this traceback, I gather I have probably misnamed a function or a 
file name or template but I can’t for the life of me figure which one or 
where. 

My entire source code repo can be found here: 
https://github.com/Angeles4four/CC_Redact_Iter2

Here are some of the relevant files involved.

urls.py:

from django.contrib import admin
> from django.urls import path
> # from . import views
> from posts import views
> from redactors import views
> from counters import views
> urlpatterns = [
>   path('admin/', admin.site.urls),
>   path('^$', views.home, name='home'),
>   path('^result/', views.result, name='result'),
>   path('^seth/', views.counters, name='seth'),
>   path('^james/', views.posts, name='james'),
>   path('^james/', views.redactors, name='simon'),
> ]



counters/views.py:

from django.http import HttpResponse
> from django.shortcuts import render
> def home(request):
>   if 'ccEntry' in request.GET:
>   number = request.GET['ccEntry']
>   redacted_num = '   {}'.format(number[-4:])
>   return render(request, 'result.html', {'number':number, 
> 'redacted_num':redacted_num})
>   else:
>   return render(request, 'home.html')
> def result(request):
>return render(request, 'result.html')
> def counters(request):
>   return render(request, 'counters/james.html')


Here is my file tree: https://imgur.com/a/BUTKKEH

Contents of requirements.txt:

> Django==2.0.13
> Pillow==5.4.1
> psycopg2==2.7.7
> psycopg2-binary==2.7.7
> pytz==2018.9



If there are other files in my project that you wish to view, you can click 
through the file tree as it appears on GitHub (linked to above).

-- 
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/353c83b5-1f37-4e23-b6c7-f488cb05805e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how can i get current username in model field ??

2019-04-01 Thread Guru Murthy
Hi Omar Ahmed,
  You cannot give the user model value to the field that you can do in
views.py and forms.py. visit more about how to create forms in django.

On Mon, 1 Apr, 2019, 7:09 PM Joel Mathew,  wrote:

> This does not make sense to me. A model is not a dynamic entity. It is
> something that's created beforehand. Getting the current username into
> model should be done in your logic (views), or the template
> Sincerely yours,
>
>  Joel G Mathew
>
>
>
> On Mon, 1 Apr 2019 at 19:01, omar ahmed  wrote:
>
>> i want to put value of logged in user.username in author field
>> class Comment(models.Model):
>> leaguenews = models.ForeignKey(LeagueNews, on_delete= models.CASCADE,
>> related_name='comments')
>> author = models.CharField(max_length=200)
>> text = models.TextField()
>>
>> --
>> 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/8a24a020-af3a-4a5f-ac25-5da3aa1fa8db%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+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/CAA%3Diw_9E9szHxpGUwXB1UFgcEkJDOCaSK8-an%2BxFyV0jt4sR2g%40mail.gmail.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+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/CAMgkGLWNkiowgTNrrbk74%3D3mhk1JLC8pi-s98rBETZboJ--M3w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


I Am A Begginer Web Developer - Need Help With Finding A Term

2019-04-01 Thread Rok Klancar
Hello developers!

Much respect to you all.

I have just finished a couple of hours browsing the web, but found no 
solution. I guess my problem is simply *not knowing the right term *for the 
thing that I am trying to make (in Django of course).

Brief description:
I have made a class 'Post' in *models.py *that represents four different 
kind of data:

   - Date
   - Int
   - Text 1
   - Text 2

It is sort of like a blog post. Now, in the official Django tutorial I have 
learned how to make posts appear on separate pages.
But I want the different instances of this class 'Post' appear one under 
another on a single page (Today's post is on top, yesterday's is bellow the 
today's, etc.).

I hope I made my issue clear.
I would be happy, just if you told me, how do you call this shape of a page 
in Web Dev jargon.

Have a nice day
Rok

-- 
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/7dec691d-c030-4d96-b4d3-d7a76e07cde5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how can i get current username in model field ??

2019-04-01 Thread Ing.Daniel Bojorge
Here I let you how I do.

https://debsconsultores.blogspot.com/2018/12/agregar-usuario-crea-en-modelo.html



Dios L@s Bendiga

Saludos,



[image: --]

daniel.bojorge
[image: http://]about.me/daniel.bojorge

 *Curso Desarrollo Web con Python usando Django 2.1 Para Principiantes*

*WebService RestFul API con Python usando Django RestFrameWork*

*Fácil Replicación de Cualquier Base de Datos y/o Sistema Operativo*

*Programación en Capas (Web y Escritorio)* 
Mi Blog 
Nicaragua

"Si ustedes permanecen unidos a mí, y si permanecen fieles a mis
enseñanzas, pidan lo que quieran y se les dará.
(Juan 15:7 DHH)
Bendito el varón que se fía en el SEÑOR, y cuya confianza es el SEÑOR.
(Jeremías 17:7 RV2000)



El lun., 1 abr. 2019 a las 12:05, omar ahmed ()
escribió:

> ok i solved it
> name = request.user.username
> form = CommentForm(initial={'author': name})
> return render(request, 'core/add_comment_to_news.html', {'form':form
>
>
> On Monday, April 1, 2019 at 6:02:21 PM UTC+2, omar ahmed wrote:
>>
>> explain please
>>
>> On Monday, April 1, 2019 at 3:57:48 PM UTC+2, OnlineJudge95 wrote:
>>>
>>> +1
>>> DoesNotMakesSenseError("Author of any comment should not be related to
>>> the currently logged in user")
>>>
>>> On Mon, Apr 1, 2019, 7:09 PM Joel Mathew  wrote:
>>>
 This does not make sense to me. A model is not a dynamic entity. It is
 something that's created beforehand. Getting the current username into
 model should be done in your logic (views), or the template
 Sincerely yours,

  Joel G Mathew



 On Mon, 1 Apr 2019 at 19:01, omar ahmed  wrote:

> i want to put value of logged in user.username in author field
> class Comment(models.Model):
> leaguenews = models.ForeignKey(LeagueNews, on_delete= models.CASCADE,
> related_name='comments')
> author = models.CharField(max_length=200)
> text = models.TextField()
>
> --
> 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...@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/8a24a020-af3a-4a5f-ac25-5da3aa1fa8db%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...@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/CAA%3Diw_9E9szHxpGUwXB1UFgcEkJDOCaSK8-an%2BxFyV0jt4sR2g%40mail.gmail.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+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/c9fa9229-3443-4a38-9a51-96670e84b03e%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+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/CAMQeQjap5xJwi%2BrqRLjSVTQoFDKjfzVBRuQ1kj0MgLVzLVYLxA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how can i get current username in model field ??

2019-04-01 Thread omar ahmed
ok i solved it
name = request.user.username
form = CommentForm(initial={'author': name})
return render(request, 'core/add_comment_to_news.html', {'form':form


On Monday, April 1, 2019 at 6:02:21 PM UTC+2, omar ahmed wrote:
>
> explain please
>
> On Monday, April 1, 2019 at 3:57:48 PM UTC+2, OnlineJudge95 wrote:
>>
>> +1
>> DoesNotMakesSenseError("Author of any comment should not be related to 
>> the currently logged in user")
>>
>> On Mon, Apr 1, 2019, 7:09 PM Joel Mathew  wrote:
>>
>>> This does not make sense to me. A model is not a dynamic entity. It is 
>>> something that's created beforehand. Getting the current username into 
>>> model should be done in your logic (views), or the template
>>> Sincerely yours,
>>>
>>>  Joel G Mathew
>>>
>>>
>>>
>>> On Mon, 1 Apr 2019 at 19:01, omar ahmed  wrote:
>>>
 i want to put value of logged in user.username in author field
 class Comment(models.Model):
 leaguenews = models.ForeignKey(LeagueNews, on_delete= models.CASCADE, 
 related_name='comments')
 author = models.CharField(max_length=200)
 text = models.TextField()

 -- 
 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...@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/8a24a020-af3a-4a5f-ac25-5da3aa1fa8db%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...@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/CAA%3Diw_9E9szHxpGUwXB1UFgcEkJDOCaSK8-an%2BxFyV0jt4sR2g%40mail.gmail.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+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/c9fa9229-3443-4a38-9a51-96670e84b03e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how can i get current username in model field ??

2019-04-01 Thread omar ahmed
explain please

On Monday, April 1, 2019 at 3:57:48 PM UTC+2, OnlineJudge95 wrote:
>
> +1
> DoesNotMakesSenseError("Author of any comment should not be related to the 
> currently logged in user")
>
> On Mon, Apr 1, 2019, 7:09 PM Joel Mathew > 
> wrote:
>
>> This does not make sense to me. A model is not a dynamic entity. It is 
>> something that's created beforehand. Getting the current username into 
>> model should be done in your logic (views), or the template
>> Sincerely yours,
>>
>>  Joel G Mathew
>>
>>
>>
>> On Mon, 1 Apr 2019 at 19:01, omar ahmed > 
>> wrote:
>>
>>> i want to put value of logged in user.username in author field
>>> class Comment(models.Model):
>>> leaguenews = models.ForeignKey(LeagueNews, on_delete= models.CASCADE, 
>>> related_name='comments')
>>> author = models.CharField(max_length=200)
>>> text = models.TextField()
>>>
>>> -- 
>>> 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...@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/8a24a020-af3a-4a5f-ac25-5da3aa1fa8db%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...@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/CAA%3Diw_9E9szHxpGUwXB1UFgcEkJDOCaSK8-an%2BxFyV0jt4sR2g%40mail.gmail.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+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/42c63773-10a1-446f-8e22-0db9c50e1765%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to find out if instagram accept the username and password of the bot?

2019-04-01 Thread Saeed Pooladzadeh
Thanks for your help.maybei cant transfer because my  English is not good. 
See we have two authentications:

in our bot site and in the Instagram I don't mean authentication in our bot 
site
I mean in the Instagram app. If the user entered wrong Instagram 
credentials how we can authenticate this?

Regards,
Saeed

در جمعه 29 مارس 2019، ساعت 23:43:30 (UTC+4:30)، Saeed Pooladzadeh نوشته:
>
> Hello,
>
> I'm a beginner at Django and Python and now plan to make a simple bot site 
> for Instagram with instabot:
>
>
> https://github.com/instabot-py/instabot.py
>
> My problem is how can I find out if Instagram accept the username and 
> password of the user or the username and password is wrong. How can I warn 
> the user?
>
> thanks,
> Saeed
>

-- 
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/b09b9de2-0c47-4cc5-852f-3fa440fdaf66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Must be my and and can't be my code -- tracing back a URL pattern type mismatch

2019-04-01 Thread nm
Then I'd suggest you try commenting out the relevant settings and urls 
(urlpatterns 
= [path('__debug__/', include(debug_toolbar.urls)),] or whatever you have 
there), and see what happens when you run `./manage.py check`. 

I once had a url-related problem that only appeared when I ran tests; it 
would disappear when I disabled the toolbar. Mine was a different one, but 
I thought maybe your error has something to do with the toolbar, since you 
said it certainly wasn't the app's code.

On Monday, 1 April 2019 15:51:18 UTC+2, Josh Marshall wrote:
>
> I do in fact use Django Debug Toolbar.
>
> On Mon, Apr 1, 2019 at 9:19 AM nm > 
> wrote:
>
>> Do you use any additional packages like e.g. Django Debug Toolbar? Or 
>> anything else that could mess with your urls? This is just a wild guess, 
>> but since nobody has answered with a better idea yet... 
>>
>> On Sunday, 31 March 2019 04:31:42 UTC+2, Josh Marshall wrote:
>>>
>>> I'm helping out on a project, but am running into a paradox of a bug 
>>> must existing in the code, but no project code is called.  Not sure how to 
>>> deal with this one.  It looks related to URL setup and the urls.py file is 
>>> practically identical to the examples.  Can anyone make sense of this stack 
>>> trace?
>>>
>>>
>>> ```
>>> [anadon@goodadvicemallard project1]$ poetry run ./manage.py check
>>> /home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/psycopg2/__init__.py:144:
>>>  
>>> UserWarning: The psycopg2 wheel package will be renamed from release 2.8; 
>>> in order to keep installing from binary please use "pip install 
>>> psycopg2-binary" instead. For details see: <
>>> http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
>>>   """)
>>> Auto generated 7 views for endpoints
>>> Traceback (most recent call last):
>>>   File "./manage.py", line 28, in 
>>> execute_from_command_line(sys.argv)
>>>   File 
>>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/__init__.py",
>>>  
>>> line 381, in execute_from_command_line
>>> utility.execute()
>>>   File 
>>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/__init__.py",
>>>  
>>> line 375, in execute
>>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>>   File 
>>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/base.py",
>>>  
>>> line 316, in run_from_argv
>>> self.execute(*args, **cmd_options)
>>>   File 
>>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/base.py",
>>>  
>>> line 353, in execute
>>> output = self.handle(*args, **options)
>>>   File 
>>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/commands/check.py",
>>>  
>>> line 65, in handle
>>> fail_level=getattr(checks, options['fail_level']),
>>>   File 
>>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/base.py",
>>>  
>>> line 379, in check
>>> include_deployment_checks=include_deployment_checks,
>>>   File 
>>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/base.py",
>>>  
>>> line 366, in _run_checks
>>> return checks.run_checks(**kwargs)
>>>   File 
>>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/checks/registry.py",
>>>  
>>> line 71, in run_checks
>>> new_errors = check(app_configs=app_configs)
>>>   File 
>>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/checks/urls.py",
>>>  
>>> line 13, in check_url_config
>>> return check_resolver(resolver)
>>>   File 
>>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/checks/urls.py",
>>>  
>>> line 23, in check_resolver
>>> return check_method()
>>>   File 
>>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/urls/resolvers.py",
>>>  
>>> line 397, in check
>>> warnings.extend(check_resolver(pattern))
>>>   File 
>>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/checks/urls.py",
>>>  
>>> line 23, in check_resolver
>>> return check_method()
>>>   File 
>>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/urls/resolvers.py",
>>>  
>>> line 397, in check
>>> warnings.extend(check_resolver(pattern))
>>>   File 
>>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/checks/urls.py",
>>>  
>>> line 23, in check_resolver
>>> 

Re: how can i get current username in model field ??

2019-04-01 Thread Test Bot
+1
DoesNotMakesSenseError("Author of any comment should not be related to the
currently logged in user")

On Mon, Apr 1, 2019, 7:09 PM Joel Mathew  wrote:

> This does not make sense to me. A model is not a dynamic entity. It is
> something that's created beforehand. Getting the current username into
> model should be done in your logic (views), or the template
> Sincerely yours,
>
>  Joel G Mathew
>
>
>
> On Mon, 1 Apr 2019 at 19:01, omar ahmed  wrote:
>
>> i want to put value of logged in user.username in author field
>> class Comment(models.Model):
>> leaguenews = models.ForeignKey(LeagueNews, on_delete= models.CASCADE,
>> related_name='comments')
>> author = models.CharField(max_length=200)
>> text = models.TextField()
>>
>> --
>> 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/8a24a020-af3a-4a5f-ac25-5da3aa1fa8db%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+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/CAA%3Diw_9E9szHxpGUwXB1UFgcEkJDOCaSK8-an%2BxFyV0jt4sR2g%40mail.gmail.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+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/CAD%3DM5eSj-Mwe2ok%3D9bd7bUOse76c-E3a_JwPLBsubRKpa1jbRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how can i get current username in model field ??

2019-04-01 Thread omar ahmed
ok i understood 
does it work :
request.user.username

On Monday, April 1, 2019 at 3:39:25 PM UTC+2, Joel Mathew wrote:
>
> This does not make sense to me. A model is not a dynamic entity. It is 
> something that's created beforehand. Getting the current username into 
> model should be done in your logic (views), or the template
> Sincerely yours,
>
>  Joel G Mathew
>
>
>
> On Mon, 1 Apr 2019 at 19:01, omar ahmed > 
> wrote:
>
>> i want to put value of logged in user.username in author field
>> class Comment(models.Model):
>> leaguenews = models.ForeignKey(LeagueNews, on_delete= models.CASCADE, 
>> related_name='comments')
>> author = models.CharField(max_length=200)
>> text = models.TextField()
>>
>> -- 
>> 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...@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/8a24a020-af3a-4a5f-ac25-5da3aa1fa8db%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+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/3e8e76f4-fe38-45c5-ae03-a8520c21a8fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I need help please

2019-04-01 Thread Joel Mathew
It's supposed to be an example.
Sincerely yours,

 Joel G Mathew



On Mon, 1 Apr 2019 at 19:12, dvij parekh  wrote:

> link is not working
>
>
> On Mon, Apr 1, 2019 at 6:32 PM Nanjuki Saidat 
> wrote:
>
>> Hi all,
>> I am Saidat a new django developer, i need help on how to go about this
>> " Change admin portal URL to more obvious path and add link in side menu
>> to admin settings for admin users". In summary:
>>
>>
>>1.  i want to change URL string to more intuitive URL (i.e.
>>fhp.example.com/drunken-octo-lama/ to fhp.example.com/admin/)
>>2. If a user is an admin user, show a link in the side menu to access
>>admin settings page.
>>
>>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 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/CAHrBrjC-j-2Z%2Bkn-U2gKBaV24Mu3W4QFGgochC1s6906VE5Tuw%40mail.gmail.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+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/CAF-XeXapTQ5jdOUOtkV5USYhyje9sWtU8hvShEY1yC6pBQ51zw%40mail.gmail.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+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/CAA%3Diw_9pa3ZyW9%2Ba4VWSYMFSY-3wsZ%2BBFvppJvwZrR0kTdQrXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Must be my and and can't be my code -- tracing back a URL pattern type mismatch

2019-04-01 Thread Josh Marshall
I do in fact use Django Debug Toolbar.

On Mon, Apr 1, 2019 at 9:19 AM nm 
wrote:

> Do you use any additional packages like e.g. Django Debug Toolbar? Or
> anything else that could mess with your urls? This is just a wild guess,
> but since nobody has answered with a better idea yet...
>
> On Sunday, 31 March 2019 04:31:42 UTC+2, Josh Marshall wrote:
>>
>> I'm helping out on a project, but am running into a paradox of a bug must
>> existing in the code, but no project code is called.  Not sure how to deal
>> with this one.  It looks related to URL setup and the urls.py file is
>> practically identical to the examples.  Can anyone make sense of this stack
>> trace?
>>
>>
>> ```
>> [anadon@goodadvicemallard project1]$ poetry run ./manage.py check
>> /home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/psycopg2/__init__.py:144:
>> UserWarning: The psycopg2 wheel package will be renamed from release 2.8;
>> in order to keep installing from binary please use "pip install
>> psycopg2-binary" instead. For details see: <
>> http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
>>   """)
>> Auto generated 7 views for endpoints
>> Traceback (most recent call last):
>>   File "./manage.py", line 28, in 
>> execute_from_command_line(sys.argv)
>>   File
>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/__init__.py",
>> line 381, in execute_from_command_line
>> utility.execute()
>>   File
>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/__init__.py",
>> line 375, in execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File
>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/base.py",
>> line 316, in run_from_argv
>> self.execute(*args, **cmd_options)
>>   File
>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/base.py",
>> line 353, in execute
>> output = self.handle(*args, **options)
>>   File
>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/commands/check.py",
>> line 65, in handle
>> fail_level=getattr(checks, options['fail_level']),
>>   File
>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/base.py",
>> line 379, in check
>> include_deployment_checks=include_deployment_checks,
>>   File
>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/base.py",
>> line 366, in _run_checks
>> return checks.run_checks(**kwargs)
>>   File
>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/checks/registry.py",
>> line 71, in run_checks
>> new_errors = check(app_configs=app_configs)
>>   File
>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/checks/urls.py",
>> line 13, in check_url_config
>> return check_resolver(resolver)
>>   File
>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/checks/urls.py",
>> line 23, in check_resolver
>> return check_method()
>>   File
>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/urls/resolvers.py",
>> line 397, in check
>> warnings.extend(check_resolver(pattern))
>>   File
>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/checks/urls.py",
>> line 23, in check_resolver
>> return check_method()
>>   File
>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/urls/resolvers.py",
>> line 397, in check
>> warnings.extend(check_resolver(pattern))
>>   File
>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/checks/urls.py",
>> line 23, in check_resolver
>> return check_method()
>>   File
>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/urls/resolvers.py",
>> line 397, in check
>> warnings.extend(check_resolver(pattern))
>>   File
>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/checks/urls.py",
>> line 23, in check_resolver
>> return check_method()
>>   File
>> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/urls/resolvers.py",
>> line 398, in check
>> return warnings or self.pattern.check()
>> AttributeError: 'str' object has no attribute 'check'
>>
>> ```
>>
> --
> You received this message because you are subscribed to a topic 

Re: I need help please

2019-04-01 Thread dvij parekh
link is not working


On Mon, Apr 1, 2019 at 6:32 PM Nanjuki Saidat 
wrote:

> Hi all,
> I am Saidat a new django developer, i need help on how to go about this  " 
> Change
> admin portal URL to more obvious path and add link in side menu to admin
> settings for admin users". In summary:
>
>
>1.  i want to change URL string to more intuitive URL (i.e.
>fhp.example.com/drunken-octo-lama/ to fhp.example.com/admin/)
>2. If a user is an admin user, show a link in the side menu to access
>admin settings page.
>
>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 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/CAHrBrjC-j-2Z%2Bkn-U2gKBaV24Mu3W4QFGgochC1s6906VE5Tuw%40mail.gmail.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+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/CAF-XeXapTQ5jdOUOtkV5USYhyje9sWtU8hvShEY1yC6pBQ51zw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how can i get current username in model field ??

2019-04-01 Thread Joel Mathew
This does not make sense to me. A model is not a dynamic entity. It is
something that's created beforehand. Getting the current username into
model should be done in your logic (views), or the template
Sincerely yours,

 Joel G Mathew



On Mon, 1 Apr 2019 at 19:01, omar ahmed  wrote:

> i want to put value of logged in user.username in author field
> class Comment(models.Model):
> leaguenews = models.ForeignKey(LeagueNews, on_delete= models.CASCADE,
> related_name='comments')
> author = models.CharField(max_length=200)
> text = models.TextField()
>
> --
> 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/8a24a020-af3a-4a5f-ac25-5da3aa1fa8db%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+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/CAA%3Diw_9E9szHxpGUwXB1UFgcEkJDOCaSK8-an%2BxFyV0jt4sR2g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


how can i get current username in model field ??

2019-04-01 Thread omar ahmed
i want to put value of logged in user.username in author field
class Comment(models.Model):
leaguenews = models.ForeignKey(LeagueNews, on_delete= models.CASCADE, 
related_name='comments')
author = models.CharField(max_length=200)
text = models.TextField()

-- 
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/8a24a020-af3a-4a5f-ac25-5da3aa1fa8db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 2.2 released.

2019-04-01 Thread Carlton Gibson
Oops, typo there:

> ...Django 2.0... 

That should say "Django 2.1 will receive security and data loss fixes until 
December 2019". 
C.

On Monday, 1 April 2019 15:19:43 UTC+2, Carlton Gibson wrote:
>
> Django 2.2, the next long-term support release, is now available:
>
> *https://www.djangoproject.com/weblog/2019/apr/01/django-22-released/ 
> *
>
> With the release of Django 2.2, Django 2.1 has reached the end of
> mainstream support. The final minor bug fix release, 2.1.8, was issued 
> today. 
> Django 2.0 will receive security and data loss fixes until December 2019. 
> All users are
> encouraged to upgrade before then to continue receiving fixes for
> security issues.
>
> See the downloads page [1] for a table of supported versions and the
> future release schedule.
>
> [1] https://www.djangoproject.com/download/#supported-versions
>

-- 
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/390182f1-f19a-4ce7-a9f0-a2670c89b88d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django 2.2 released.

2019-04-01 Thread Carlton Gibson
Django 2.2, the next long-term support release, is now available:

https://www.djangoproject.com/weblog/2019/apr/01/django-22-released/ 


With the release of Django 2.2, Django 2.1 has reached the end of
mainstream support. The final minor bug fix release, 2.1.8, was issued today. 
Django 2.0 will receive security and data loss fixes until December 2019. All 
users are
encouraged to upgrade before then to continue receiving fixes for
security issues.

See the downloads page [1] for a table of supported versions and the
future release schedule.

[1] https://www.djangoproject.com/download/#supported-versions 


-- 
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/17CE6041-43DB-4D4D-B05D-0680A94AF8A1%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Must be my and and can't be my code -- tracing back a URL pattern type mismatch

2019-04-01 Thread nm
Do you use any additional packages like e.g. Django Debug Toolbar? Or 
anything else that could mess with your urls? This is just a wild guess, 
but since nobody has answered with a better idea yet... 

On Sunday, 31 March 2019 04:31:42 UTC+2, Josh Marshall wrote:
>
> I'm helping out on a project, but am running into a paradox of a bug must 
> existing in the code, but no project code is called.  Not sure how to deal 
> with this one.  It looks related to URL setup and the urls.py file is 
> practically identical to the examples.  Can anyone make sense of this stack 
> trace?
>
>
> ```
> [anadon@goodadvicemallard project1]$ poetry run ./manage.py check
> /home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/psycopg2/__init__.py:144:
>  
> UserWarning: The psycopg2 wheel package will be renamed from release 2.8; 
> in order to keep installing from binary please use "pip install 
> psycopg2-binary" instead. For details see: <
> http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
>   """)
> Auto generated 7 views for endpoints
> Traceback (most recent call last):
>   File "./manage.py", line 28, in 
> execute_from_command_line(sys.argv)
>   File 
> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/__init__.py",
>  
> line 381, in execute_from_command_line
> utility.execute()
>   File 
> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/__init__.py",
>  
> line 375, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/base.py",
>  
> line 316, in run_from_argv
> self.execute(*args, **cmd_options)
>   File 
> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/base.py",
>  
> line 353, in execute
> output = self.handle(*args, **options)
>   File 
> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/commands/check.py",
>  
> line 65, in handle
> fail_level=getattr(checks, options['fail_level']),
>   File 
> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/base.py",
>  
> line 379, in check
> include_deployment_checks=include_deployment_checks,
>   File 
> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/management/base.py",
>  
> line 366, in _run_checks
> return checks.run_checks(**kwargs)
>   File 
> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/checks/registry.py",
>  
> line 71, in run_checks
> new_errors = check(app_configs=app_configs)
>   File 
> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/checks/urls.py",
>  
> line 13, in check_url_config
> return check_resolver(resolver)
>   File 
> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/checks/urls.py",
>  
> line 23, in check_resolver
> return check_method()
>   File 
> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/urls/resolvers.py",
>  
> line 397, in check
> warnings.extend(check_resolver(pattern))
>   File 
> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/checks/urls.py",
>  
> line 23, in check_resolver
> return check_method()
>   File 
> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/urls/resolvers.py",
>  
> line 397, in check
> warnings.extend(check_resolver(pattern))
>   File 
> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/checks/urls.py",
>  
> line 23, in check_resolver
> return check_method()
>   File 
> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/urls/resolvers.py",
>  
> line 397, in check
> warnings.extend(check_resolver(pattern))
>   File 
> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/core/checks/urls.py",
>  
> line 23, in check_resolver
> return check_method()
>   File 
> "/home/anadon/.cache/pypoetry/virtualenvs/project1-N4OQNeyl-py3.6/lib/python3.6/site-packages/django/urls/resolvers.py",
>  
> line 398, in check
> return warnings or self.pattern.check()
> AttributeError: 'str' object has no attribute 'check'
>
> ```
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving 

I need help please

2019-04-01 Thread Nanjuki Saidat
Hi all,
I am Saidat a new django developer, i need help on how to go about
this  " Change
admin portal URL to more obvious path and add link in side menu to admin
settings for admin users". In summary:


   1.  i want to change URL string to more intuitive URL (i.e.
   fhp.example.com/drunken-octo-lama/ to fhp.example.com/admin/)
   2. If a user is an admin user, show a link in the side menu to access
   admin settings page.

   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 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/CAHrBrjC-j-2Z%2Bkn-U2gKBaV24Mu3W4QFGgochC1s6906VE5Tuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django Hosting

2019-04-01 Thread siva.gatti
I hosted my Django application on aws but its showing error Your WSGIPath 
refers to a file that does not exist..
How can  i resolve this please provide me some documentation to host my 
python application

-- 
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/10cff6cd-71da-40a3-89b3-015352792fbf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Blog application

2019-04-01 Thread Alison Mukoma
Hello Thomas,

Pehaps the first thing would be to link your model to your prefered User
model, Django provides you with a default though.
And then you can play with the ORM querysets to filter currently active
user related entries.

But we could be more helpful if you shared more details on your
implementation.

Thanks,
Alison

On Mon, Apr 1, 2019 at 2:19 PM Omar Abou Mrad 
wrote:

> Dear Thomas,
>
> A little bit more information would give us more insight on how to help
> you.
>
> What are you currently struggling with?
> Can you show us your models code?
>
> Regards,
>
> On Mon, Apr 1, 2019 at 3:03 PM Thomas Mathias 
> wrote:
>
>> Hello guys i have a django blog app and wanted to fetch all the post of
>> the logged in user such that he is able to delete them.help guys
>>
>> --
>> 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/d8223d5e-d22a-47a5-89de-e72b8247f38a%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+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/CAFwtXp0XZ_wBw05DxUQgzRwNit3gzhK1PM8OhEubxZZAYwA6vA%40mail.gmail.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+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/CAKLADicg943CDVFa92iZ9RyZEO0-aigpb%2BF2PnDfZ%3DmkcPJ6SA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Blog application

2019-04-01 Thread Omar Abou Mrad
Dear Thomas,

A little bit more information would give us more insight on how to help you.

What are you currently struggling with?
Can you show us your models code?

Regards,

On Mon, Apr 1, 2019 at 3:03 PM Thomas Mathias 
wrote:

> Hello guys i have a django blog app and wanted to fetch all the post of
> the logged in user such that he is able to delete them.help guys
>
> --
> 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/d8223d5e-d22a-47a5-89de-e72b8247f38a%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+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/CAFwtXp0XZ_wBw05DxUQgzRwNit3gzhK1PM8OhEubxZZAYwA6vA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Blog application

2019-04-01 Thread Thomas Mathias
Hello guys i have a django blog app and wanted to fetch all the post of the 
logged in user such that he is able to delete them.help guys

-- 
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/d8223d5e-d22a-47a5-89de-e72b8247f38a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django bugfix release 2.1.8

2019-04-01 Thread Carlton Gibson
Details are available on the Django project weblog: 

https://www.djangoproject.com/weblog/2019/apr/01/bugfix-release/

-- 
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/7B4EF610-4CC1-4231-96AB-7CE2BFDEC0E6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I am on a e-commerce website on a video from youtube and I am having problems with stripe

2019-04-01 Thread Patrice Chaula

I fixed the problem I forgot to put this statement -> 
```customer.sources.create(source='tok_visa')```
On Friday, 29 March 2019 17:30:00 UTC+2, Chetan Ganji wrote:
>
>  I am not sure about this. 
>
> But the issue seems to be that the user in question has a stripe account 
> and that stripe account does not have any cards associated with the 
> account. Maybe try adding a card to the account, if it does not have any. 
> If it has, delete it and create a new one. See if it helps.
>
>
> Regards,
> Chetan Ganji
> +91-900-483-4183
> ganji...@gmail.com 
> http://ryucoder.in
>
>
>
> 
>  I’m 
> protected online with Avast Free Antivirus. Get it here — it’s free 
> forever. 
> 
>  
> <#CAMKMUjteR+e92Dx13aighSDA8=pbA3udHctncxFcixhpfCB1+g@mail.gmail.com_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> On Fri, Mar 29, 2019 at 6:16 PM Patrice Chaula  > wrote:
>
>> I am using Stripe to process payments from my website. Yesterday it was 
>> working ok. That was before I changed code my code so It can process 
>> payments using a customer_id. I am using test keys
>>
>>  My code below. Help I'm still a beginner in django. I'm sorry my English 
>> is bad. 
>>
>> from django.shortcuts import render
>> from django.contrib.auth.decorators import login_required
>> from django.conf import settings
>> import stripe
>>
>>
>> stripe.api_key =  settings.STRIPE_SECRET_KEY
>> # Create your views here.
>> @login_required
>> def checkout(request):
>>  publishKey = settings.STRIPE_PUBLISHABLE_KEY
>>customer_id = request.user.userstripe.stripe_id
>> print(customer_id)
>>  if request.method == 'POST':
>>customer = stripe.Customer.retrieve(customer_id)
>>token = request.POST['stripeToken']
>> charge = stripe.Charge.create(
>>  amount = 1000,
>>  currency = 'usd',
>>   customer = customer,
>>description = 'Example Charge',
>> )
>>   context = {'publishKey':publishKey}
>> template = 'checkout.html'
>>  return render(request, template, context)
>>
>>
>> The error I am getting is below
>>
>> File "C:\Program 
>> Files\Python37-32\lib\site-packages\django\core\handlers\exception.py" in 
>> inner
>>   34. response = get_response(request)
>>
>> File "C:\Program 
>> Files\Python37-32\lib\site-packages\django\core\handlers\base.py" in 
>> _get_response
>>   126. response = self.process_exception_by_middleware(e, 
>> request)
>>
>> File "C:\Program 
>> Files\Python37-32\lib\site-packages\django\core\handlers\base.py" in 
>> _get_response
>>   124. response = wrapped_callback(request, 
>> *callback_args, **callback_kwargs)
>>
>> File "C:\Program 
>> Files\Python37-32\lib\site-packages\django\contrib\auth\decorators.py" in 
>> _wrapped_view
>>   21. return view_func(request, *args, **kwargs)
>>
>> File "C:\Users\Patrice\Desktop\ecommerce web\ecommerce\checkout\views.py" 
>> in checkout
>>   22. description = 'Example Charge',
>>
>> File "C:\Program 
>> Files\Python37-32\lib\site-packages\stripe\api_resources\abstract\createable_api_resource.py"
>>  
>> in create
>>   22. response, api_key = requestor.request("post", url, params, 
>> headers)
>>
>> File "C:\Program 
>> Files\Python37-32\lib\site-packages\stripe\api_requestor.py" in request
>>   121. resp = self.interpret_response(rbody, rcode, rheaders)
>>
>> File "C:\Program 
>> Files\Python37-32\lib\site-packages\stripe\api_requestor.py" in 
>> interpret_response
>>   372. self.handle_error_response(rbody, rcode, resp.data, 
>> rheaders)
>>
>> File "C:\Program 
>> Files\Python37-32\lib\site-packages\stripe\api_requestor.py" in 
>> handle_error_response
>>   151. raise err
>>
>> Exception Type: CardError at /checkout/
>> Exception Value: Request req_En9Ipi3bygWUWY: Cannot charge a customer 
>> that has no active card
>>
>>
>>
>>
>>
>> -- 
>> 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...@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/04423272-5bf9-4b26-9963-c180b926c909%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.

My page is not loading css correctly

2019-04-01 Thread Patrice Chaula
I am learning django framework for building websites. I am trying to style 
my page with css. I have gone through the tutorial for managing static 
files in django. I have done every step mentioned. I am trying to display a 
jumbtron with a purple background and white text. The code is below. Only 
the text changes to white but background remains the same. I have had this 
problem for days. I have searched on the internet but didn't find any answer

{% block styles %}
  
  .jumbotron{
 background: purple;
 color: white;
  }

  
{% endblock %}
{% block content %}

  Dummy content for testing 

{% endblock %}


I have had this problem with django-allauth forms too. It doesn't apply 
bootstrap when I use crispy

-- 
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/33c80074-6d8f-4c56-ba96-ae3de917dae3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrading Django from 1.11 to 2.2

2019-04-01 Thread Derek
The upgrade doc has good, general advice but does not specifically address 
the issue of LTS-to-LTS upgrades; I must admit I am a bit disappointed as I 
thought that there would be explicit, official support for this migration 
(and its one of the reasons I have stayed on the older LTS up to now).

On Saturday, 30 March 2019 15:36:48 UTC+2, Tim Graham wrote:
>
> Consider the "Upgrading Django to a newer version" guide.
> https://docs.djangoproject.com/en/stable/howto/upgrade-version/
>
> On Friday, March 29, 2019 at 4:52:10 AM UTC-4, Uri Even-Chen wrote:
>>
>> Hi,
>>
>> I want to upgrade Django from 1.11 to 2.2. Do I have to upgrade first to 
>> 2.0 and then to 2.1, or can I upgrade directly from 1.11 to 2.2?
>>
>> By the way, we use many third-party packages and I'm not sure which 
>> version of Django they support. Maybe not all of them already support 
>> Django 2.2.
>>
>> 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 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/0e9705b9-870f-4e35-a2fa-4c5ca3074c74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.