Re: Django for desktop app development

2018-09-09 Thread Gerald Brown
I have created something similar to this.  My setup is a 2 system 
IntrAnet ( not Internet). One system is being used as a web server 
running Nginx & Django with a Mariadb database.  I also had to install a 
wireless router.  The server system is using the Django Admin system as 
there are only 2 users.


From your description this could be system with one server and many 
clients connecting to it if they are in range of the router as in my 
case the client is just using Firefox web browser to connect to the server.


Does your school have WiFi available? If it does then this would be a 
snap to setup with the Django server.


Good luck.


On Friday, 07 September, 2018 08:16 PM, Muhammad Dilshad Khaliq wrote:
I am final year student of software engineering.My final year project 
is about fee management system where student submit fee online and 
administrator use this system for managing fee and scholarship of 
student and notifying them about their any issue.So can i  make web 
based application or desktop application for administration site and 
notify student through mobile application.?*Is it good idea to use 
Django for desktop 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/199c0ed7-ce95-42e4-b391-462a491c22fe%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/71b4139b-2a76-1510-ad80-9b11e2bf1944%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: models.py => Mandatory to create tables?

2018-09-07 Thread Gerald Brown

There should be a models.py file under each of your applications.


On Friday, 07 September, 2018 10:06 PM, Benjamin SOULAS wrote:

Hi everyone,

Quick question I do not find the answer: does models have to located 
into *models.py* script? It believe not, If I got a project composed 
of 100 tables, it's weird to me that all models should be located here ...


I tried, in this file, to import a model located somewhere else, but 
when i run *python manage.py makemigrations*, nothing happens, any idea?


Kind regards

Benjamin
--
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/a4da5a12-9c9b-42b6-b295-5492658cb046%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/9158f47b-58ac-b866-2e14-4aede5f0ca6c%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: text editor

2018-09-03 Thread Gerald Brown
The best editor is the ONE that works BEST for YOU!!! Try several and 
then pick the one that YOU like the best.  Everyone has their personal 
favorites!!!



On Monday, 03 September, 2018 09:08 AM, Joel wrote:
One can carry on discussion about something as subjective as "best 
text editor" for days and still not be done. IMO, this is a silly 
question to be asking in a django group.


On Mon 3 Sep, 2018, 3:16 AM victor jack, > wrote:


More like vim and vs code are the best editors

On Sun, 2 Sep 2018 06:51 RONAK JAIN, mailto:jainronak...@gmail.com>> wrote:

Atom is best editor.

On Sun, 2 Sep 2018, 11:11 a.m. sankar ardhas,
mailto:sankarard...@gmail.com>> wrote:


Hi to all,
Which is the best editor for django framework in Ubuntu os
18.04

Get Outlook for Android 




On Sun, Sep 2, 2018 at 1:46 AM +0530, "RONAK JAIN"
mailto:jainronak...@gmail.com>>
wrote:

Namaste !!

Dear ,

I have two models categories and Project.

 created like that :

class Category(models.Model):
    categorys =
models.ManyToManyField('Category',blank=True)
    name = models.CharField(max_length=100)
    created_at = models.DateTimeField(auto_now=False,
auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)



    class Meta:
        verbose_name_plural = "Categories"

    def __str__(self):
        return self.name 

    def __unicode__(self):
        return self.categorys

class Project(models.Model):
    categorys =
models.ManyToManyField('Category',blank=True)
    name = models.CharField(max_length=100)
    description = models.CharField(max_length=100)
    created_at = models.DateTimeField(auto_now=False,
auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)
    photo = models.ImageField(upload_to="pictures")


    def __str__(self):
        return self.name 

    def __unicode__(self):
        return self.categorys

*and Views I did here :*
*
*
*from web.models import Category,Project*

class Portfolio(TemplateView):
    template_name = "web/protfolio.html"

    def post(self, request, *args, **kwargs):
        context = self.get_context_data()
        return super(TemplateView,
self).render_to_response(context)
    def portfolio(request):
          context = RequestContext(request)
          # Project_list =
Project.objects.order_by('-likes')[:3]
          # context_dict = {'Project': project_list}
          # return render(template_name, context_dict,
context
          brand_list = Category.objects.all()
          return render(template_name, {'brand_list' :
brand_list}, context)

*I need correct relationship both I mean project and
categories. How can I do correct here ? *
Note : I attached picture please analyse briefly.

How to do approch html page and   I want  the
html(view) page should load from our db.
please give me quickly answer.
How can i do ?


Thanks
Ronak
-- 
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/63ecd6f1-411a-4581-b245-296efbd49303%40googlegroups.com

.
For more options, 

Re: Unrecognizable error

2018-08-17 Thread Gerald Brown

I used to get this error if I was NOT in my virtual environment.


On Friday, 17 August, 2018 12:54 PM, Vikrant Gupta wrote:
I'm trying to migrate two Classes in Django using Pycharm. The error 
is as follow


python manage.py makemigrations --name initial polls
  File "manage.py", line 16
    )from exc
        ^
SyntaxError: invalid syntax

How to solve this error?

and classes created are...

class student(models.Model):
 name=models.CharField('Student',max_length=50,primary_key=True)
 age=models.PositiveIntegerField()

class parent(models.Model):
 name=models.CharField('Parent',max_length=50)
 contact=models.IntegerField()
--
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/87643a85-d1f6-4265-b67f-c7bab5239140%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/9ca2de9b-17f7-d174-5956-9f38224a50e7%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Generic Date Views

2018-08-09 Thread Gerald Brown
One thing I discovered is that I had the line for the url.py file in my 
top level url.py.  I moved it to myapp/url.p but still same 404 error, 
however no longer get the "has no attribute" error


How do I call this view?  Tried from the browser 
"http://127.0.0.1:8000/today/; and I get "__init__() takes 1 positional 
argument but 2 were given" error.


Tried "http://127.0.0.1:8000/visit/today/; and I get 404 error.

In the line "queryset = Visit.objects.all()" won't that select all of 
the records in the database when I only want the records for today which 
I then use to create a reportlab pdf file? Prior to trying to use these 
generic date views I was able to generate the file but only for the 
current date.


Are there any more suggestions?

TIA...

On Thursday, 09 August, 2018 06:14 PM, Michal Petrucha wrote:

On Wed, Aug 08, 2018 at 05:42:06AM -0700, Gerald Brown wrote:


On Wednesday, August 8, 2018 at 8:15:21 PM UTC+8, Jason wrote:

what have you tried so far?  What issues are you having with the
documentation examples?

"can't get them to work" is really uninformative,  RIGHT.


What I tried was the TodayArchiveView by following the docs. When I enter
http://127.0.0.1:8000/admin/visit/today/ in my browser I get a 404 error

The code in my views.py file is:
class PaymentTodayArchiveView(TodayArchiveView):This is exactly as it is in my code and also in the docs except I 
changed Article to Payment.

 vi = Visit.objects.all()I changed vi to queryset and it made NO difference.
 date_field = "visit_date"

The code in my URLS.py file is:
path('today/', PaymentTodayArchiveView, name="today"),

In the docs is says ".as_view()" should be added to
PaymentTodayArchiveView. When I add that I get "AttributeError: 'function'
object has no attribute 'as_view'" error.

This exception indicates that you didn't define
PaymentTodayArchiveView as a class, but rather as a function (which is
not consistent with the code you pasted above). As long as
PaymentTodayArchiveView is defined as a subclass of TodayArchiveView,
like in your snippet, you should be able to call ``as_view`` on it.

So yes, using ``PaymentTodayArchiveView.as_view()`` in your URL config
would be correct, as long as the definition of PaymentTodayArchiveView
is correct.

And regarding the name (``queryset`` vs. ``vi``) – the point of using
generic views is that the default implementation of the view supplies
most functionality. Most of the time, you're able to configure what
objects the view operates on by setting certain class attributes in
your customized subclasses. In this case, all of the generic date
views by default look at the ``queryset`` class attribute when they
want to read objects from the database, not ``vi``, which is why you'd
typically use that name in your subclass.

Good luck,

Michal



--
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/9206a581-d513-0397-77e9-20cfe8ef1524%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Generic Date Views

2018-08-08 Thread Gerald Brown
As far as I know both "vi" and "queryset" are variable names and can be 
called "anything"

On Thursday, August 9, 2018 at 12:08:07 AM UTC+8, Jason wrote:
>
> also, I note you don't set the queryset field in your view class.  you set 
> it to `vi`.  that's probably an issue there
>
> eg 
>
> from django.views.generic.dates import TodayArchiveView
> from myapp.models import Article
> class ArticleTodayArchiveView(TodayArchiveView):
> queryset = Article.objects.all()  <-- 
> date_field = "pub_date"
> allow_future = True
>
>

-- 
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/4f740c1b-2352-4d64-aeb9-ffbaa7d73db4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Generic Date Views

2018-08-08 Thread Gerald Brown


On Wednesday, August 8, 2018 at 8:15:21 PM UTC+8, Jason wrote:
>
> what have you tried so far?  What issues are you having with the 
> documentation examples?
>
> "can't get them to work" is really uninformative,  RIGHT.
>

What I tried was the TodayArchiveView by following the docs. When I enter 
http://127.0.0.1:8000/admin/visit/today/ in my browser I get a 404 error

The code in my views.py file is:
class PaymentTodayArchiveView(TodayArchiveView):
vi = Visit.objects.all()
date_field = "visit_date"

The code in my URLS.py file is:
path('today/', PaymentTodayArchiveView, name="today"),

In the docs is says ".as_view()" should be added to 
PaymentTodayArchiveView. When I add that I get "AttributeError: 'function' 
object has no attribute 'as_view'" error.

Guess I will have to dig more into the docs as I just discovered this 
tonight and "MAYBE" I didn't read all of the  docs thoroughly enough.

Thanks for your reply.  I have discovered that by discussing my problem I 
am then able to come up with a solution.

-- 
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/08676940-3bd7-405d-b738-c7134a902dd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django Generic Date Views

2018-08-08 Thread Gerald Brown
Greetings:

Tonight I discovered something at 
https://docs.djangoproject.com/en/2.1/ref/class-based-views/generic-date-based/ 
that I thought is just what I am looking for.  The only problem is I can't 
get them to work.

They are designed to present views by Year, Month, Week, Day, Today or 
specific Date.

If anyone has experience using them I would be interested in how it works 
for you.

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/f50ac4bf-6da5-4850-b4a2-0ba9abea804f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django models

2018-08-08 Thread Gerald Brown
The last line of the error message tells you what to do.  Create a 
Secret Key in your settings.py file because it says it is now empty.



On Wednesday, 08 August, 2018 02:43 PM, Ramandeep Kaur wrote:
when i run this ./manage.py makemigrations it gives some error. Don't 
know what to do.


Traceback (most recent call last):
  File "manage.py", line 10, in 
    execute_from_command_line(sys.argv)
  File 
"C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 353, in execute_from_command_line

    utility.execute()
  File 
"C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 345, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 195, in fetch_command

    klass = load_command_class(app_name, subcommand)
  File 
"C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 39, in load_command_class

    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File 
"C:\Python27\lib\site-packages\django\core\management\commands\makemigrations.py", 
line 8, in 

    from django.db.migrations.autodetector import MigrationAutodetector
  File 
"C:\Python27\lib\site-packages\django\db\migrations\autodetector.py", 
line 13, in 

    from django.db.migrations.questioner import MigrationQuestioner
  File 
"C:\Python27\lib\site-packages\django\db\migrations\questioner.py", 
line 12, in 

    from .loader import MigrationLoader
  File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", 
line 10, in 

    from django.db.migrations.recorder import MigrationRecorder
  File 
"C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
12, in 

    class MigrationRecorder(object):
  File 
"C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
26, in MigrationRecorder

    class Migration(models.Model):
  File 
"C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
27, in Migration

    app = models.CharField(max_length=255)
  File 
"C:\Python27\lib\site-packages\django\db\models\fields\__init__.py", 
line 1072, in __init__

    super(CharField, self).__init__(*args, **kwargs)
  File 
"C:\Python27\lib\site-packages\django\db\models\fields\__init__.py", 
line 166, in __init__
    self.db_tablespace = db_tablespace or 
settings.DEFAULT_INDEX_TABLESPACE
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 
55, in __getattr__

    self._setup(name)
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 
43, in _setup

    self._wrapped = Settings(settings_module)
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 
120, in __init__
    raise ImproperlyConfigured("The SECRET_KEY setting must not be 
empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting 
must not be empty.


On Wed, Aug 8, 2018 at 6:22 AM, Gerald Brown <mailto:gsbrow...@gmail.com>> wrote:


Just delete the code in models.py and run ./manage.py
makemigrations and ./manage.py migrate.


On Wednesday, 08 August, 2018 01:14 AM, Ramandeep Kaur wrote:

My question is that how to delete models in django?
-- 
You received this message because you are subscribed to the

Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to django-users+unsubscr...@googlegroups.com
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to
django-users@googlegroups.com <mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users
<https://groups.google.com/group/django-users>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/42e646fa-af94-4250-b04a-5765e2975c3e%40googlegroups.com

<https://groups.google.com/d/msgid/django-users/42e646fa-af94-4250-b04a-5765e2975c3e%40googlegroups.com?utm_medium=email_source=footer>.
For more options, visit https://groups.google.com/d/optout
<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
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users
<https

Re: django models

2018-08-07 Thread Gerald Brown
Just delete the code in models.py and run ./manage.py makemigrations and 
./manage.py migrate.



On Wednesday, 08 August, 2018 01:14 AM, Ramandeep Kaur wrote:

My question is that how to delete models in django?
--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+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/42e646fa-af94-4250-b04a-5765e2975c3e%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/ebb428c7-b1cd-46e2-e139-9fe96a884353%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django ORM aggregate Sum function on foreign key

2018-08-07 Thread Gerald Brown
vi is just a variable that I created in my code.  It is just short for 
visit.  It has NOTHING to do with the vi editor program.  My editor is 
Geany.


I am using the Django ORM to query my database.


On Wednesday, 08 August, 2018 01:45 AM, Kidwell Nyatsambo wrote:

Hello,
Which application / program uses vi. I would like to create a 
schema.sql to use with Python.


KN

On Mon, Aug 6, 2018 at 4:08 PM, Gerald Brown <mailto:gsbrow...@gmail.com>> wrote:


This is how I finally solved my problem!!!

The following is a copy of my ORM statement:

 Visit.objects.filter(visit_date = mydate).aggregate(total =
Sum('visit_payment'))
{'total': Decimal('27')}
 This total is the total of the foreign key ids.  9 records each
with a key of 3 = 9 x 3 = 27

The way I solved this problem is to put another variable in the
loop where I was printing the records to Reportlab PDF file and I
incremented this variable with the value that was being printed. 
What was being printed was the value from the look-up table so I
was able to get a Sum from that.

Here is the code of how I did it: vi =
Visit.objects.filter(visit_date = mydate);  vip = 0; for v in vi:;
vi_pay = str(v.visit_payment); vip += int(vi_pay)

Here is how the Reportlab is built: Also in the same loop as above
I have the lines:  vi_pat = str(v.patient); pa1.drawString(x, y,
str(vi_pat)); pa1.drawString(x + 175, y, str(vi_pay))

Each of these are on a separate line in my code.

Hopefully this will help anyone with similar problems.


On Monday, 06 August, 2018 09:35 PM, Matthew Pava wrote:


You need to specify the field of the value in your ORM
statement.  I don’t know what your field name is, but this
assumes that it is “value”:

aggregate(Sum(‘payment__value’))

*From:*django-users@googlegroups.com
<mailto:django-users@googlegroups.com>
[mailto:django-users@googlegroups.com
<mailto:django-users@googlegroups.com>] *On Behalf Of *Gerald Brown
*Sent:* Monday, August 6, 2018 8:29 AM
*To:* Django users
*Subject:* Django ORM aggregate Sum function on foreign key

Greetings:

I am having a problem using the above function.

In my table I have a field payment that is a foreign key to a
payment table.

When I try to use aggregate(sum('payment')) it gives me the sum
of the foreign key, not the value from the payment table.

Currently I have 9 records in my test DB each one has a foreign
key of 3 so I get a sum of 27 not 2,250 that I should be getting.

This table also has a foreign key to the customer table and it
returns the customer not the foreign key number.

The thought I had was to make that foreign key an integer field
and then the user would have to enter a number instead of
selecting it from a list, prone to operator errors,

Any ideas on how I can get the correct totals using ORM.

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
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to
django-users@googlegroups.com <mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users
<https://groups.google.com/group/django-users>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/c47e4bb7-626c-4b07-9ab5-55d68fe4d566%40googlegroups.com

<https://groups.google.com/d/msgid/django-users/c47e4bb7-626c-4b07-9ab5-55d68fe4d566%40googlegroups.com?utm_medium=email_source=footer>.
For more options, visit https://groups.google.com/d/optout
<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
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to
django-users@googlegroups.com <mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users
<https://groups.google.com/group/django-users>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/3a17d4eeeb804cc89c4cda5eaca8b050%40ISS1.ISS.LOCAL

<https://groups.google.com/d/msgid/django-users/3a17d4eeeb804cc89c4cda5eaca8b050%40ISS1.ISS.LOCAL?utm_medium=email_source=footer>.
For more options, visit https://groups.google.com/d/optout
<https://groups.google.com/d/optout>.


-- 
You received this message because you are s

How to pass variable dates to a ORM query

2018-08-06 Thread Gerald Brown
I have a Django/Python function that creates a Reportab PDF file based on 
the current date.  Works GOOD. Now I want to pass any date to that function 
and have it create a PDF based on the new date.

I tried creating  another function that generates the date (yesterday) but 
I am not able to pass the generated date to the first function.

Any ideas on how to do this???

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/33e55cdb-2d95-4638-b451-3d3657673221%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django ORM aggregate Sum function on foreign key

2018-08-06 Thread Gerald Brown

This is how I finally solved my problem!!!

The following is a copy of my ORM statement:

 Visit.objects.filter(visit_date = mydate).aggregate(total = 
Sum('visit_payment'))

{'total': Decimal('27')}
 This total is the total of the foreign key ids.  9 records each with a 
key of 3 = 9 x 3 = 27


The way I solved this problem is to put another variable in the loop 
where I was printing the records to Reportlab PDF file and I incremented 
this variable with the value that was being printed. What was being 
printed was the value from the look-up table so I was able to get a Sum 
from that.


Here is the code of how I did it: vi = Visit.objects.filter(visit_date = 
mydate);  vip = 0; for v in vi:; vi_pay = str(v.visit_payment); vip += 
int(vi_pay)


Here is how the Reportlab is built: Also in the same loop as above I 
have the lines:  vi_pat = str(v.patient); pa1.drawString(x, y, 
str(vi_pat)); pa1.drawString(x + 175, y, str(vi_pay))


Each of these are on a separate line in my code.

Hopefully this will help anyone with similar problems.


On Monday, 06 August, 2018 09:35 PM, Matthew Pava wrote:


You need to specify the field of the value in your ORM statement.  I 
don’t know what your field name is, but this assumes that it is “value”:


aggregate(Sum(‘payment__value’))

*From:*django-users@googlegroups.com 
[mailto:django-users@googlegroups.com] *On Behalf Of *Gerald Brown

*Sent:* Monday, August 6, 2018 8:29 AM
*To:* Django users
*Subject:* Django ORM aggregate Sum function on foreign key

Greetings:

I am having a problem using the above function.

In my table I have a field payment that is a foreign key to a payment 
table.


When I try to use aggregate(sum('payment')) it gives me the sum of the 
foreign key, not the value from the payment table.


Currently I have 9 records in my test DB each one has a foreign key of 
3 so I get a sum of 27 not 2,250 that I should be getting.


This table also has a foreign key to the customer table and it returns 
the customer not the foreign key number.


The thought I had was to make that foreign key an integer field and 
then the user would have to enter a number instead of selecting it 
from a list, prone to operator errors,


Any ideas on how I can get the correct totals using ORM.

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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/c47e4bb7-626c-4b07-9ab5-55d68fe4d566%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/c47e4bb7-626c-4b07-9ab5-55d68fe4d566%40googlegroups.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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/3a17d4eeeb804cc89c4cda5eaca8b050%40ISS1.ISS.LOCAL 
<https://groups.google.com/d/msgid/django-users/3a17d4eeeb804cc89c4cda5eaca8b050%40ISS1.ISS.LOCAL?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/03e77e95-26b7-01e9-e11b-beca97d16176%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django ORM aggregate Sum function on foreign key

2018-08-06 Thread Gerald Brown
Greetings:

I am having a problem using the above function.

In my table I have a field payment that is a foreign key to a payment table.

When I try to use aggregate(sum('payment')) it gives me the sum of the 
foreign key, not the value from the payment table.
Currently I have 9 records in my test DB each one has a foreign key of 3 so 
I get a sum of 27 not 2,250 that I should be getting.

This table also has a foreign key to the customer table and it returns the 
customer not the foreign key number.

The thought I had was to make that foreign key an integer field and then 
the user would have to enter a number instead of selecting it from a list, 
prone to operator errors,

Any ideas on how I can get the correct totals using ORM.

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/c47e4bb7-626c-4b07-9ab5-55d68fe4d566%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Question] Django 2 - how to sum values based on filter and group by Year-Month

2018-07-27 Thread Gerald Brown
I am having a similar problem where I want to get the total (SUM) of 
about 20 - 30 items in a current day.  I can get the list of customers 
names and payments in a html table but so far haven't been able to get 
the SUM of those payments.  I have tried using Django ORM AGGREGATE 
SUM('integer field') but I am not able to get the results.


I haven't tried grouping yet in my project but will probably have to in 
the near future.  I think it is possible to group by week & month and 
then get a sum of those groups.  MariaDB has a function "MONTH" and " 
WEEKOFYEAR" which I hope will help with the grouping.  One problem that 
I have is that in my customer table I have a ForeignKey link to a 
Payment_amount table so the user can look up the payment amount instead 
of typing it in where an extra/less zero could be entered.


One web site that might offer some suggestions on solving your/my 
problem is: 
https://simpleisbetterthancomplex.com/tutorial/2016/12/06/how-to-create-group-by-queries.html. 
This site has a lot of posts relating to Django.


Good luck & I would be interested in how you solved this problem.

Gerald S. Brown

On Friday, 27 July, 2018 10:25 AM, Charles Sartori wrote:

I have the following table:

2018-01-01      10
2018-01-15      20
2018-01-31      30
2018-02-01      10
2018-03-01      10
2018-03-20      20

I need to Sum() the values filtering it with
1 - sum(values) where date < first day of the month
2 - sum(values) where date < last day of the month

Expected result(something like that):
[
 {'year-month': '2018-01'}, {'sum_before_month_day_one': *0*}, 
{'sum_before_last_month_day': *60*},
 {'year-month': '2018-02'}, {'sum_before_month_day_one': *60*}, 
{'sum_before_last_month_day': *70*},
 {'year-month': '2018-03'}, {'sum_before_month_day_one': *70*}, 
{'sum_before_last_month_day': *100*},

]

So far I manage to sum values and group by month:

In [12]: result = Sale.objects \
    ...:     .annotate(date=TruncMonth('event_date')) \
    ...:     .values('date') \
    ...:     .annotate(quantity=Sum('quantity')) \
    ...:     .values('date', 'quantity') \
    ...:     .order_by('date')

In [13]: for i in result: print(i)

{'date': datetime.date(2018, 1, 1), 'quantity': 60.0}
{'date': datetime.date(2018, 2, 1), 'quantity': 10.0}
{'date': datetime.date(2018, 3, 1), 'quantity': 30.0}
--
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/a57a7058-ea08-4909-8e98-c678aa9969cc%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/ca3a45c8-7fec-fc94-1e90-d95e3726462d%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: learn dijango

2018-07-26 Thread Gerald Brown
The best way to learn Django is to jump in and start using it. If you 
have problems there are many tutorials and web sites (including this 
one) to provide help and support.


IMHO, a teacher CANNOT teach a student, all they can do is HELP the 
student learn.



On Thursday, 26 July, 2018 01:55 PM, arul wrote:
*I just entered the programming world and i know little bit 
javascript,HTML can learn even I don't  know any oop/scripting 
language can I learn django for now is there any possibility*


--
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/6a647470-b7e2-49a9-b323-6d820f4843d2%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/df439168-89b2-a1cd-3785-97932f70dacb%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to automatically fill out an auto increment number in form field?

2018-07-23 Thread Gerald Brown
From 
"https://docs.djangoproject.com/en/2.0/topics/db/models/#automatic-primary-key-fields;, 
it has a further definition of automatic primary key fields.  In your 
model just add "(primary_key=True)" to po_number field.



On Tuesday, 24 July, 2018 07:54 AM, Michael MacIntosh wrote:


Hi,

Aren't you looking for the AutoField?

https://docs.djangoproject.com/en/2.0/ref/models/fields/#autofield

It will automatically increment based on each record added to the table.


As an aside, the problem you are having is that in python, the first 
argument to a class is a reference to the instance of that class.  In 
C this is often called a context.  In C++ and Java it would be like 
the `this` pointer.  So you wouldn't generally pass "self" to a class 
member.


Hope that helps!


On 7/23/2018 1:39 PM, Alexander Joseph wrote:

Hello,

I have a model ...

|
class PurchaseOrder(models.Model):
    po_number = models.IntegerField(unique=True)
|


and a function ...

|
def get_po_number(self, *args, **kwargs):
    if not self.id:
        last_po = PurchaseOrder.objects.order_by('po_number').last()
        if last_po:
            last_po_num = last_po.po_number[-2:]
            new_po_num = int(last_po_num) + 1
        else:
            new_po_num = '0001'
        self.po_number = new_po_num
        return self.po_number
|


what I'm trying to do is use the get_po_number() function to get a 
default value for the po_number field in the model. However when I 
set the default in the model like so...


|
class PurchaseOrder(models.Model):
    po_number = models.IntegerField(unique=True, 
default=get_po_number(self))

|

it says "NameError: name 'self' is not defined"


What am I doing wrong? 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/6183c81e-54b8-4779-9bf3-c8c9e734f248%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.

--
This message has been scanned for viruses and dangerous content by
*E.F.A. Project* , and is believed to be 
clean.
Click here to report this message as spam. 
 



--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+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/945d5f35-e98b-b1f1-a527-32ff83687668%40linear-systems.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/a37859a4-3c35-6f19-6a9b-ef997361bcee%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to fix "App 'polls' could not be found. Is it in INSTALLED_APPS?"

2018-07-23 Thread Gerald Brown
Don't use SUDO, just python manage.py makemigrations.  Also the "POLLS" 
is not necessary.



On Monday, 23 July, 2018 02:48 PM, Sitthiput Mongkolsri wrote:
Hi, i'm new to django. Just learn from the tutorial and found this 
problem. I don't know how to fix this, wish someone could. 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/df20c6f9-b742-42a2-bd12-493605606d66%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/3a2ff438-04e0-a444-01b4-0dbc309363e6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Good up-to-date Django report builder addons

2018-07-22 Thread Gerald Brown
As I don't know HTML that much, I am now going through the Django docs & 
trying it using Django Views.


I now need to look into Django URLS because I keep getting 404 errors.

Just need to keep trying & learning & eventually will get it!!!


On Sunday, 22 July, 2018 06:33 PM, mottaz hejaze wrote:
gerald do you realy need a package to do this , couse i think its not 
that hard to code by you ! i think there are time intervals functions 
in datetime and in django timezone you can use ..


On Sun, 22 Jul 2018, 11:07 Gerald Brown, <mailto:gsbrow...@gmail.com>> wrote:


Been there done that.

It would not select a range of dates and the date had to be
specified as
2018-07-22, not Now() or Today().

I had 10 records that met the criteria but it only selected 2. Not
very
easy to use.

Also very limited support, did NOT reply to my questions.

Have you used it?  Did you have better results?

Thanks.


On Sunday, 22 July, 2018 04:49 PM, Melvyn Sopacua wrote:
> On zondag 22 juli 2018 10:34:17 CEST Gerald Brown wrote:
>> I went to that site but sorry to say was UNABLE to find
anything I could
>> use as most are OUTDATED, written in Python 2.? ,Alpha or Beta
versions
>> that have not been updated in many years.
> You gave up too early. I don't know why it's ranked all the way
on the right,
> but this is defenitely stable and maintained and has a very good
architecture:
>
> https://djangopackages.org/packages/p/django-report-builder/
>

-- 
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
<mailto:django-users%2bunsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto: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/df5cdd8d-741d-16a7-ff2e-e050cc823250%40gmail.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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/CAHV4E-dXcrJ-d8EEOGf59Y_5xZFsQRAnARGoPqiHsJVB1VP7zw%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CAHV4E-dXcrJ-d8EEOGf59Y_5xZFsQRAnARGoPqiHsJVB1VP7zw%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/dfbc997f-662c-7aec-291f-96dbae2bc6cf%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Good up-to-date Django report builder addons

2018-07-22 Thread Gerald Brown

Been there done that.

It would not select a range of dates and the date had to be specified as 
2018-07-22, not Now() or Today().


I had 10 records that met the criteria but it only selected 2. Not very 
easy to use.


Also very limited support, did NOT reply to my questions.

Have you used it?  Did you have better results?

Thanks.


On Sunday, 22 July, 2018 04:49 PM, Melvyn Sopacua wrote:

On zondag 22 juli 2018 10:34:17 CEST Gerald Brown wrote:

I went to that site but sorry to say was UNABLE to find anything I could
use as most are OUTDATED, written in Python 2.? ,Alpha or Beta versions
that have not been updated in many years.

You gave up too early. I don't know why it's ranked all the way on the right,
but this is defenitely stable and maintained and has a very good architecture:

https://djangopackages.org/packages/p/django-report-builder/



--
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/df5cdd8d-741d-16a7-ff2e-e050cc823250%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Good up-to-date Django report builder addons

2018-07-22 Thread Gerald Brown
I went to that site but sorry to say was UNABLE to find anything I could 
use as most are OUTDATED, written in Python 2.? ,Alpha or Beta versions 
that have not been updated in many years. 

I did find one on another site called i-net Clear Reports that has a FREE 
report designer similar to Crystal Reports that creates reports with a 
*.rpt extension.  

The only problem is in order to use those reports a person has to spend 
US$2,000 - US$5,000 or more for their report server application.  That is a 
bit steep for my wallet as a 1 person FOOS Django shop developing for a 2 
person client shop.

The report I need to design is a simple 3 column report with a totals 
summary at the bottom.

Again thanks for your info.

On Friday, July 20, 2018 at 7:18:04 PM UTC+8, Gerald Brown wrote:
>
> Thanks for your info.  Will check it out.
>
> On Friday, 20 July, 2018 07:02 PM, Jason wrote:
>
> Any time I have the question "Is there something in Django that will do 
> this?", my first stop is https://djangopackages.org/ 
>
> For example, their listings for reporting 
> <https://djangopackages.org/grids/g/reporting/> have a number of options 
> and you can filter by python3 compatibility.
> -- 
> 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/432963a3-91cd-459b-9e5b-3e36ca551dd3%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/432963a3-91cd-459b-9e5b-3e36ca551dd3%40googlegroups.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/7dfcd22c-c234-40f7-8e72-263e090e0366%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Djando 2.0.7 image handling problem on production server

2018-07-21 Thread Gerald Brown
I use pyvenvwrapper which I find is even better than pyenv.  Once a 
project is created just enter "workon proj-name" and it will take you to 
the project directory.  It can be found at: 
https://github.com/solovyevn/pyvenvwrapper



On Sunday, 22 July, 2018 10:30 AM, mottaz hejaze wrote:

thats why they invented virtualenv

On Sat, 21 Jul 2018, 19:36 Melvyn Sopacua, > wrote:


On zaterdag 21 juli 2018 19:08:03 CEST Asif Khan wrote:

> Oh dear I checked and found that Pillow was install in Python3.5
where as

> production setup is for Python3.6 so Pillow was installed by
pip3.5 but not

> with pip3.6 which I have installed now.

Have a look at pyenv . Relying on
"versioned commands" goes wrong too often.

-- 


Melvyn Sopacua

-- 
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/1932017.Pnh1MIuky5%40fritzbook

.
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/CAHV4E-eF%3D3XqH0gf-Y-V7FpsTgc3fN6FzaMkTh26OHuHm6Sy5A%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/edd2e894-b136-6834-1f7c-ff7d60dfc650%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Good up-to-date Django report builder addons

2018-07-20 Thread Gerald Brown

Thanks for your info.  Will check it out.


On Friday, 20 July, 2018 07:02 PM, Jason wrote:
Any time I have the question "Is there something in Django that will 
do this?", my first stop is https://djangopackages.org/


For example, their listings for reporting 
 have a number of 
options and you can filter by python3 compatibility.

--
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/432963a3-91cd-459b-9e5b-3e36ca551dd3%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/9c425510-14ad-05b4-c313-3e85785c8051%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Good up-to-date Django report builder addons

2018-07-20 Thread Gerald Brown
Does anyone know of any *GOOD, UP-TO-DATE* Django report builder add-ons?  

I was just working with Appy and discovered it was built with Python 2.? 
and I am using Python3.6.5. so I was getting a ton of errors.  Even though 
the last release in Pypi was in April 2018 they are still using Python 2.?

My client wants to create a daily report of customer spending.  The report 
should be simple to build as it consists of only 3 columns and a total at 
the bottom.  I want it to report by daily, weekly, monthly and yearly where 
the first will be a detailed report and the other 3 would be summary 
reports.

Many decades ago I used Crystal Reports but have not found anything similar 
for Django.  If anyone knows of this or something similar please let me 
know.

Thank you in advance!!!

-- 
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/71464850-db79-4409-bd5e-4d9cd926e001%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: PROBLEM WITH DJANGO

2018-07-18 Thread Gerald Brown
You need a command after the "manage.py" like manage.py runserver, or 
manage.py makemigrations, or manage.py migrate, or manage.py shell or 
any other commands.



On Tuesday, 17 July, 2018 08:51 PM, said lamari wrote:

i have this problem please i nead help
--
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/52311fec-d242-4b4a-9d39-c610a295695d%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/1c2426c0-7655-b508-bc3c-9c166c9beedf%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django foreign-key cannot assign must be a instance

2018-07-18 Thread Gerald Brown
Also when creating my models I use "id = 
models.AutoField(primary_key=True)" for my ID field.  This way Django 
will Auto generate an ID for each record.



On Tuesday, 17 July, 2018 08:03 PM, Sainath Bavugi wrote:
I am developing a web app using Django. I have created the table in 
MySQL database and then generated the models.pyusing inspectdb. I am 
able to fetch details and connect to the database without any issues. 
But while saving the values to the particular table, below error is shown


*Cannot assign "3": "List.id" must be a "Order" instance.*
*
*
command used
|sav_list =List(id=4,item_name 
='name1',item_desc='desc1',location='location',reason='rfp',pid=3)|

|*My models*|
|classList(models.Model):id 
=models.IntegerField(db_column='ID',primary_key=True)# Field name made 
lowercase.item_name 
=models.CharField(db_column='Item_Name',max_length=255)# Field name 
made lowercase.item_desc 
=models.CharField(db_column='Item_Desc',max_length=300)# Field name 
made lowercase.location 
=models.CharField(db_column='Location',max_length=100,blank=True,null=True)# 
Field name made lowercase.reason 
=models.CharField(db_column='Reason',max_length=100,blank=True,null=True)# 
Field name made lowercase.pid 
=models.ForeignKey('Order',models.DO_NOTHING,db_column='PID')# Field 
name made lowercase.classOrder(models.Model):poid 
=models.IntegerField(db_column='POID',primary_key=True)# Field name 
made lowercase.po 
=models.CharField(db_column='PO',unique=True,max_length=20)# Field 
name made lowercase.quote 
=models.CharField(db_column='Quote',unique=True,max_length=20)# Field 
name made lowercase.|

|
|condition =models.CharField(db_column='Condition',max_length=15)# 
Field name made lowercase. |

|

I have tried relate_name for foreign key but still same behaviour. 
Same values can be stored on database without any issues. Only Django 
throws an error.


Please someone help me!!!

|
|
--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com 
.
To 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/3dce2148-ee12-41c5-996f-f21c7b33b4a5%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/8e431e64-34d5-6c63-012e-242ed49bef4e%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django foreign-key cannot assign must be a instance

2018-07-17 Thread Gerald Brown
The way I do it is backwards from what you are doing.  I.E. I make the 
models first and then use ./manage.py makemigrations & ./manage.py 
migrate.  This way Django creates the tables AND the FK Indexes, which I 
think may be missing on your setup.  Now that you have the models try 
running the above commands.


Hope this helps.


On Tuesday, 17 July, 2018 08:03 PM, Sainath Bavugi wrote:
I am developing a web app using Django. I have created the table in 
MySQL database and then generated the models.pyusing inspectdb. I am 
able to fetch details and connect to the database without any issues. 
But while saving the values to the particular table, below error is shown


*Cannot assign "3": "List.id" must be a "Order" instance.*
*
*
command used
|sav_list =List(id=4,item_name 
='name1',item_desc='desc1',location='location',reason='rfp',pid=3)|

|*My models*|
|classList(models.Model):id 
=models.IntegerField(db_column='ID',primary_key=True)# Field name made 
lowercase.item_name 
=models.CharField(db_column='Item_Name',max_length=255)# Field name 
made lowercase.item_desc 
=models.CharField(db_column='Item_Desc',max_length=300)# Field name 
made lowercase.location 
=models.CharField(db_column='Location',max_length=100,blank=True,null=True)# 
Field name made lowercase.reason 
=models.CharField(db_column='Reason',max_length=100,blank=True,null=True)# 
Field name made lowercase.pid 
=models.ForeignKey('Order',models.DO_NOTHING,db_column='PID')# Field 
name made lowercase.classOrder(models.Model):poid 
=models.IntegerField(db_column='POID',primary_key=True)# Field name 
made lowercase.po 
=models.CharField(db_column='PO',unique=True,max_length=20)# Field 
name made lowercase.quote 
=models.CharField(db_column='Quote',unique=True,max_length=20)# Field 
name made lowercase.|

|
|condition =models.CharField(db_column='Condition',max_length=15)# 
Field name made lowercase. |

|

I have tried relate_name for foreign key but still same behaviour. 
Same values can be stored on database without any issues. Only Django 
throws an error.


Please someone help me!!!

|
|
--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com 
.
To 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/3dce2148-ee12-41c5-996f-f21c7b33b4a5%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/998748ae-abcf-bfae-8133-10286e64499c%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin CSS Not Working in Opera or UC Browser

2018-07-15 Thread Gerald Brown
One thing I noticed in your settings file is that you are missing a 
comma (,) at the end of your last application in the settings file.



On Monday, 16 July, 2018 08:54 AM, Kayode Oladipo wrote:
I recently sent in a query concerning my faulty admin css which loaded 
previously until an upgrade to v.2.0.5.
I assumed the upgrade was responsible for this, so i downgraded back 
to my previous version (2.0.2) but there was no change. I have 
uninstalled and tried all fixes I know all to no avail.
The admin css is still not loading in the above mentioned browsers but 
is loading in Internet Explorer (which I do not want to use).


I would appreciate any assistance.
Attached is the settings file from my project.

Cheers from Nigeria.
--
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/CA%2BARzD_qF1treWg%2Bf4xz76S-DNRZ6%3DVTexBTTJBXTp4E%3DcVy5A%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/64b3b244-889c-8893-b2ab-0bdfbd5cd2df%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin CSS Not Working in Opera or UC Browser

2018-07-15 Thread Gerald Brown

Have you tried FireFox?


On Monday, 16 July, 2018 08:54 AM, Kayode Oladipo wrote:
I recently sent in a query concerning my faulty admin css which loaded 
previously until an upgrade to v.2.0.5.
I assumed the upgrade was responsible for this, so i downgraded back 
to my previous version (2.0.2) but there was no change. I have 
uninstalled and tried all fixes I know all to no avail.
The admin css is still not loading in the above mentioned browsers but 
is loading in Internet Explorer (which I do not want to use).


I would appreciate any assistance.
Attached is the settings file from my project.

Cheers from Nigeria.
--
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/CA%2BARzD_qF1treWg%2Bf4xz76S-DNRZ6%3DVTexBTTJBXTp4E%3DcVy5A%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/66706dcc-4827-6b46-fd3b-995839c8d09f%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How is MySQL syntax for a table changed if I had a ManyToManyField?

2018-07-14 Thread Gerald Brown
When looking at my database it has the 3rd table for the ManyToMany with 
the following:


1. ID auto-generated,

2. Table1.ID

3. Table2.ID.

All fields will be integers.

The 3rd table will be named Table1_Table2 or something like that.

I noticed in your code below that you do not have an ID field on any 
table.  I believe this is required for M2M tables.  Django 
makemigrations & migrate will generate this for you if not defined in 
the model.  Django will also create the third table for you with 
makemigrations/migrate so no need to create it by hand.


What were the problems you were having with makemigrations/migrate?  It 
is supposed to create the tables for all apps in your project but you 
can also specify only 1 app if you want to.


Hope this helps.


On Saturday, 14 July, 2018 07:05 PM, mottaz hejaze wrote:
for many to many relationships between two tables .. you can make a 
third table that only contains the id fields ftom both tables , then 
you can make a third model for this table.


On Fri, 13 Jul 2018, 22:24 , > wrote:


I tried for hours to get django's migrate/makemigrations function
work but miserably couldn't so I created my tables in MySQL. Now
I'm trying to add a ManyToManyField between 2 models but am not
sure how the MySQL syntax is supposed to look like.

This is my current code:

from django.db import models

class Publication(models.Model):
title = models.CharField(max_length=30)

class Article(models.Model):
headline = models.CharField(max_length=100)

and I can create a table as follows in MySQL:

CREATE TABLE publication (
    title varchar(30)
);
CREATE TABLE Article (
    headline varchar(100),
);

I need to add the ManyToManyField like so:
class Article(models.Model):
    headline = models.CharField(max_length=100)
/publications = models.ManyToManyField(Publication)/

I'm really running low on time, could someone assist me with what
the MySQL code is supposed to look like? I will be permanently in
your debt.
-- 
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/6f546243-23f0-4760-806b-9fff01d2afd7%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/CAHV4E-eGQQ3jdwSaa9d9xaxk7rV_Tt-Fqas3OTuhYEYd1%3D8zMA%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/1cc82de7-c0af-527f-93f8-2740c46a9001%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django wamp

2018-07-08 Thread Gerald Brown

Is it possible to run 2 servers (Apache & Nginx) on the same system?

Maybe if they listen on different ports i.e. 80 & 81


On Sunday, 08 July, 2018 01:09 PM, m1chael wrote:

best not to fight Apache and just use nginx for django

On Sat, Jul 7, 2018, 11:07 PM > wrote:



Hi,
I'm a novice with django but have been setting up django on a Win7
Wamp stack.  We have several small non-django websites running on
wamp.
Those projects are in c:/wamp/www/myproject for ex. and are
accessed as localhost/myproject or myipxxx/myproject.

Under wamp I have tried putting the django project in
c:/wamp/apps, in c:/wamp/www, and just in c:/wamp too. They all
work fine with apache and mod_wsgi.
At least I get a sample "helloworld" message in the webpage when I
access the django site as localhost/mydjangosite or
myipxxx/mydjangosite.  This is basically the simple tut01 or polls
app kindof django project.

But the django project, wherever I put it in wamp, buggers our
other non-django websites.  I get a message back from urls.py
saying it's been thru all the urls listed and it cannot access our
regular (non django sites) in c:/wamp/www when I try to access one
as localhost/myproject or myipxxx/myproject from the browser.

I'm a bit stuck on how to get these two to play together nicely. 
I'm not sure if it's a django project configuration, an apache
httpd.conf problem, or a wamp issue.  I'm wondering if someone has
experience with this issue and could point me in the right
direction for how to use django, but continue to use localhost or
myipxxx/ to access our non-django wamp sites.

Thank you,
Bob
-- 
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/f9e69bf3-5192-41b9-9b80-d80617c9f5d9%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/CAAuoY6Nan7vxHE%3DLXAMYnMhh58%3DiV6DwFxQnt0FPBd7vvS6J_w%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/c1af585f-19c4-5cd0-7697-e167726ae65e%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: help

2018-07-06 Thread Gerald Brown
At https://docs.djangoproject.com/en/2.0/ref/models/fields/ it lists a 
list of various options, and Protect is one of the options so, yes you 
are correct.  However PROTECT prevents that record from being deleted so 
you might want to use CASCADE instead of PROTECT.



On Friday, 06 July, 2018 08:42 PM, Umar Kambala wrote:


Please this wat I now hv am I correct?

On_delete = models.PROTECT

On Jul 6, 2018 11:28 AM, "Gerald Brown" <mailto:gsbrow...@gmail.com>> wrote:


In any field that is a ForeignKey you now have to add "on_delete =
???" (there are a number of options to replace the ???).

See the last line of the error message as it shows you the file
and line number of where the error is.


On Friday, 06 July, 2018 07:13 PM, Umar Kambala wrote:

please this the error i got when i run python manage.py
makemigrations

 File

"C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py",
line 371, in execute_from_command_line
    utility.execute()
  File

"C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py",
line 347, in execute
    django.setup()
  File

"C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\__init__.py",
line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File

"C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\registry.py",
line 112, in populate
    app_config.import_models()
  File

"C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\config.py",
line 198, in import_models
    self.models_module = import_module(models_module_name)
  File

"C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py",
line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 994, in _gcd_import
  File "", line 971, in _find_and_load
  File "", line 955, in
_find_and_load_unlocked
  File "", line 665, in _load_unlocked
  File "", line 678, in
exec_module
  File "", line 219, in
_call_with_frames_removed
  File "C:\Users\Admin\Desktop\Django
Web\myproject\boards\models.py", line 10, in 
    class Topic (models.Model):
  File "C:\Users\Admin\Desktop\Django
Web\myproject\boards\models.py", line 13, in Topic
    board = models.ForeignKey(Board, related_name='topics')
TypeError: __init__() missing 1 required positional argument:
'on_delete'


this are the codes

from django.dbimport models
from django.contrib.auth.modelsimport User


class Board(models.Model):
 name = models.CharField(max_length=30, unique=True)
 description = models.CharField(max_length=100)


class Topic (models.Model):
 subject = models.CharField(max_length=255)
 last_updated = models.DateTimeField()
 board = models.ForeignKey(Board, related_name='topics')
 starter = models.ForeignKey(User, related_name='topics')


class Post(models.Model):
 message = models.TextField(max_length=4000)
 topic = models.ForeignKey(Topic, related_name='posts')
 created_at = models.DateTimeField(auto_now_add=True)
 updated_at = models.DateTimeField(null=True)
 created_by = models.ForeignKey(User, related_name='posts')
 updated_by = models.ForeignKey(User, null=True, related_name='+')

-- 
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
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to
django-users@googlegroups.com <mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users
<https://groups.google.com/group/django-users>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/CAPkbFbaHq8Mgz_ZLnmC1EWQmT7FodSbEaWnd7buTcRR85aYTSg%40mail.gmail.com

<https://groups.google.com/d/msgid/django-users/CAPkbFbaHq8Mgz_ZLnmC1EWQmT7FodSbEaWnd7buTcRR85aYTSg%40mail.gmail.com?utm_medium=email_source=footer>.
For more options, visit https://groups.google.com/d/optout
<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+u

Re: help

2018-07-06 Thread Gerald Brown
In any field that is a ForeignKey you now have to add "on_delete = ???" 
(there are a number of options to replace the ???).


See the last line of the error message as it shows you the file and line 
number of where the error is.



On Friday, 06 July, 2018 07:13 PM, Umar Kambala wrote:

please this the error i got when i run python manage.py makemigrations

 File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py", 
line 371, in execute_from_command_line

    utility.execute()
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py", 
line 347, in execute

    django.setup()
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\__init__.py", 
line 24, in setup

    apps.populate(settings.INSTALLED_APPS)
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\registry.py", 
line 112, in populate

    app_config.import_models()
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\config.py", 
line 198, in import_models

    self.models_module = import_module(models_module_name)
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py", 
line 126, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 994, in _gcd_import
  File "", line 971, in _find_and_load
  File "", line 955, in 
_find_and_load_unlocked

  File "", line 665, in _load_unlocked
  File "", line 678, in exec_module
  File "", line 219, in 
_call_with_frames_removed
  File "C:\Users\Admin\Desktop\Django Web\myproject\boards\models.py", 
line 10, in 

    class Topic (models.Model):
  File "C:\Users\Admin\Desktop\Django Web\myproject\boards\models.py", 
line 13, in Topic

    board = models.ForeignKey(Board, related_name='topics')
TypeError: __init__() missing 1 required positional argument: 'on_delete'


this are the codes

from django.dbimport models
from django.contrib.auth.modelsimport User


class Board(models.Model):
 name = models.CharField(max_length=30, unique=True)
 description = models.CharField(max_length=100)


class Topic (models.Model):
 subject = models.CharField(max_length=255)
 last_updated = models.DateTimeField()
 board = models.ForeignKey(Board, related_name='topics')
 starter = models.ForeignKey(User, related_name='topics')


class Post(models.Model):
 message = models.TextField(max_length=4000)
 topic = models.ForeignKey(Topic, related_name='posts')
 created_at = models.DateTimeField(auto_now_add=True)
 updated_at = models.DateTimeField(null=True)
 created_by = models.ForeignKey(User, related_name='posts')
 updated_by = models.ForeignKey(User, null=True, related_name='+')

--
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/CAPkbFbaHq8Mgz_ZLnmC1EWQmT7FodSbEaWnd7buTcRR85aYTSg%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/ec3324f6-1cdf-c892-754c-094a6823ada2%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django split screen

2018-06-29 Thread Gerald Brown

Julio*,*

Thanks for the quick reply.

I have not worked with templates yet so that will be a new field for me 
to explore.



On Friday, 29 June, 2018 09:41 PM, Julio Biason wrote:

Hi Gerald,

You can't "split" the screen because Django is simply a way to 
retrieve data from a database and send HTML to the browser.


You can, however, load the history and create a form and send both to 
the template, which will display both side by side (or one on to the 
top of the other, or whatever).


All you have to do is create a view that loads the history and create 
a form object and send both to a template that knows how to display both.


On Fri, Jun 29, 2018 at 10:36 AM, Gerald Brown <mailto:gerbre...@gmail.com>> wrote:


Has anyone ever heard of a way to split a screen in Django?

What my client wants to do is to view a screen with the customers
previous history (scrollable but NOT editable) while entering new
data for that customer.

I think I will need a form for the data entery but I am not sure
what I would use to display the history data.

Any ideas or suggestions?

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
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users
<https://groups.google.com/group/django-users>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/e61f1617-e8ae-46b5-ac82-22275c600d2a%40googlegroups.com

<https://groups.google.com/d/msgid/django-users/e61f1617-e8ae-46b5-ac82-22275c600d2a%40googlegroups.com?utm_medium=email_source=footer>.
For more options, visit https://groups.google.com/d/optout
<https://groups.google.com/d/optout>.




--
*Julio Biason*,Sofware Engineer
*AZION*  | Deliver. Accelerate. Protect.
Office: +55 51 3083 8101   |  Mobile: +55 51 
_99907 0554_

--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/CAEM7gE3ioQn3U8HOC02fZDMXYgoiAZunNYSfRuM-B-Nu5g9QGQ%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CAEM7gE3ioQn3U8HOC02fZDMXYgoiAZunNYSfRuM-B-Nu5g9QGQ%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/edf9fb0f-b662-919d-20c3-8745a82f494e%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django split screen

2018-06-29 Thread Gerald Brown
Has anyone ever heard of a way to split a screen in Django?

What my client wants to do is to view a screen with the customers previous 
history (scrollable but NOT editable) while entering new data for that 
customer.

I think I will need a form for the data entery but I am not sure what I 
would use to display the history data.

Any ideas or suggestions?

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/e61f1617-e8ae-46b5-ac82-22275c600d2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to pass the ID of a slected item in a list to ORM

2018-06-22 Thread Gerald Brown

Thanks for the reply.


On Tuesday, 19 June, 2018 04:17 AM, C. Kirby wrote:

Yes

On Friday, June 15, 2018 at 10:07:01 PM UTC-4, Gerald Brown wrote:

When I inspect the object in Firefox that is what it looks like
because it is generated by Django. Does the user have to select an
item and then submit it in order for me to get the ID?

Thanks.


On Friday, 15 June, 2018 10:29 PM, C. Kirby wrote:

So you have a
|

A
|B
|||C

||
|

If you make your option tags look like
|
{{person.name
<http://person.name>}}
|

The submitted value for the field will be the patient_id, which
you then use in your filter statement.


On Friday, June 15, 2018 at 8:46:53 AM UTC-4, Gerald Brown wrote:

Greetings:

I have a form with a listbox that has people's names and
their ID from the database.  I am trying to get the ID from
that list for the selected person so I can use it in ORM
statements: I.E. v1 = Visit.objects.filter(person_id = ??)
where ?? is the ID from the select list.

Has anyone had any experience on how I can accomplish this?

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...@googlegroups.com .
To post to this group, send email to django...@googlegroups.com
.
Visit this group at https://groups.google.com/group/django-users
<https://groups.google.com/group/django-users>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/bd054ed4-8761-415d-adaf-07bfc144956d%40googlegroups.com

<https://groups.google.com/d/msgid/django-users/bd054ed4-8761-415d-adaf-07bfc144956d%40googlegroups.com?utm_medium=email_source=footer>.
For more options, visit https://groups.google.com/d/optout
<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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/d7e93f6a-e3bd-40eb-8d3b-bc74f9358347%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/d7e93f6a-e3bd-40eb-8d3b-bc74f9358347%40googlegroups.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/9a113717-f500-b70b-adbe-228b508d5470%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to pass the ID of a slected item in a list to ORM

2018-06-15 Thread Gerald Brown
When I inspect the object in Firefox that is what it looks like because 
it is generated by Django. Does the user have to select an item and then 
submit it in order for me to get the ID?


Thanks.


On Friday, 15 June, 2018 10:29 PM, C. Kirby wrote:

So you have a
|

A
|B
|||C

||
|

If you make your option tags look like
|
{{person.name}}
|

The submitted value for the field will be the patient_id, which you 
then use in your filter statement.



On Friday, June 15, 2018 at 8:46:53 AM UTC-4, Gerald Brown wrote:

Greetings:

I have a form with a listbox that has people's names and their ID
from the database.  I am trying to get the ID from that list for
the selected person so I can use it in ORM statements: I.E. v1 =
Visit.objects.filter(person_id = ??) where ?? is the ID from the
select list.

Has anyone had any experience on how I can accomplish this?

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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/bd054ed4-8761-415d-adaf-07bfc144956d%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/bd054ed4-8761-415d-adaf-07bfc144956d%40googlegroups.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/11e7c90f-4305-3062-1d2e-c0f49f97d81d%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to pass the ID of a slected item in a list to ORM

2018-06-15 Thread Gerald Brown

The ID is an integer as it is the ID for the table. The name is a VARCHAR.

I have had this same problem in the past with other programming 
languages.  How to get my head around how to get the ID for a selected item.



On Friday, 15 June, 2018 10:09 PM, Anthony Anonde wrote:

Sorry your question is a bit complicated, you have a form that contains a list 
of names and id, what data types are they contain in? Understand how the list 
box is structured will help to give you a better ans



--
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/9d61cf55-43b1-a7ac-2a87-894227cf4b91%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


how to pass the ID of a slected item in a list to ORM

2018-06-15 Thread Gerald Brown
Greetings:

I have a form with a listbox that has people's names and their ID from the 
database.  I am trying to get the ID from that list for the selected person 
so I can use it in ORM statements: I.E. v1 = Visit.objects.filter(person_id 
= ??) where ?? is the ID from the select list.

Has anyone had any experience on how I can accomplish this?

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/12b0da2c-359c-4da2-ac13-9e627a91c12d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Gerald Brown
 In version 2 of Django that function has been removed.

For v 1.10 here is a link that might help: 
https://docs.djangoproject.com/en/1.10/ref/models/instances/#get-absolute-url

Here is another link that might be of help: 
https://stackoverflow.com/questions/13503645/what-is-permalink-and-get-absolute-url-in-django?utm_medium=organic_source=google_rich_qa_campaign=google_rich_qa

Hope this helps.

BTW the first link says V1.10 is obsolete and is no longer supported!!!

-- 
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/1c0b4b32-7154-4dd4-b437-92d0bba6c70e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: python manage.py (anything) NOT WORKING ANYMORE

2018-06-04 Thread Gerald Brown


On Monday, June 4, 2018 at 6:58:39 PM UTC+8, Gerald Brown wrote:
>
> I have been using ./manage.py shell for awhile and now all of a sudden it 
> has stopped working with the error "AttributeError: 'property' object has 
> no attribute '__dict__'".  I get the same error with anything I enter after 
> the ./manage.py (i.e. runserver, dbshell, etc)
>
> I think it might have to do with something I added to my requirements.txt 
> file.
>
> Does anyone know of a way other than committing out the requirements.txt 
> one-by-one on how to solve this problem?
>

By the way it is running in a pyvenvwrapper virtual environment .

>
> 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/b0b8631b-990b-4123-bc14-e10cf9b1406a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


python manage.py (anything) NOT WORKING ANYMORE

2018-06-04 Thread Gerald Brown
I have been using ./manage.py shell for awhile and now all of a sudden it 
has stopped working with the error "AttributeError: 'property' object has 
no attribute '__dict__'".  I get the same error with anything I enter after 
the ./manage.py (i.e. runserver, dbshell, etc)

I think it might have to do with something I added to my requirements.txt 
file.

Does anyone know of a way other than committing out the requirements.txt 
one-by-one on how to solve this problem?

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/dc220707-4c2a-46bd-a7d4-622cec1aec83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError : cannot import name include

2018-05-18 Thread Gerald Brown
Another option to get the current version of Django is to create a file 
called requirements.txt.  In this file enter django on a line, and other 
requirements on other lines.  You can also specify a specific version 
with django==1.11 or any other version by changing the number after the 
==. If this is left off then the latest version will be installed.  Then 
in your virtual environment enter the command 'pip install -r 
requirements.txt'. This will download and install everything that is in 
the requirements.txt.  This file will grow as you enter more requirements.



On 05/18/2018 10:38 PM, Daniel Hepper wrote:


Your problem is right here:

> django-admin --version 1.11.13

You are using Django 1.11. The documentation you are using refers to a 
newer version of Django, version 2.0.


Use the right documentation for your version of Django:

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

You are seeing this specific error because in Django 2.0, you can 
write "from django.urls import include", while in Django 1.11, you 
have to write "from django.conf.urls import include".


Note that using Debian packages, you won't get the latest version of 
Django (or any other Python packages). You might want to consider 
installing the latest version with pip.


https://docs.djangoproject.com/en/2.0/topics/install/#installing-official-release

Hope that helps,
Daniel

On Fri, May 18, 2018 at 4:20 PM, Journal-Immo 
> wrote:


Thank

But (I use debian 9)

Apt-get update

Apt-get install python python3 python-django

django-admin --version 1.11.13

Where is the problem ?


Le 17/05/2018 à 21:01, Fidel Leon a écrit :

You are using the wrong combination of Django and tutorial:
“include” is available in Django 2 and up, but you’re using
Django 1.11.

Fidel Leon
fi...@flm.cat 
Phone: +34 622 26 44 92 
GPG: 2585 30C2 E3C7 7151 0864  946B 7423 F94B 5753 5FC7

El 17 de mayo de 2018 a las 20:56:56, Tristan Demot
(cont...@journal-immo.com )
escribió:


Hello,

 I use docs.djangoproject.co/en/2.0

 Python 2 7 13
Gjango 1.11.13


Creating the Polls app OK


Write your first view OK

But python manage runserver don't work
With : python -Wall manage.py test
ImportError : cannot import name include
If you want to see something, ask me
Many 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/1fe7df04-dc85-4a3d-940e-4dde7de31477%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/CAHXg%3DN090U8JCFfdvZJWH1qSoWQgp2mQH6z2RfCzj3384epQKQ%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 

Re: Problem with debug = True/False

2018-05-18 Thread Gerald Brown
My site now looks the same in Development and Production.  I think why this 
is happening is that I ran ./manage.py collectstatic awhile ago,  So if you 
are getting weird formatting when DEBUG = False try running ./manage.py 
collectstatic and see if that solves your problem!!!

On Friday, May 11, 2018 at 9:09:03 AM UTC+8, Gerald Brown wrote:
>
> On my admin site if I have Debug set to true (I have read that for 
> production this is a no-no) everything looks fine.  When I change it to 
> FALSE all of the styling goes away as if it is being run using gunicorn.
>
> Has anyone observed this?  If so have you found a correction?
>
> 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/4546359f-2828-4833-b55b-9a48437a65d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Standard approach

2018-05-15 Thread Gerald Brown
>From what little I have read, it looks like 
https://groups.google.com/forum/#!topic/pinax-users/OvB4sB87Nr4 is trying 
to do what you are suggesting here.

On Wednesday, May 16, 2018 at 7:53:58 AM UTC+8, Mike Dewhirst wrote:
>
> This list gets a lot of new people joining. They come from all cultures 
> and degrees of general competence. And list members have always made 
> them welcome and try to help as much as possible. 
>
> I would say to beginners - without thinking too hard - that the best 
> place to begin is the excellent Django documentation.  Read "Getting 
> started" https://docs.djangoproject.com/en/1.11/intro/ followed by "What 
> to read next" https://docs.djangoproject.com/en/1.11/intro/whatsnext/ 
>
> However, there are many non-native-english speakers who find reading any 
> documentation just one extra hurdle instead of an open gate. When I see 
> such a request for help in getting started I admire the courage displayed. 
>
> Maybe we need more than a standardised docs approach. Perhaps a wiki 
> would help to display stable advice for different groups of beginners. 
> There have been some particularly illuminating threads in this list 
> revealing the merits of different beginner approaches. The Django blog 
> might be a permanent location for such threads. Maybe there already is a 
> spot for accumulated beginner wisdom? 
>
> There are lots of other resources and recent beginners are probably the 
> most competent to advise. 
>
> I really don't know because I don't have much of a problem reading docs. 
> And it is a while since I was a beginner. 
>
> Just thinking about this, the tutorial project might be valuable as a 
> real project frozen at a seriously simple level so that beginners can 
> browse the source and read the docstrings and comments. A  comment in 
> code might also carry a link to the documentation. Beginners who have 
> trouble with documentation should still be able to figure out the actual 
> code. 
>
> 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/40302159-c407-4496-af36-41d86dcd2fb1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Message from a django beginner user

2018-05-15 Thread Gerald Brown
The best way to learn it is o jump in and start using it.  Django has a 
good tutorial on-line @ 
https://docs.djangoproject.com/en/2.0/intro/tutorial01/.  When you have 
problems Google and this Group are your friends.


Goo luck.


On 05/16/2018 01:39 AM, Francis F. Massaquoi, Jr. wrote:
Hi, I'm Francis F. Massaquoi, Jr. with great interest in learning 
django 2.0, which is the latest version, I have been searching on 
youtube for a channel that have the latest version tutorial, I have 
not really find one, can someone please help me with a pdf or website, 
where I can learn django to the best, I have been reading some pdf, I 
have the basic knowledge, but I need to advance my knowledge. Or if 
you can connect with me on skype, this is my skype username: 
francisfmassaquoijr, or if you have a skype group, you can please add 
me, or give me your skype username...


Your urgent response will highly be appreciated.

Thanks to the admin for accepting me..

We do it the django way, because it's the best way to web app 
development.

--
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/e22ff629-023d-41dc-bb08-7d0d0f87fd42%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/24c2685c-376f-d895-b51b-2447bbf77903%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


SQL select statements to Django ORM

2018-05-12 Thread Gerald Brown
As I have said previously, I am new to Django ORM so I would like to know 
howto/find reference to Django ORM Query to the following SQL Select 
statements:

1. From Mariadb. 

SELECT name, date_of_birth, *TIMESTAMPDIFF(YEAR,date_of_birth,'2014-08-02'/or 
curdate())* AS age FROM some table.

2. General SQL statement
SELECT field1, field2, field10 from some table

3. How to see all of the data from those statements which SQL shows me. 

I have read (several times) the documentation @ 
https://docs.djangoproject.com/en/2.0/topics/db/queries/. They show numerous 
examples of Queries but none of them show the results from those queries.

When I do get results to show ONLY the fields that are in my __str__ statement 
show up. If I add additional fields they also
show up in my FK list, which I don't want.

Thanks for all previous help from this group.

-- 
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/a3522074-a3d5-4d8a-b905-df06b14be753%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Queries

2018-05-12 Thread Gerald Brown
I was getting the same as you are as I had just first_name & last_name 
set in the "def __str__(self)".  I added a couple of more fields to that 
statement but they are still not showing up even after running a 
makemigration which says "No Change"


I tried "p.address" but it gave me an error message, (which I don't 
remember) as I did not know about the "[]"s.  Now if I do 
"p.[0].address" it gives me the address. Also if I do "p[0].town" it 
show me the town name, which is in another table and is a FK to that table.


Like I said in my original message, I am just starting to use Django 
Queries so there is a lot to learn so I thank you for your assistance.



On Saturday, 12 May, 2018 01:34 PM, Mark Phillips wrote:
Please provide the exact output you are seeing. It may be that the 
output has been truncated, which is correct behavior.


For example, when I run this query on the command line for my model 
Document,


>>> Document.objects.all()
, , 
, ]>


I get a QuerySet with 4 entries, as there are 4 rows/records in the 
Document table. All the fields are there, just not shown. The __str__ 
method in the Document model returns the title of the document, which 
is what is shown above for each Document in the QuerySet. I am 
guessing but your People table probably defines the __str__ method to 
return the first and last name.


I can look at one of the returned rows like this:

>>> d=Document.objects.all()
>>> d[0]

>>> d[0].document_id
2
>>> d[0].title
'a new title 2'
>>> d[0].description
'a new description 2'
>>> d[0].document_state
1
>>> d[0].storage_file_name

>>>

title, document_id, description, and storage_file_name are all fields 
defined in the model for Document (along with others).


Read the django documentation about models and queries for more 
information.


Mark

On Fri, May 11, 2018 at 9:34 PM, Joseph Mutumi <jjmut...@gmail.com 
<mailto:jjmut...@gmail.com>> wrote:


Hello,

That's strange what does your people model look like? Notice it
will only populate the fields you have defined in the model not
the columns of the table in the database.

Did you run migrations after adding new fields to the model?
$ python manage.py migrate

Kind regards

On Sat, May 12, 2018 at 5:15 AM, Gerald Brown <gsbrow...@gmail.com
<mailto:gsbrow...@gmail.com>> wrote:

Greetings:

I have just started to use Django Queries and I am having some
problems.

When i use the query: "p = People.objects.all()" & then "p" it
shows just the lastname & firstname fields even though there
are many more fields in the table.

I thought ALL means ALL, ALL fields & ALL records!!!

Only 2 records so far in the DB and it shows both of them so
ALL RECORDS is working.

Another table I have has a date field and a ForeignKey to the
people table plus some additional fields.  The query returns
the date and the firstname and lastname from the people table
ONLY.

It looks like it is only showing the first two fields in the
table.

Any ideas on how I can get it to show ALL fields?

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
<mailto:django-users%2bunsubscr...@googlegroups.com>.
To post to this group, send email to
django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at
https://groups.google.com/group/django-users
<https://groups.google.com/group/django-users>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/7e90ad4d-bffe-5690-2559-ec4655fc79b6%40gmail.com

<https://groups.google.com/d/msgid/django-users/7e90ad4d-bffe-5690-2559-ec4655fc79b6%40gmail.com>.
For more options, visit https://groups.google.com/d/optout
<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
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users
<https://groups.google.com/group/django-users>.
To view this discussion

Re: Django Queries

2018-05-11 Thread Gerald Brown

Thanks for your reply.

My model consists of the following:

id, first_name, last_name, middle_initial, contact_num, address, town(FK 
to Town table), date_of_birth, occupation(FK to Occupation table), email 
& gender. The Django query returns ONLY first_name & last_name.


I run migrations after any changes to any models. The database has the 
same fields that are shown.


BTW, the query is being run after running ./manage.py shell.


On Saturday, 12 May, 2018 12:34 PM, Joseph Mutumi wrote:

Hello,

That's strange what does your people model look like? Notice it
will only populate the fields you have defined in the model not
the columns of the table in the database.

Did you run migrations after adding new fields to the model?
$ python manage.py migrate

Kind regards

On Sat, May 12, 2018 at 5:15 AM, Gerald Brown <gsbrow...@gmail.com 
<mailto:gsbrow...@gmail.com>> wrote:


Greetings:

I have just started to use Django Queries and I am having some
problems.

When i use the query: "p = People.objects.all()" & then "p" it
shows just the lastname & firstname fields even though there are
many more fields in the table.

I thought ALL means ALL, ALL fields & ALL records!!!

Only 2 records so far in the DB and it shows both of them so ALL
RECORDS is working.

Another table I have has a date field and a ForeignKey to the
people table plus some additional fields.  The query returns the
date and the firstname and lastname from the people table ONLY.

It looks like it is only showing the first two fields in the table.

Any ideas on how I can get it to show ALL fields?

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
<mailto:django-users%2bunsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users
<https://groups.google.com/group/django-users>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/7e90ad4d-bffe-5690-2559-ec4655fc79b6%40gmail.com

<https://groups.google.com/d/msgid/django-users/7e90ad4d-bffe-5690-2559-ec4655fc79b6%40gmail.com>.
For more options, visit https://groups.google.com/d/optout
<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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/CAN5idp8%2B4gx6_MOoXT-JAsbq4nbZLAZj%3DTL8MDMd%2Bg_oQwip2A%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CAN5idp8%2B4gx6_MOoXT-JAsbq4nbZLAZj%3DTL8MDMd%2Bg_oQwip2A%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/8344fa0b-9420-7d83-56ea-df30f54f6b87%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django Queries

2018-05-11 Thread Gerald Brown

Greetings:

I have just started to use Django Queries and I am having some problems.

When i use the query: "p = People.objects.all()" & then "p" it shows 
just the lastname & firstname fields even though there are many more 
fields in the table.


I thought ALL means ALL, ALL fields & ALL records!!!

Only 2 records so far in the DB and it shows both of them so ALL RECORDS 
is working.


Another table I have has a date field and a ForeignKey to the people 
table plus some additional fields.  The query returns the date and the 
firstname and lastname from the people table ONLY.


It looks like it is only showing the first two fields in the table.

Any ideas on how I can get it to show ALL fields?

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/7e90ad4d-bffe-5690-2559-ec4655fc79b6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with debug = True/False

2018-05-11 Thread Gerald Brown
Thanks for the info. I will check it out.  I am still in development so 
it will be awhile before I need it.



On Friday, 11 May, 2018 09:06 PM, James Farris wrote:
I also recommend going through the deploy checklist. I ran into the 
same problem and then other problems after that because I didn’t 
follow this.


https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/

Sent from my mobile device

On May 10, 2018, at 10:53 PM, Andréas Kühne 
<andreas.ku...@hypercode.se <mailto:andreas.ku...@hypercode.se>> wrote:



Hi,

That is the way it should be if you look in the documentation:
https://docs.djangoproject.com/en/2.0/howto/static-files/

Serving the files

In addition to these configuration steps, you’ll also need to 
actually serve the static files.


During development, if you use|django.contrib.staticfiles| 
<https://docs.djangoproject.com/en/2.0/ref/contrib/staticfiles/#module-django.contrib.staticfiles>, 
this will be done automatically by|runserver| 
<https://docs.djangoproject.com/en/2.0/ref/django-admin/#django-admin-runserver>when|DEBUG| 
<https://docs.djangoproject.com/en/2.0/ref/settings/#std:setting-DEBUG>is 
set to|True|(see|django.contrib.staticfiles.views.serve()| 
<https://docs.djangoproject.com/en/2.0/ref/contrib/staticfiles/#django.contrib.staticfiles.views.serve>).


This method is*grossly inefficient*and probably*insecure*, so it 
is*unsuitable for production*.


SeeDeploying static files 
<https://docs.djangoproject.com/en/2.0/howto/static-files/deployment/>for 
proper strategies to serve static files in production environments.



So it is exactly like gunicorn - because you need to serve your 
static files from a webbserver instead of from django itself.


That's why it is failing.

What you could do (although I don't recommend it) - it to manually 
add the static files serving to your urls.py file. See:

https://docs.djangoproject.com/en/2.0/howto/static-files/#serving-static-files-during-development

This should be fine for a developer environment - but nothing else.

Regards,

Andréas

2018-05-11 3:09 GMT+02:00 Gerald Brown <gsbrow...@gmail.com 
<mailto:gsbrow...@gmail.com>>:


On my admin site if I have Debug set to true (I have read that
for production this is a no-no) everything looks fine.  When I
change it to FALSE all of the styling goes away as if it is being
run using gunicorn.

Has anyone observed this?  If so have you found a correction?

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
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to
django-users@googlegroups.com <mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users
<https://groups.google.com/group/django-users>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/2fb3aff8-40ec-464e-81e1-766cf08db433%40googlegroups.com

<https://groups.google.com/d/msgid/django-users/2fb3aff8-40ec-464e-81e1-766cf08db433%40googlegroups.com?utm_medium=email_source=footer>.
For more options, visit https://groups.google.com/d/optout
<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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/CAK4qSCckZWh8hYJ6HQX-RvOAssSDmP4WCSFbh%2BGcty38GHay%2BQ%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CAK4qSCckZWh8hYJ6HQX-RvOAssSDmP4WCSFbh%2BGcty38GHay%2BQ%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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/5958579F-09A0-414D-8A21-E4690829545F%40gmail.com 
<https://grou

Re: Problem with debug = True/False

2018-05-11 Thread Gerald Brown
Thanks for the info. I will check it out.  I am still in development so 
it will be awhile before I need it.



On Friday, 11 May, 2018 01:53 PM, Andréas Kühne wrote:

Hi,

That is the way it should be if you look in the documentation:
https://docs.djangoproject.com/en/2.0/howto/static-files/

Serving the files

In addition to these configuration steps, you’ll also need to actually 
serve the static files.


During development, if you use|django.contrib.staticfiles| 
<https://docs.djangoproject.com/en/2.0/ref/contrib/staticfiles/#module-django.contrib.staticfiles>, 
this will be done automatically by|runserver| 
<https://docs.djangoproject.com/en/2.0/ref/django-admin/#django-admin-runserver>when|DEBUG| 
<https://docs.djangoproject.com/en/2.0/ref/settings/#std:setting-DEBUG>is 
set to|True|(see|django.contrib.staticfiles.views.serve()| 
<https://docs.djangoproject.com/en/2.0/ref/contrib/staticfiles/#django.contrib.staticfiles.views.serve>).


This method is*grossly inefficient*and probably*insecure*, so it 
is*unsuitable for production*.


SeeDeploying static files 
<https://docs.djangoproject.com/en/2.0/howto/static-files/deployment/>for 
proper strategies to serve static files in production environments.



So it is exactly like gunicorn - because you need to serve your static 
files from a webbserver instead of from django itself.


That's why it is failing.

What you could do (although I don't recommend it) - it to manually add 
the static files serving to your urls.py file. See:

https://docs.djangoproject.com/en/2.0/howto/static-files/#serving-static-files-during-development

This should be fine for a developer environment - but nothing else.

Regards,

Andréas

2018-05-11 3:09 GMT+02:00 Gerald Brown <gsbrow...@gmail.com 
<mailto:gsbrow...@gmail.com>>:


On my admin site if I have Debug set to true (I have read that for
production this is a no-no) everything looks fine. When I change
it to FALSE all of the styling goes away as if it is being run
using gunicorn.

Has anyone observed this?  If so have you found a correction?

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
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users
<https://groups.google.com/group/django-users>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/2fb3aff8-40ec-464e-81e1-766cf08db433%40googlegroups.com

<https://groups.google.com/d/msgid/django-users/2fb3aff8-40ec-464e-81e1-766cf08db433%40googlegroups.com?utm_medium=email_source=footer>.
For more options, visit https://groups.google.com/d/optout
<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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/CAK4qSCckZWh8hYJ6HQX-RvOAssSDmP4WCSFbh%2BGcty38GHay%2BQ%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CAK4qSCckZWh8hYJ6HQX-RvOAssSDmP4WCSFbh%2BGcty38GHay%2BQ%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/03ccfc31-0e17-5d70-c1bf-ef379cd2c033%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Problem with debug = True/False

2018-05-10 Thread Gerald Brown
On my admin site if I have Debug set to true (I have read that for 
production this is a no-no) everything looks fine.  When I change it to 
FALSE all of the styling goes away as if it is being run using gunicorn.

Has anyone observed this?  If so have you found a correction?

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/2fb3aff8-40ec-464e-81e1-766cf08db433%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting error in migrate

2018-05-09 Thread Gerald Brown
Some times you will need to run ./manage.py makemigrations  
and then ./manage.py migrate .


By including the  it will only makemigration and migrate for a 
single application instead of for all of the applications.


I have found that this helps as I too was having problems with 
makemigration and migrate.


Also I found it is shorter to leave off the python and use ./manage.py 
.  Saves a few keystrokes.


On Thursday, 10 May, 2018 10:04 AM, Mansi Thakkar wrote:
Yes I did the same thing. I run python manage.py makemigrations first 
and then python manage.py migrate.


On Wed, May 9, 2018 at 3:23 PM, James Farris > wrote:


To be absolutely clear, you need to make sure if you made changes
to models.py you need to run
$ python manage.py makemigrations
Then
$ python manage.py migrate

-James

Sent from my mobile device

> On May 9, 2018, at 11:26 AM, Pradeep Sharma
>
wrote:
>
> Did u run the command of py manage.py makemigrations?
>
> --
> 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/030d5c70-d65a-4707-ba4d-669b7317713c%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/A5C5B522-C495-4D7E-8D73-3419F86671A5%40gmail.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/CAD4jYPBKt%2BAQ-tZt6Fqo_s8v7ym3S81_hxqtfeNsSLOH8viu7A%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/da97c3c7-69ee-ae12-b12c-2b73d63ef6a4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django makemigrations not working

2018-05-05 Thread Gerald Brown
I tried that too but it kept giving an error about Key constraints. That 
is why I dropped the whole database and then recreated it.  Will just 
have to look in to it more.


Thanks for your reply.

/Who knows what evil lurks in the heart and mind of the computer? *The 
Shadow knows...*/



On Saturday, 05 May, 2018 08:49 PM, Zhenning Lang wrote:
Maybe the contents of table “django_migrations" in you database should 
also be removed. I am not quite sure about it



在 2018年5月5日,下午6:34,Gerald Brown <gsbrow...@gmail.com 
<mailto:gsbrow...@gmail.com>> 写道:


I have dropped my database, deleted all migrations directories and 
when I run ./manage.py makemigrations I get the message "No changes 
detected".


I am using Django 2.04 with Python 3.5.

Any ideas why this is happening?

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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/242350cd-a497-4b24-9a0a-728a9b0ae142%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/242350cd-a497-4b24-9a0a-728a9b0ae142%40googlegroups.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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/485B5D48-F693-47EC-A29B-4635ACCBCF46%40sensedeal.ai 
<https://groups.google.com/d/msgid/django-users/485B5D48-F693-47EC-A29B-4635ACCBCF46%40sensedeal.ai?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/0d6afa5e-aff1-3107-eced-bb811d693338%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django makemigrations not working

2018-05-05 Thread Gerald Brown

Yes. I dropped it and then recreated it.

Then ran "makemigrations" & "migrate". Migrate is now giving me a lot of 
errors.


Funny that all of the errors that show up are in lines that contain 
"**/site-packages/django/**", NOT in any lines of MY code.



On Saturday, 05 May, 2018 09:17 PM, Hervé Edorh wrote:

Do you create another 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 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/ef21c56d-4eb3-bc76-2769-d832c9a5a11c%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


django makemigrations not working

2018-05-05 Thread Gerald Brown
I have dropped my database, deleted all migrations directories and when I 
run ./manage.py makemigrations I get the message "No changes detected".

I am using Django 2.04 with Python 3.5.

Any ideas why this is happening?

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/242350cd-a497-4b24-9a0a-728a9b0ae142%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: OperationalError

2018-05-03 Thread Gerald Brown

Thanks for the reply.  Will check it out.  Just printed the documentation.


On Friday, 04 May, 2018 03:08 AM, 'Anthony Flury' via Django users wrote:

Django 2.0 docs suggest using reportlab :

https://docs.djangoproject.com/en/2.0/howto/outputting-pdf/

I had some success with : pupeteer - 
http://django-puppeteer-pdf.readthedocs.io/en/latest/ - which works by 
having a CBV type framework - so you subclass a PDF template view - 
and that will autogenerate a PDF for you - you just need to have 
unique urls for the PDFs.




On 03/05/18 13:22, Gerald Brown wrote:


FINALLY. SUCCESS!!! What I ended up doing to correct the problem was 
to drop the whole database (NO RECORDS YET). When I tried to run 
migrations it said there were no changes.  I then had to run 
makemigrations  and migrate  so I am now back 
in business!!!


Now does anyone know of an *easy* way to create PDF documents in 
Django???


Thanks to all for the suggestions and ideas!!!

On Thursday, May 3, 2018 at 6:13:35 PM UTC+8, Gerald Brown wrote:

    I finally discovered what I think is the cause of my problem.
    *DJANGO MIGRATIONS ARE NOT WORKING.*On the system that has the
    problem is where I made migration to change some of the field
    names.  The fields that were not found where the ones that did get
    changed but the old unchanged names were still there.  On another
    system that is working NONE of the fields names were changed so it
    didn't have any unknown fields. Both systems had migrations run
    against the model file where some fields had changes made and the
    other one NO changes were made and on a third machine all changes
    were made.

    /Who knows what evil lurks in the heart of the computer? *The
    Shadow knows!!!* /


    On Wednesday, 02 May, 2018 07:56 AM, Gerald Brown wrote:

    I have a Django application that I am having problems with.  In
    the Admin page I have 3 sections, ABC, DEF & XYZ. Each has 1
    option to "Add/Change".  In 2 of them when I click on the option
    it works fine. The third gives me the following error "
    *1054, "Unknown column 'xyz_xyz.first_name' in "field list" *The
    Exception location is:
*/home/medrec1/.virtualenvs/medrecproj/lib/python3.5/site-packages/*MySQLdb*/connections.py
    in query, line 277* On another system (both running the same
    code) I was also getting a different error also in
    *site-packages/MySQLdb* but I was able correct that by installing
    2 DEV packages and then  installing MySQLClient, which I also 
did on this computer.  The other

    system does NOT give this error.

    Any ideas, suggestions, solutions on how to solve this error and 
any other errors in the Django code?


    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
    <mailto:django-users+unsubscr...@googlegroups.com>.
    To post to this group, send email to
    django-users@googlegroups.com 
<mailto:django-users@googlegroups.com>.

    Visit this group at https://groups.google.com/group/django-users
    <https://groups.google.com/group/django-users>.
    To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/74790172-8bf5-43b6-9bad-bab68ae11a4a%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/74790172-8bf5-43b6-9bad-bab68ae11a4a%40googlegroups.com?utm_medium=email_source=footer>.
    For more options, visit https://groups.google.com/d/optout
    <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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/e17d8d56-d57c-4f3d-ae6f-a004a5beda70%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/e17d8d56-d57c-4f3d-ae6f-a004a5beda70%40googlegroups.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

Re: OperationalError

2018-05-03 Thread Gerald Brown

FINALLY. SUCCESS!!! What I ended up doing to correct the problem was to 
drop the whole database (NO RECORDS YET). When I tried to run migrations it 
said there were no changes.  I then had to run makemigrations  
and migrate  so I am now back in business!!!

Now does anyone know of an *easy* way to create PDF documents in Django???

Thanks to all for the suggestions and ideas!!!

On Thursday, May 3, 2018 at 6:13:35 PM UTC+8, Gerald Brown wrote:
>
> I finally discovered what I think is the cause of my problem. *DJANGO 
> MIGRATIONS ARE NOT WORKING. *On the system that has the problem is where 
> I made migration to change some of the field names.  The fields that were 
> not found where the ones that did get changed but the old unchanged names 
> were still there.  On another system that is working NONE of the fields 
> names were changed so it didn't have any unknown fields. Both systems had 
> migrations run against the model file where some fields had changes made 
> and the other one NO changes were made and on a third machine all changes 
> were made.
>
> *Who knows what evil lurks in the heart of the computer? The Shadow 
> knows!!! *
>
> On Wednesday, 02 May, 2018 07:56 AM, Gerald Brown wrote:
>
> I have a Django application that I am having problems with.  In the Admin 
> page I have 3 sections, ABC, DEF & XYZ. Each has 1 option to "Add/Change".  
> In 2 of them when I click on the option it works fine. The third gives me 
> the following error "
>
> *1054, "Unknown column 'xyz_xyz.first_name' in "field list"
>
> *The Exception location is: 
> */home/medrec1/.virtualenvs/medrecproj/lib/python3.5/site-packages/*MySQLdb*/connections.py
>  in query, 
> line 277*
> On another system (both running the same code) I was also getting a different 
> error also in *site-packages/MySQLdb* but I was
> able correct that by installing 2 DEV packages and then installing 
> MySQLClient, which I also did on this computer.  The other
> system does NOT give this error.
>
> Any ideas, suggestions, solutions on how to solve this error and any other 
> errors in the Django code?
>
> 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/74790172-8bf5-43b6-9bad-bab68ae11a4a%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/74790172-8bf5-43b6-9bad-bab68ae11a4a%40googlegroups.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/e17d8d56-d57c-4f3d-ae6f-a004a5beda70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: OperationalError

2018-05-03 Thread Gerald Brown
I finally discovered what I think is the cause of my problem. *DJANGO 
MIGRATIONS ARE NOT WORKING.*On the system that has the problem is where 
I made migration to change some of the field names.  The fields that 
were not found where the ones that did get changed but the old unchanged 
names were still there.  On another system that is working NONE of the 
fields names were changed so it didn't have any unknown fields. Both 
systems had migrations run against the model file where some fields had 
changes made and the other one NO changes were made and on a third 
machine all changes were made.


/Who knows what evil lurks in the heart of the computer? *The Shadow 
knows!!!* /



On Wednesday, 02 May, 2018 07:56 AM, Gerald Brown wrote:
I have a Django application that I am having problems with.  In the 
Admin page I have 3 sections, ABC, DEF & XYZ. Each has 1 option to 
"Add/Change".  In 2 of them when I click on the option it works fine. 
The third gives me the following error "
*1054, "Unknown column 'xyz_xyz.first_name' in "field list" *The 
Exception location is: 
*/home/medrec1/.virtualenvs/medrecproj/lib/python3.5/site-packages/*MySQLdb*/connections.py 
in query, line 277* On another system (both running the same code) I 
was also getting a different error also in *site-packages/MySQLdb* but 
I was able correct that by installing 2 DEV packages and then  installing MySQLClient, which I also did on this computer.  The other

system does NOT give this error.

Any ideas, suggestions, solutions on how to solve this error and any other 
errors in the Django code?

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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/74790172-8bf5-43b6-9bad-bab68ae11a4a%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/74790172-8bf5-43b6-9bad-bab68ae11a4a%40googlegroups.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/43790a35-4c51-ff0e-09c0-2fbcdad6c9f1%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need help: django-admin.py startproject [projectname] creates directory which I cannot access

2018-05-03 Thread Gerald Brown
Is Django installed on your C: or D: drive?  If it is on C: then 
"mysite" should also be on C:



On Thursday, 03 May, 2018 03:25 PM, Daisy wrote:

I tried what you suggested and got this:
D:\projectdir>python create_dir.py
Traceback (most recent call last):
  File "create_dir.py", line 1, in 
    from os import mkdirs
ImportError: cannot import name 'mkdirs'

среда, 02. мај 2018. 23.13.29 UTC+2, Daisy је написао/ла:

I installed django according to provided instructions and I am
trying to follow the Django article: Writing your first Django
app, part 1
 but I am
stuck at Creating a project with command: django-admin
startproject mysite.
The problem is that I CAN execute command but when I try to access
directory with cd mysite I get the message "The system cannot find
the path specified." although when I try to execute command
startproject again I get the message that it already exists. (see
attachment)
I cannot find new directory via windows explorer neither.
I have installed django 2.0.5 version and python 3.6.3 (32-bit).

--
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/58e5b0ab-46c5-46fe-a346-28d1f43619e7%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/afa3504d-38a9-b56b-fbc7-353c14d698d4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: OperationalError

2018-05-03 Thread Gerald Brown
Been there. Done that. Many times!!!  Still can't find the field list 
that it is complaining about.


What is really weird is that the same code runs on 2 other computers 
without any errors.



On Wednesday, 02 May, 2018 09:16 PM, Matthew Pava wrote:


“>>>>random letters & numbers”

That looks like merge conflicts with Git.  You’ll want to fix those 
up, not just by deleting those lines, but by verifying the code does 
what you want it to.


You may want to just delete all of your migrations files and start 
anew if they’re not important to you.


*From:*django-users@googlegroups.com 
[mailto:django-users@googlegroups.com] *On Behalf Of *Gerald Brown

*Sent:* Wednesday, May 2, 2018 4:08 AM
*To:* Anthony Flury; django-users@googlegroups.com
*Subject:* Re: OperationalError

Thanks for the reply.

I have done the makemigrations/migrate numerous times.  Each time it 
says there is an error in the previous migration file so I have to 
comment out most of the file.  I then just deleted all of the self 
generated migration files and started fresh.


I was also getting some weird characters in my files like ">>>>random 
letters & numbers.  I deleted all of those & ran the migrations again.


The weird thing is that now when I click on the link it says "unknown 
column telephone in field list", previously it was first_name that was 
unknown.


I have this application running on a "similar" computer and it has 
*NO* problems with this area so maybe there are some other 
applications running that cause the problem even though this one is in 
a virtualenv.


On Wednesday, 02 May, 2018 03:00 PM, Anthony Flury wrote:

At first glance it looks like you haven't applied a migration to
this computer.

at the command line on this computer  - in the man project
directory :

If you have not copied the migration scripts from your development
machine do this first :

   $ python manage.py makemigrations

and then do this :

   $ python manage.py migrate

--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/5499b870-33e8-52db-85e2-df835be17e87%40gmail.com 
<https://groups.google.com/d/msgid/django-users/5499b870-33e8-52db-85e2-df835be17e87%40gmail.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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/21802186cf2749e6b6e191e8fc78ce26%40ISS1.ISS.LOCAL 
<https://groups.google.com/d/msgid/django-users/21802186cf2749e6b6e191e8fc78ce26%40ISS1.ISS.LOCAL?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/9ad1a0d3-9243-a539-e584-b9f1fcb78962%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: need help

2018-05-02 Thread Gerald Brown
Have you tried "pip install django" without the "== 2.0.5". I think that 
if you do not specify a version pip will install the latest version.



On Thursday, 03 May, 2018 12:46 AM, umarkamb...@gmail.com wrote:
please  this is the massage i keep on getting when trying to install 
django.. what do i do?



C:\Users\Admin>pip install Django==2.0.5
Collecting Django==2.0.5
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 
'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): 
Read timed out. (read timeout=15)",)': /simple/django/
  Downloading 
https://files.pythonhosted.org/packages/23/91/2245462e57798e9251de87c88b2b8f996d10ddcb68206a8a020561ef7bd3/Django-2.0.5-py3-none-any.whl 
(7.1MB)
    0% |                                | 10kB 1.2kB/s eta 
1:36:24Exception:

Traceback (most recent call last):
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\pip\_vendor\urllib3\response.py", 
line 302, in _error_catcher

    yield
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\pip\_vendor\urllib3\response.py", 
line 384, in read

    data = self._fp.read(amt)
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", 
line 60, in read

    data = self.__fp.read(amt)
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\http\client.py", 
line 449, in read

    n = self.readinto(b)
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\http\client.py", 
line 493, in readinto

    n = self.fp.readinto(b)
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\socket.py", 
line 586, in readinto

    return self._sock.recv_into(b)
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\ssl.py", 
line 1009, in recv_into

    return self.read(nbytes, buffer)
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\ssl.py", 
line 871, in read

    return self._sslobj.read(len, buffer)
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\ssl.py", 
line 631, in read

    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\pip\basecommand.py", 
line 215, in main

    status = self.run(options, args)
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\pip\commands\install.py", 
line 324, in run

    requirement_set.prepare_files(finder)
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\pip\req\req_set.py", 
line 380, in prepare_files

    ignore_dependencies=self.ignore_dependencies))
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\pip\req\req_set.py", 
line 620, in _prepare_file

    session=self.session, hashes=hashes)
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\pip\download.py", 
line 821, in unpack_url

    hashes=hashes
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\pip\download.py", 
line 659, in unpack_http_url

    hashes)
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\pip\download.py", 
line 882, in _download_http_url

    _download_url(resp, link, content_file, hashes)
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\pip\download.py", 
line 603, in _download_url

    hashes.check_against_chunks(downloaded_chunks)
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\pip\utils\hashes.py", 
line 46, in check_against_chunks

    for chunk in chunks:
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\pip\download.py", 
line 571, in written_chunks

    for chunk in chunks:
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\pip\utils\ui.py", 
line 139, in iter

    for x in it:
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\pip\download.py", 
line 560, in resp_read

    decode_content=False):
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\pip\_vendor\urllib3\response.py", 
line 436, in stream

    data = self.read(amt=amt, decode_content=decode_content)
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\pip\_vendor\urllib3\response.py", 
line 401, in read

    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
  File 
"c:\users\admin\appdata\local\programs\python\python36-32\lib\contextlib.py", 
line 99, in __exit__

    self.gen.throw(type, value, traceback)
  File 

Re: DJANGO Migrations from older version : South db

2018-05-02 Thread Gerald Brown
If you have the original models.py files just run "python manage.py 
makemigrations" and then "python manage.py migrate".



On Wednesday, 02 May, 2018 05:11 PM, Ank wrote:

Dear All,

I would like to do some migrations that are compatible with older 
django version using southdb to the newer version. How can these files 
be updated.iḿ attaching one of the file that is needed to be migrated.


Any help will be appreciated

 Best
Ank
--
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/043a69c6-4ea9-48b8-9b42-b088e02ddd37%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/b35c7fd6-6af9-fe90-fdad-f2220f968363%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: OperationalError

2018-05-02 Thread Gerald Brown

Thanks for the reply.

I have done the makemigrations/migrate numerous times.  Each time it 
says there is an error in the previous migration file so I have to 
comment out most of the file.  I then just deleted all of the self 
generated migration files and started fresh.


I was also getting some weird characters in my files like "random 
letters & numbers.  I deleted all of those & ran the migrations again.


The weird thing is that now when I click on the link it says "unknown 
column telephone in field list", previously it was first_namethat was 
unknown.


I have this application running on a "similar" computer and it has *NO* 
problems with this area so maybe there are some other applications 
running that cause the problem even though this one is in a virtualenv.



On Wednesday, 02 May, 2018 03:00 PM, Anthony Flury wrote:
At first glance it looks like you haven't applied a migration to this 
computer.


at the command line on this computer  - in the man project directory :

If you have not copied the migration scripts from your development 
machine do this first :


   $ python manage.py makemigrations

and then do this :

   $ python manage.py migrate



--
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/5499b870-33e8-52db-85e2-df835be17e87%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


OperationalError

2018-05-01 Thread Gerald Brown
I have a Django application that I am having problems with.  In the Admin 
page I have 3 sections, ABC, DEF & XYZ. Each has 1 option to "Add/Change".  
In 2 of them when I click on the option it works fine. The third gives me 
the following error "



*1054, "Unknown column 'xyz_xyz.first_name' in "field list"*The Exception 
location is: 
*/home/medrec1/.virtualenvs/medrecproj/lib/python3.5/site-packages/*MySQLdb
*/connections.py in query, line 277*

On another system (both running the same code) I was also getting a different 
error also in *site-packages/MySQLdb* but I was
able correct that by installing 2 DEV packages and then installing MySQLClient, 
which I also did on this computer.  The other
system does NOT give this error.

Any ideas, suggestions, solutions on how to solve this error and any other 
errors in the Django code?

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/74790172-8bf5-43b6-9bad-bab68ae11a4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: AttributeError at /admin/login/

2018-05-01 Thread Gerald Brown
Finally solved this problem by installing python3-dev & 
libmysqlclient-dev and then I was able to install mysqlclient.


Case closed!!!


On Tuesday, 01 May, 2018 07:09 PM, Gerald Brown wrote:
As a follow-up with further information.  This error occurs when on 
the Admin login screen I enter the user name and password and then 
click "SUBMIT".


The Exception Location is: 
"/home/medrec2/.virtualenvs/medrecproj/lib/python3.5/site-packages/*mysql*/connector/conversion.py 
in _DATETIME_to_python, line 506".


Is there another db connector I can use to connect to the Mariadb 
database?


On Tuesday, May 1, 2018 at 7:45:47 AM UTC+8, Gerald Brown wrote:

I had replied to Daniel Roseman instead of to the users group as I
am new to this group.

Thanks to Daniel for his response



 Forwarded Message 
Subject:Re: AttributeError at /admin/login/
Date:   Mon, 30 Apr 2018 21:46:35 +0800
From:   Gerald Brown
To: Daniel Roseman




No. You need to show the full traceback.
--
DR.
-- 

Here is the full traceback.  It is quite long.


  AttributeError at /admin/login/

'datetime.datetime' object has no attribute 'split'

Request Method: POST
Request URL:http://192.168.0.122/admin/login/?next=/admin/
<http://192.168.0.122/admin/login/?next=/admin/>
Django Version: 2.0.4
Exception Type: AttributeError
Exception Value:

'datetime.datetime' object has no attribute 'split'

Exception Location:

/home/medrec2/.local/lib/python3.6/site-packages/mysql/connector/conversion.py
in _DATETIME_to_python, line 506
Python Executable:
/home/medrec2/.virtualenvs/medrecproj/bin/python3.6
Python Version: 3.6.5
Python Path:

['/home/medrec2/medrecproj',
  '/home/medrec2/.virtualenvs/medrecproj/bin',
  '/usr/local/lib/python36.zip',
  '/usr/local/lib/python3.6',
  '/usr/local/lib/python3.6/lib-dynload',
  '/home/medrec2/.local/lib/python3.6/site-packages',
  '/usr/local/lib/python3.6/site-packages']

Server time:Sun, 29 Apr 2018 18:31:23 +0800


Traceback Switch to copy-and-paste view
<http://192.168.0.122/admin/login/?next=/admin/#>

  * 
|/home/medrec2/.local/lib/python3.6/site-packages/django/core/handlers/exception.py|
in |inner|
   35.

 response = get_response(request)

...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
  * 
|/home/medrec2/.local/lib/python3.6/site-packages/django/core/handlers/base.py|
in |_get_response|
  128.

 response = self.process_exception_by_middleware(e, 
request)

...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
  * 
|/home/medrec2/.local/lib/python3.6/site-packages/django/core/handlers/base.py|
in |_get_response|
  126.

 response = wrapped_callback(request, 
*callback_args, **callback_kwargs)

...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
  * 
|/home/medrec2/.local/lib/python3.6/site-packages/django/views/decorators/cache.py|
in |_wrapped_view_func|
   44.

 response = view_func(request, *args, **kwargs)

...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
  * 
|/home/medrec2/.local/lib/python3.6/site-packages/django/contrib/admin/sites.py|
in |login|
  398.

 return LoginView.as_view(**defaults)(request)

...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
  * 
|/home/medrec2/.local/lib/python3.6/site-packages/django/views/generic/base.py|
in |view|
   69.

 return self.dispatch(request, *args, **kwargs)

...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
  * 
|/home/medrec2/.local/lib/python3.6/site-packages/django/utils/decorators.py|
in |_wrapper|
   62.

 return bound_func(*args, **kwargs)

...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
  * 
|/home/medrec2/.local/lib/python3.6/site-packages/django/views/decorators/debug.py|
in |sensitive_post_parameters_wrapper|
   76.

 return view(request, *args, **kwargs)

...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
  * 
|/home/medrec2/.local/lib/python3.6/site-packages/django/utils/decorators.py|
in |bound_func|
   58.

 return func.__get__(self, type(self))(*args2, 
**kwargs2)

...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
  * 
|/home/m

Re: Re: AttributeError at /admin/login/

2018-05-01 Thread Gerald Brown
As a follow-up with further information.  This error occurs when on the 
Admin login screen I enter the user name and password and then click 
"SUBMIT".

The Exception Location is: 
"/home/medrec2/.virtualenvs/medrecproj/lib/python3.5/site-packages/mysql/connector/conversion.py
 
in _DATETIME_to_python, line 506".

Is there another db connector I can use to connect to the Mariadb database?

On Tuesday, May 1, 2018 at 7:45:47 AM UTC+8, Gerald Brown wrote:
>
> I had replied to Daniel Roseman instead of to the users group as I am new 
> to this group.
>
> Thanks to Daniel for his response 
>
>
>  Forwarded Message  
> Subject: Re: AttributeError at /admin/login/ 
> Date: Mon, 30 Apr 2018 21:46:35 +0800 
> From: Gerald Brown  
> To: Daniel Roseman  
>
> No. You need to show the full traceback.
> --
> DR. 
> -- 
>
> Here is the full traceback.  It is quite long.
>
> AttributeError at /admin/login/ 
>
> 'datetime.datetime' object has no attribute 'split'
>
> Request Method: POST 
> Request URL: http://192.168.0.122/admin/login/?next=/admin/ 
> Django Version: 2.0.4 
> Exception Type: AttributeError 
> Exception Value: 
>
> 'datetime.datetime' object has no attribute 'split'
>
> Exception Location: 
> /home/medrec2/.local/lib/python3.6/site-packages/mysql/connector/conversion.py
>  
> in _DATETIME_to_python, line 506 
> Python Executable: /home/medrec2/.virtualenvs/medrecproj/bin/python3.6 
> Python Version: 3.6.5 
> Python Path: 
>
> ['/home/medrec2/medrecproj',
>  '/home/medrec2/.virtualenvs/medrecproj/bin',
>  '/usr/local/lib/python36.zip',
>  '/usr/local/lib/python3.6',
>  '/usr/local/lib/python3.6/lib-dynload',
>  '/home/medrec2/.local/lib/python3.6/site-packages',
>  '/usr/local/lib/python3.6/site-packages']
>
> Server time: Sun, 29 Apr 2018 18:31:23 +0800 
> Traceback Switch to copy-and-paste view 
> <http://192.168.0.122/admin/login/?next=/admin/#> 
>
>- 
>
> /home/medrec2/.local/lib/python3.6/site-packages/django/core/handlers/exception.py
>  
>in inner 
>1. 
>   
>   response = get_response(request)
>   
>   ... 
>▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#> 
>- 
>
> /home/medrec2/.local/lib/python3.6/site-packages/django/core/handlers/base.py 
>in _get_response 
>1. 
>   
>   response = self.process_exception_by_middleware(e, 
> request)
>   
>   ... 
>▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#> 
>- 
>
> /home/medrec2/.local/lib/python3.6/site-packages/django/core/handlers/base.py 
>in _get_response 
>1. 
>   
>   response = wrapped_callback(request, *callback_args, 
> **callback_kwargs)
>   
>   ... 
>▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#> 
>- 
>
> /home/medrec2/.local/lib/python3.6/site-packages/django/views/decorators/cache.py
>  
>in _wrapped_view_func 
>1. 
>   
>   response = view_func(request, *args, **kwargs)
>   
>   ... 
>▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#> 
>- 
>
> /home/medrec2/.local/lib/python3.6/site-packages/django/contrib/admin/sites.py
>  
>in login 
>1. 
>   
>   return LoginView.as_view(**defaults)(request)
>   
>   ... 
>▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#> 
>- 
>
> /home/medrec2/.local/lib/python3.6/site-packages/django/views/generic/base.py 
>in view 
>1. 
>   
>   return self.dispatch(request, *args, **kwargs)
>   
>   ... 
>▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#> 
>- 
>
> /home/medrec2/.local/lib/python3.6/site-packages/django/utils/decorators.py 
>in _wrapper 
>1. 
>   
>   return bound_func(*args, **kwargs)
>   
>   ... 
>▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#> 
>- 
>
> /home/medrec2/.local/lib/python3.6/site-packages/django/views/decorators/debug.py
>  
>in sensitive_post_parameters_wrapper 
>1. 
>   
>   return view(request, *args, **kwargs)
>   
>   ... 
>▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#> 
>- 
>
> /home/medrec2/.local/lib/python3.6/site-packages/django/utils/decorators.py 
>in bound_func 
>1. 
>   
>   return func.__get__(self, type(self)

Fwd: Re: AttributeError at /admin/login/

2018-04-30 Thread Gerald Brown
I had replied to Daniel Roseman instead of to the users group as I am 
new to this group.


Thanks to Daniel for his response



 Forwarded Message 
Subject:Re: AttributeError at /admin/login/
Date:   Mon, 30 Apr 2018 21:46:35 +0800
From:   Gerald Brown <gsbrow...@gmail.com>
To: Daniel Roseman <dan...@roseman.org.uk>




No. You need to show the full traceback.
--
DR.
--

Here is the full traceback.  It is quite long.


 AttributeError at /admin/login/

'datetime.datetime' object has no attribute 'split'

Request Method: POST
Request URL:http://192.168.0.122/admin/login/?next=/admin/
Django Version: 2.0.4
Exception Type: AttributeError
Exception Value:

'datetime.datetime' object has no attribute 'split'

Exception Location: 
/home/medrec2/.local/lib/python3.6/site-packages/mysql/connector/conversion.py 
in _DATETIME_to_python, line 506

Python Executable:  /home/medrec2/.virtualenvs/medrecproj/bin/python3.6
Python Version: 3.6.5
Python Path:

['/home/medrec2/medrecproj',
 '/home/medrec2/.virtualenvs/medrecproj/bin',
 '/usr/local/lib/python36.zip',
 '/usr/local/lib/python3.6',
 '/usr/local/lib/python3.6/lib-dynload',
 '/home/medrec2/.local/lib/python3.6/site-packages',
 '/usr/local/lib/python3.6/site-packages']

Server time:Sun, 29 Apr 2018 18:31:23 +0800


   Traceback Switch to copy-and-paste view
   <http://192.168.0.122/admin/login/?next=/admin/#>

 * 
|/home/medrec2/.local/lib/python3.6/site-packages/django/core/handlers/exception.py|
   in |inner|
   35.

response = get_response(request)

   ...
   ▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
 * 
|/home/medrec2/.local/lib/python3.6/site-packages/django/core/handlers/base.py|
   in |_get_response|
  128.

response = self.process_exception_by_middleware(e, 
request)

   ...
   ▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
 * 
|/home/medrec2/.local/lib/python3.6/site-packages/django/core/handlers/base.py|
   in |_get_response|
  126.

response = wrapped_callback(request, *callback_args, 
**callback_kwargs)

   ...
   ▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
 * 
|/home/medrec2/.local/lib/python3.6/site-packages/django/views/decorators/cache.py|
   in |_wrapped_view_func|
   44.

response = view_func(request, *args, **kwargs)

   ...
   ▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
 * 
|/home/medrec2/.local/lib/python3.6/site-packages/django/contrib/admin/sites.py|
   in |login|
  398.

return LoginView.as_view(**defaults)(request)

   ...
   ▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
 * 
|/home/medrec2/.local/lib/python3.6/site-packages/django/views/generic/base.py|
   in |view|
   69.

return self.dispatch(request, *args, **kwargs)

   ...
   ▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
 * |/home/medrec2/.local/lib/python3.6/site-packages/django/utils/decorators.py|
   in |_wrapper|
   62.

return bound_func(*args, **kwargs)

   ...
   ▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
 * 
|/home/medrec2/.local/lib/python3.6/site-packages/django/views/decorators/debug.py|
   in |sensitive_post_parameters_wrapper|
   76.

return view(request, *args, **kwargs)

   ...
   ▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
 * |/home/medrec2/.local/lib/python3.6/site-packages/django/utils/decorators.py|
   in |bound_func|
   58.

return func.__get__(self, type(self))(*args2, **kwargs2)

   ...
   ▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
 * |/home/medrec2/.local/lib/python3.6/site-packages/django/utils/decorators.py|
   in |_wrapper|
   62.

return bound_func(*args, **kwargs)

   ...
   ▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
 * |/home/medrec2/.local/lib/python3.6/site-packages/django/utils/decorators.py|
   in |_wrapped_view|
  142.

response = view_func(request, *args, **kwargs)

   ...
   ▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
 * |/home/medrec2/.local/lib/python3.6/site-packages/django/utils/decorators.py|
   in |bound_func|
   58.

return func.__get__(self, type(self))(*args2, **kwargs2)

   ...
   ▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
 * |/home/medrec2/.local/lib/python3.6/site-packages/django/utils/decorators.py|
   in |_wrapper|
   62.

return bound_func(*args, **kwargs)

   ...
   ▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
 * 
|/home/medrec2/.local/lib/python3.6/site-packages/django/views/decorators/

AttributeError at /admin/login/

2018-04-30 Thread Gerald Brown
I am getting the following error when I TRY to log in to my site
"AttributeError at /admin/login/ 

'datetime.datetime' object has no attribute 'split'"

This looks like a Django bug as it is in the Admin module and is NOT related to 
any of my code.

Does anyone have any idea why this is happening???

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/3928a271-1090-4cf7-b6a0-cd893af16792%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


3 Django errors

2018-04-29 Thread Gerald Brown
I have 3 laptops set up supposedly running the same code but each one gives 
me a different error message. See attached file for an explanation of the 
problems.

Each of the 3 systems are supposedly running the same code.


Thanks for any thoughts, ideas, or *SOLUTIONS* for the listed problems.










-- 
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/4b5d3b92-98b2-40fc-a17a-43b9006f0350%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Problem #1. Laptop #1 is an ASUS with Linux Mint 18.3 on it.
The problem is "ProgrammingError at /admin/doctor/doctor/

Unknown column 'doctor_doctor.first_name' in 'field list'

Request Method: GET
Request URL:http://192.168.0.121/admin/doctor/doctor/
Django Version: 2.0.4
Exception Type: ProgrammingError
Exception Value:

Unknown column 'doctor_doctor.first_name' in 'field list'

Exception Location: 
/home/medrec1/.virtualenvs/medrecproj/lib/python3.5/site-packages/mysql/connector/connection.py
 in _handle_result, line 432"
I have searched all of my files in the app on that machine and was unable to 
find any "field list" with "doctor_doctor.first_name OR even just first_name" 
in them. Tis happens when I click on the Doctors link on the Admin Screen and 
also after I add data in the Django generated form when I click on "SAVE".

Problem #2. Laptop #2 is also an  ASUS running Linux Mint 18.3.
AttributeError at /admin/login/

'datetime.datetime' object has no attribute 'split'

Request Method: POST
Request URL:http://192.168.0.122/admin/login/?next=/admin/
Django Version: 2.0.4
Exception Type: AttributeError
Exception Value:

'datetime.datetime' object has no attribute 'split'

Exception Location: 
/home/medrec2/.local/lib/python3.6/site-packages/mysql/connector/conversion.py 
in _DATETIME_to_python, line 506
 This happens when I log-in to the Admin of the app. None of my code is 
involved.

Problem #3. Laptop #3 is a HP running Ubuntu 18.04.
Unable to connect

Firefox can’t establish a connection to the server at 192.168.0.119.

This is probably  an error in my code as I was getting this error before.  I 
have been following the code from: 
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04

Any thoughts, ideas or solutions to any or all of these problems?

Thanks in advance.


Re: django autocomplete light

2018-03-31 Thread Gerald Brown
Have a look at this article: 
https://simpleisbetterthancomplex.com/tutorial/2018/01/29/how-to-implement-dependent-or-chained-dropdown-list-with-django.html
 
It might do what you are trying to do.  There are also a lot of other posts 
about Django on this site.

On Saturday, September 16, 2017 at 7:24:48 PM UTC+8, Ahmet Muazim Tunç 
wrote:
>
> I want to make two or three dropdown menus which are dependent on each 
> other. It's Country, City dropdown menus and when Country is selected City 
> dropdown menu has to be filled with proper cities. How can I make this?
> I have the data, installed the django-cities-light app and filled my db 
> with the current country, city information
>

-- 
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/ce759fa1-dd99-41c8-b93f-c03afb990e49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django 2 autocomplete

2018-03-31 Thread Gerald Brown
Greetings:

Has anyone used the new Django2 autocomplete function? If so do you know of 
any tutorials or samples on how to set it up?

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/46992025-649d-4033-ae83-a5286e5a0820%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: When deleting field in models admin form not updating.

2018-03-31 Thread Gerald Brown
I had run migrations several times.  The last migration said "Nothing 
changed.".  However today when I rebooted my system the fields were gone so 
I guess the reboot took care of them.

Thanks for your reply.

On Saturday, March 31, 2018 at 12:54:14 AM UTC+8, Andrew Korir wrote:
>
> have you tried to run migrations on that particular app in your django 
> project
>
> python manage.py makemigrations app_name
>
> python manage.py migrate app_name
>
> On Fri, Mar 30, 2018 at 4:27 PM, Gerald Brown <gsbr...@gmail.com 
> > wrote:
>
>> I am using Django 2.0.3 and Python 3.6.  When I delete a field in the 
>> model file it is NOT being deleted in the admin form.  Any ideas on how I 
>> can delete the field on the admin form?
>>
>> 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...@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/3274bd21-77ec-4778-9af5-89c4c0daa12f%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/3274bd21-77ec-4778-9af5-89c4c0daa12f%40googlegroups.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/e110b475-f59f-4829-87f9-61eca6aaecc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: When deleting field in models admin form not updating.

2018-03-31 Thread Gerald Brown


On Friday, March 30, 2018 at 9:31:11 PM UTC+8, Gerald Brown wrote:
>
> I am using Django 2.0.3 and Python 3.6.  When I delete a field in the 
> model file it is NOT being deleted in the admin form.  Any ideas on how I 
> can delete the field on the admin form?
>
> 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/6c201f28-e501-46e3-a675-36bc6cbe91e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


When deleting field in models admin form not updating.

2018-03-30 Thread Gerald Brown
I am using Django 2.0.3 and Python 3.6.  When I delete a field in the model 
file it is NOT being deleted in the admin form.  Any ideas on how I can 
delete the field on the admin form?

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/3274bd21-77ec-4778-9af5-89c4c0daa12f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Connecting django to postgresql database

2017-06-02 Thread Gerald Brown
When you run "python manage.py.migrate" are you in the same directory as 
the "manage.py" file?  Also I always run "python manage.py makemigrations" 
before running the "migrate" command.

Hope this helps.

Gerry

On Thursday, May 25, 2017 at 7:48:32 PM UTC+8, Njogu wrote:
>
> I have been trying to connect my django project to postrgesql database, i 
> have one the configurations to it perfectly like this;
>
>
> ALLOWED_HOSTS = ['localhost', '127.0.0.1']
>
> DATABASES = {
> 'default': {
> 'ENGINE' : 'django.db.backends.postgresql_psycopg2',
> 'NAME'  : 'firstdjangoproject',
> 'USER'  : 'djangouser',
> 'PASSWORD' : 'django254',
> 'HOST'  : '127.0.0.1',
> 'PORT'  : '5432',
> }
>
> however when i run the command *'python manage.py migrate'* it does not 
> identify the word migrate, and when i run the command '*python manage.py 
> syncdb*' i get the following error;
>
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/core/management/__init__.py",
>  
> line 363, in execute_from_command_line
> utility.execute()
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/core/management/__init__.py",
>  
> line 337, in execute
> django.setup()
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/__init__.py",
>  
> line 27, in setup
> apps.populate(settings.INSTALLED_APPS)
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/apps/registry.py",
>  
> line 108, in populate
> app_config.import_models()
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/apps/config.py",
>  
> line 202, in import_models
> self.models_module = import_module(models_module_name)
>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in 
> import_module
> __import__(name)
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/contrib/auth/models.py",
>  
> line 4, in 
> from django.contrib.auth.base_user import AbstractBaseUser, 
> BaseUserManager
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/contrib/auth/base_user.py",
>  
> line 52, in 
> class AbstractBaseUser(models.Model):
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/db/models/base.py",
>  
> line 124, in __new__
> new_class.add_to_class('_meta', Options(meta, app_label))
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/db/models/base.py",
>  
> line 330, in add_to_class
> value.contribute_to_class(cls, name)
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/db/models/options.py",
>  
> line 214, in contribute_to_class
> self.db_table = truncate_name(self.db_table, 
> connection.ops.max_name_length())
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/db/__init__.py",
>  
> line 33, in __getattr__
> return getattr(connections[DEFAULT_DB_ALIAS], item)
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/db/utils.py",
>  
> line 211, in __getitem__
> backend = load_backend(db['ENGINE'])
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/db/utils.py",
>  
> line 115, in load_backend
> return import_module('%s.base' % backend_name)
>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in 
> import_module
> __import__(name)
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/db/backends/postgresql/base.py",
>  
> line 36, in 
> raise ImproperlyConfigured("psycopg2_version 2.5.4 or newer is 
> required; you have %s" % psycopg2.__version__)
> django.core.exceptions.ImproperlyConfigured: psycopg2_version 2.5.4 or 
> newer is required; you have 2.4.5 (dt dec mx pq3 ext)
>
>

-- 
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/6fd0561b-9317-4d0a-ad8f-1aebcf134202%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: No installed app with label 'province'.

2017-02-11 Thread Gerald Brown
Finally solved the problem!!!
At the end of each Model definition I had added:
class Meta:
managed = True
db_table = 'refer'
app_label = 'Refer'

I then commented those lines out and then the program worked like it 
should. I saw another post where they had put those variables as part of an 
"options" statement.

I was getting other errors when I did not have the "app_label" line so that 
is why I added that.
 

On Wednesday, February 8, 2017 at 7:09:12 AM UTC+8, Gerald Brown wrote:
>
> I have just started an app on Ubuntu 16.04 Server using Python 3.5 and 
> Django 1.10.5.
>
> When I do "@admin.register(Province)" in my admin.py file I get the error 
> that is the subject of this post.
>
> Of course there is NO app with label of 'province' as that is the label of 
> a 'Model'.
>
> Why is Django trying to register an app instead of the Model?
>
> Thanks,
>
> Gerald
>
>
>

-- 
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/b39ec10f-1a57-45d3-9532-eb4ed2d54ce2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: No installed app with label 'province'.

2017-02-10 Thread Gerald Brown


On Thursday, February 9, 2017 at 9:16:48 PM UTC+8, Florian Schweikert wrote:
>
> On 09/02/17 14:01, Gerald Brown wrote: 
> > Because of this problem I am NOT able to proceed with my project so any 
> > and all help will be appreciated. 
>
> Maybe somebody could help you if you provide more information about what 
> you are doing. 
>
> Following information could give some starting points for investigating 
> the problem: 
> * What does you INSTALLED_APPS look like? 
>

Here is the INSTALLED_APPS: "INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
#'django.contrib.sites',
 'sumedrec',
]"
 

> * The code of your ModelAdmin wogether with where you trying to register 
> it. (including imports) 
>
Here is the admin.py: "from django.contrib import admin
from .models import Patient, Visits

# Register your models here.

mymodels = [ Patient, Visits]
admin.site.register(mymodels)"

 

> * Are your models working correctly? Did creating migrations and 
> applying them work? YES
>
> -- 
> regards, 
> Florian 
>

Is there anything else that I can provide to you to help solve this problem?

Thanks,
Gerald 

-- 
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/a90bcdf3-a343-4cd9-abe6-21bc4387bcaa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: No installed app with label 'province'.

2017-02-09 Thread Gerald Brown


On Wednesday, February 8, 2017 at 7:09:12 AM UTC+8, Gerald Brown wrote:
>
> I have just started an app on Ubuntu 16.04 Server using Python 3.5 and 
> Django 1.10.5.
>
> When I do "@admin.register(Province)" in my admin.py file I get the error 
> that is the subject of this post.
>
> Of course there is NO app with label of 'province' as that is the label of 
> a 'Model'.
>
> Why is Django trying to register an app instead of the Model?
>
> Thanks,
>
> Gerald
>
> I am still not able to solve this problem.  I tried deleting Django 1.10.5 
> and installing 1.8.17 & also 1.11a1 all with the same results.  I have 
> studied several tutorials which all same to use the same code "from .models 
> import ModelName, then admin.site.register(ModelName)" When I do that and 
> restart the server and go to 127.0.0.1/admin/ in my browser it gives me the 
> error: "LookupError at /admin/ 
>
> No installed app with label 'visits'." 
>
>  If I comment out  the statement "admin.site.register(ModelName", restart 
the server and then open the browser it brings up the screen to log-in if I 
am currently not logged-in, otherwise it brings up the admin page, of 
course with out the models.

Because of this problem I am NOT able to proceed with my project so any and 
all help will 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 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/d8c33e9c-040f-4f02-b5da-79fa78ce4f83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: No installed app with label 'province'.

2017-02-08 Thread Gerald Brown


On Wednesday, February 8, 2017 at 6:08:44 PM UTC+8, Pankaj Singh wrote:
>
> Hi Gerald,
>
> Have you added your new app in 'INSTALLED_APPS' in `settings.py`? No, 
> because "province" is the name of a MODEL, not an app.
>
> Can you tell more about context of ther error, e.g. this error occurs on 
> `python manage.py runserver` or when you access a page on django admin?
>
When I run "runserver" 

>
> Also, it would be much easier to find the issue if you can share the 
> traceback of error.
>
> On Tue, Feb 7, 2017 at 6:19 PM, Gerald Brown <gerb...@gmail.com 
> > wrote:
>
>> I have just started an app on Ubuntu 16.04 Server using Python 3.5 and 
>> Django 1.10.5.
>>
>> When I do "@admin.register(Province)" in my admin.py file I get the error 
>> that is the subject of this post.
>>
>> Of course there is NO app with label of 'province' as that is the label 
>> of a 'Model'.
>>
>> Why is Django trying to register an app instead of the Model?
>>
>> Thanks,
>>
>> Gerald
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/5e94b0d3-c6cd-4b24-b323-544d10e97923%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/5e94b0d3-c6cd-4b24-b323-544d10e97923%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Regards,
> Pankaj Kumar Singh
>
> Mobile: +91 9618754327
> Skype: psjinx
> Emal: psj...@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 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/30903d95-d689-42d7-bb64-d14c5df60aa0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


No installed app with label 'province'.

2017-02-07 Thread Gerald Brown
I have just started an app on Ubuntu 16.04 Server using Python 3.5 and 
Django 1.10.5.

When I do "@admin.register(Province)" in my admin.py file I get the error 
that is the subject of this post.

Of course there is NO app with label of 'province' as that is the label of 
a 'Model'.

Why is Django trying to register an app instead of the Model?

Thanks,

Gerald


-- 
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/5e94b0d3-c6cd-4b24-b323-544d10e97923%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Ignore previous post!!!

2017-02-07 Thread Gerald Brown
You can ignore my previous post as I *think* I discovered my problem.

I had 2 admin.py files and the second one was giving me the error...

-- 
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/537e6b7c-e06b-44a4-a713-117cbde12236%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-07 Thread Gerald Brown
Have you tried using "127.0.0.1" instead of "localhost"?  I had a similar 
problem when I used "localhost" 

On Tuesday, February 7, 2017 at 5:12:30 AM UTC+8, Philip wrote:
>
> Hello,
>
> I am working through the tutorial included with the django documentation, 
> and I am confused as to why my url is not working. I have the most recent 
> versions of django and python (the ones that the tutorial says to use) and 
> I believe my file structure is correct, you can see it on  
> https://github.com/philipkiely/docexample to verify. However, I get a 404 
> error when I try localhost:8000/polls/, where the documentation tutorials 
> says that I should be seeing the page that I built.
>
> Thank you,
>
> Philip
>

-- 
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/19dbc28b-c01e-4398-bd44-d6dd7ce6f329%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.