Getting Django Channels working with NewRelic

2023-11-17 Thread Tim Nelson
I am trying to get NewRelic monitoring my ASGI code written in Django
Channels.

Most notably, this line of code from their examples should create a
NewRelic transaction and start monitoring all async activity.

   channel_layer =
newrelic.agent.ASGIApplicationWrapper(get_default_application())

Has anyone got this working?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK09zooJF4dr9sVW2Fo71%3DQ%2Bf8Ahw38FxpZyhC%2BBPFTXPtGk9A%40mail.gmail.com.


Channels SyncConsumers locking up Uvicorn/Websockets

2023-06-19 Thread Tim Nelson
We have had the occasional case where it appears a given SyncConsumer
hangs. These seem to starve Channels of ASGI threads, eventually breaking
all clients that are trying to send or connect.

Is there any way to build in a timeout, meaning if a SyncConsumer doesn't
finish its request in (say) 5 seconds to interrupt it?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK09zoo3%2B0yjFiappMDEtZk99PNAO6aU7mUO9zVhSaNVondYEw%40mail.gmail.com.


Hanging SyncConsumers taking down ASGI processing

2023-04-28 Thread Tim Nelson
I am chasing a database deadlock issue in my application. What appears to
be happening is my SyncConsumers are eating up all the ASGI threads because
they are hung and websocket connections start failing.

Is there a way to add a uWSGI "harakiri" like functionality to
SyncConsumers to defend against this issue?

Django==3.2.5
channels==3.0.5
channels-redis==3.3.0
asgiref==3.5.2
uvicorn==0.15.0

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK09zopAv42Be3Dt6kk7_BV0_U4AtZh3gRnzmAcaQqms9FF7_A%40mail.gmail.com.


Multi-tenant SSO that supports OpenID and MS Azure AD

2022-11-07 Thread Tim Nelson
I am looking for a Django SSO package that supports OpenId and Azure AD
with multi-tenant support. My sense is I am going to have to roll my own by
forking the best of breed SSO's and adding multi-tenant support to them.

Is my assessment correct?
Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK09zooyoOOKO7Dyp5LAbqWDphLwfQLBKX2rRWhXZHPqNNjEtQ%40mail.gmail.com.


Re: collectstatic files chown'ed by root

2022-02-16 Thread 'Tim' via Django users
Thanks a lot for your input, it helped me figure it out!

Antonis, you're right, it's basically not possible that those files are 
owned by root when manage.py is run as "user". This gave me the clue that 
those directories (and many of the staticfiles) were created at a time 
before I switched to a non-root user in the Dockerfile. With a fresh 
staticfiles directory (nginx accesses it too), everything worked perfectly 
and everything's owned by the non-root user.

In the production environment, I'll have to change the permissions of that 
folder manually once (I think) and it should work there too.

On Tuesday, February 15, 2022 at 6:48:41 PM UTC+1 Derek wrote:

> I literally spent the last few days trying to fix this same issue (apart 
> from your "Django SECRET_KEY in a .env file" problem, which I don't 
> understand as it does not seem related).
>
> There are numerous suggestions on Stack Overflow and various blogs; which 
> either don't work or are too complex to understand and implement.
>
> What worked for me was:
>
> 1. Using the default, non-root user (in my case called "django")  to 
> create and set permissions on a 'staticfiles' directory as part of the 
> Django container build
> 2. NOT setting a default, non-root user at the end of the Dockerfile used 
> for the Django container build
> 3. Adding these lines to the end of the 'entrypoint' script:
> chown -R django:django /app/staticfiles
> exec runuser -u django "$@"
> 4. Adding the "python /app/manage.py collectstatic --noinput" command into 
> the "start" script
>
> In my case (you did not state yours) the staticfiles directory is mounted 
> outside the container, and the same outside mount point is also accessed by 
> the nGinx container to serve the static files.
>
> Many folks have also commented about "hackiness" in this process, but it 
> comes down to file permissions in Docker not being independent of those in 
> the host; and there is a LOT of reading around that if you want to dig into 
> it. IMO, its not a "workaround" if you just actually do need to work with 
> multiple permissions at different points in a process.
>
> HTH
> Derek
>
>
>
>
> On Monday, 14 February 2022 at 16:05:33 UTC+2 Tim wrote:
>
>> Hi all,
>> I'm deploying Django 4 via docker-compose. For security reasons, the 
>> Dockerfile creates a non-root user before running the entrypoint.sh script 
>> (which does migrations, collectstatic and starts the server with gunicorn). 
>> All app files are "chown"ed by this non-root user.
>>
>> Everything works fine except for the collectstatic command (in 
>> entrypoint.sh), which creates the "staticfiles" directory but it's owned by 
>> root. This leads to permission denied errors when the collectstatic command 
>> tries to delete a static file.
>>
>> My question: Why does collectstatic assign the folder to "root" despite 
>> the non-root user calling the collectstatic command? How to prevent this?
>>
>> I tried doing the collectstatic command before switching to the non-root 
>> user (in the Dockerfile) which works. But it stops working when I put the 
>> Django SECRET_KEY in a .env file (as we should in production) since this 
>> env var is not available during docker build time.
>>
>> Now I could find a hackier way by making the secret key available during 
>> build time or switching back to a root user in entrypoint.sh, but all of 
>> this is a bad workaround in my opinion.
>>
>> I'm sure everyone deploying Django with docker and being mindful of 
>> security has come across this - Any hints about why collectstatic is owned 
>> by root? Is this a bug?
>>
>> Should I add additional details?
>>
>> Thanks for any tips!
>> Tim
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/44862a6d-8e17-4ab9-aba0-2e4ef0041ab7n%40googlegroups.com.


collectstatic files chown'ed by root

2022-02-14 Thread 'Tim' via Django users
Hi all,
I'm deploying Django 4 via docker-compose. For security reasons, the 
Dockerfile creates a non-root user before running the entrypoint.sh script 
(which does migrations, collectstatic and starts the server with gunicorn). 
All app files are "chown"ed by this non-root user.

Everything works fine except for the collectstatic command (in 
entrypoint.sh), which creates the "staticfiles" directory but it's owned by 
root. This leads to permission denied errors when the collectstatic command 
tries to delete a static file.

My question: Why does collectstatic assign the folder to "root" despite the 
non-root user calling the collectstatic command? How to prevent this?

I tried doing the collectstatic command before switching to the non-root 
user (in the Dockerfile) which works. But it stops working when I put the 
Django SECRET_KEY in a .env file (as we should in production) since this 
env var is not available during docker build time.

Now I could find a hackier way by making the secret key available during 
build time or switching back to a root user in entrypoint.sh, but all of 
this is a bad workaround in my opinion.

I'm sure everyone deploying Django with docker and being mindful of 
security has come across this - Any hints about why collectstatic is owned 
by root? Is this a bug?

Should I add additional details?

Thanks for any tips!
Tim

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c3381f62-4bf1-4142-b27f-189ef45a75fan%40googlegroups.com.


Re: Automatic subdomain for each user

2021-12-29 Thread Tim Chase
On 2021-12-29 15:02, Sherif Adigun wrote:
> I am faced with a requirement where each user is required to use
> the application under his own subdomain. Whenever a user registers,
> he gets username.domain.com and he can add staff, manage reports,
> etc under his subdomain.
> 
> What is the best approach to you can suggest please? 

Generally this requires

1) configuring your DNS to allow for wildcard domains so that
*.domain.com points at your web server, usually looking something like

  *.example.com.   3600  IN  A  198.51.100.17

2) setting up your HTTPS certificates.  This could be

 - involve an ACME-aware Django route (I'm not sure if such a beast
   exists)

 - configuring an ACME client like certbot to update your
   DNS records so that Let's Encrypt can verify that you own the
   domain and then grant your a wildcard cert

 - use a different CA to obtain a wildcard cert

2b) if you used a more manual method, put the certs in the
appropriate place for your web-server to pick them up

3) configure your web-server front-end/proxy (usually nginx or
Apache, but there are others) to handle the wildcard domains and pass
them through to your Django app or WSGI server or what have you.  Make
sure the domain information is passed through in the HTTP_HOST header

4) use django-subdomains[1] (or maybe django-hosts[2]) middleware to
extract the intended host-name from the HTTP_HOST header and possibly
make the route reversable so that .reverse() works

5) check your views so that they make use of the HTTP_HOST
information to filter for user-specific information

-tkc


[1] https://django-subdomains.readthedocs.io/en/latest/


[2] https://github.com/jazzband/django-hosts





-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20211229180928.221f447b%40bigbox.attlocal.net.


Re: How can I scale my application to different teams ?

2021-11-30 Thread Tim Chase
On 2021-11-30 02:11, Kumar Gaurav wrote:
> How Can I group the users and show the contents related to them
> only.  

You presumably have some sort of User model and have added some sort
of Group model.  Depending on your business logic, either a User can
belong to one-and-only-one group in which case you'd have a
"User.group" foreign key; or a User can belong to multiple groups, in
which case you'd have a many-to-many relationship between users and
groups.

I'd bias towards the latter even if *current* business rules say that
a person can only be a memeber of one group.  It's easier to design
for multiple groups now and then only use one.  It's much harder to
design for one-group-per-person now and then switch to
a-person-can-be-in-more-than-one-group later.

Similarly, I imagine that Posts get associated with a particular
group. Or maybe they can be broadcast to multiple groups. 

Then filter Posts based on Groups associated with the
currently-logged-in User.

-tkc


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20211130080240.78a58df5%40bigbox.attlocal.net.


Re: Initial value is not displayed on forms.DateField with widget input type="date" when localized

2021-10-27 Thread Tim Graham
You can read https://code.djangoproject.com/ticket/33113 for some details 
on this issue.

On Wednesday, October 27, 2021 at 5:07:00 AM UTC-4 binoy...@gmail.com wrote:

> Hi 
> I have a form field forms.DateField and widget as follows
>
> class CustomDateInput(forms.DateInput):
> input_type = 'date'
>
> valid_from = forms.DateField(
> label=_("Valid from"), widget=CustomDateInput(), required=False, 
> localize=True)
>
> But the date is not displayed by the browser when the language is 
> German(de). The field is rendered as follows with in:
>
>  id="id_valid_from">
>
> But the browser is *not display* the initial value to the user, instead 
> shows *mm/dd/* when the system language is English and *dd.mm.* 
> when the system language is German.
>
> I have also tried not passing the localize form field argument as well as 
> localize off template tag, but both didn't work. 
>
> I could resolve the issue by rending the field manually and setting the 
> date form to  -mm-dd.
>
> Is it a browser issue or as the date input supports only value in 
> -mm-dd?
>
> Python version: 3.8. 10 and django: 3.0.14
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d636fa6e-69e4-4402-9d1e-2486fb70c11cn%40googlegroups.com.


2.2.* to 3.2.5 update: jsonb deserialisation is broken!

2021-08-01 Thread Tim Richardson
Database is postgresql 12
 psycopg2-binary==2.8.6 \

The bug occurs when I move from django 2.2.* to 3.2.5
A raw sql query is now behaving differently. A result that was previously 
deserialised from a jsonb field into a python dict now returns a string 
(and breaks things). 

this is a simplifed version of my query: 

 sql = """select

jsonb_array_elements(cached_dear_dearcache.jdata#>'{Fulfilments}')->'Pick' 
as picks
from cached_dear_dearcache
 """

jdata is a jsonb field.

picks should be a dict, eg 
{"Lines":[{...line1...},{...line2...}]

this has always worked; this django project has always been on 2.2.x
I use this code in production on a variety of postgresql datbase from v 9.6 
to v12.

As soon as I update to 3.2.5, I no longer get a dict. Instead, I get a 
string which is json. 

I have downgraded to 2.2 since this is major problem. 

Is it a bug or have I missed something?


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/45582bbb-6ec7-4655-a868-bc0dadf3e843n%40googlegroups.com.


Re: can Django replace PHP ?

2021-06-28 Thread Tim Chase
On 2021-06-27 21:20, Krishna Adhikari wrote:
> *can we solve all kinds of web application problems with Django
> without learning PHP ?? *
> *or PHP also recommended.*

For just about aspect, either they're interchangeable, or I find that
Python/Django wins (readability, library consistency, breadth of
library, security, availability).

The one area where PHP excels is deployment.  Want to deploy a PHP
app?  It usually involves dumping some files in a folder on a shared
hosting service, using a config-wizard to point it at the right
data-store, and you're done.  So if ease-of-new-installation mattered
most to me (such as setting up NextCloud/OwnCloud, dropping a gallery
or blog on shared cPanel hosting, etc), I might choose PHP.

Deploying Django project takes a little more hand-holding and the
right type of service-offerings from the hosting machine.

But if you have successfully deployed a Django project, you've
overcome the biggest hurdle, and Python/Django wins in pretty much
every subsequent category.

-tkc



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20210628100433.4c71a90f%40bigbox.attlocal.net.


FastCGI with recent Django?

2020-12-13 Thread Tim Chase
At one point in history long past, Django 1.8 supported FastCGI via
flup

https://docs.djangoproject.com/en/1.8/howto/deployment/fastcgi/

but it was slated to be removed in 1.9 and there seem to be no
further docs I can disinter about running Django in a FastCGI
environment (all other resources I turned up are of a similar
vintage).

Is there a recommended way to run Django in a FastCGI environment
these days?

I ask largely because OpenBSD's stock `httpd` supports CGI and
FastCGI but not WSGI or other such interfaces.  Push come to shove, I
could end up using relayd/httpd as a fronting proxy to some
intermediate server (like uWSGI or gunicorn?).  If even that causes
issues, I *can* switch to nginx, but would prefer to stick with as
much software in the base install if possible.

Thanks,

-tkc






-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20201213110941.661cf166%40bigbox.attlocal.net.


Re: Oracle 12.0.1 admin not working with django 3+

2020-06-24 Thread Tim Graham
I'm not sure if this is the cause of your issue but Django 3.0 officially 
supports Oracle 12.2 and higher: 
https://docs.djangoproject.com/en/3.0/ref/databases/#oracle-notes

On Tuesday, June 23, 2020 at 10:35:24 PM UTC-4, ashish goyal wrote:
>
> Ho All, 
>
> Have created lot of stuff in app, when i try login to admin with superuser 
> name and password it shows integrity issue. And there is no row in 
> django_admin_log. 
> On some posts i found this is an issue with django 3+ version which i am 
> using. 
>
> How can i resolve this without hampering my existing code? 
>
> Thanks 
> Ashish

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bf6b3f05-0b1d-40c9-85ac-112de338cbe5o%40googlegroups.com.


Re: cx_Oracle.DatabaseError: ORA-00910: specified length too long for its datatype

2020-06-19 Thread Tim Graham
The relevant migration is:
https://github.com/divio/django-cms/blob/d6cabc49f016dd9a16f91440da9fb6790d27c2ae/cms/migrations/0008_auto_20150208_2149.py

It increases the length of a CharField to 2048 characters which seems to be 
longer than Oracle supports.

As far as I know, Django CMS isn't tested with Oracle. Perhaps they would 
consider a fix but there may be other issues.

On Friday, June 19, 2020 at 7:38:49 AM UTC-4, Irving Safetywebs wrote:
>
> Hi Django-ites,
>
> I am trying to install Django CMS on my Ubuntu installation running on the 
> Linux subsystem for Windows 10 using Python 3.6 and connect it to an Oracle 
> 12 c DB. Everytime I try to migrate the site to the DB like so: 
> python poc/manage.py migrate
>
> I get this error: 
>
>   Applying cms.0008_auto_20150208_2149...Traceback (most recent call last):
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/db/backends/utils.py",
>  
> line 86, in _execute
> return self.cursor.execute(sql, params)
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/db/backends/oracle/base.py",
>  
> line 517, in execute
> return self.cursor.execute(query, self._param_generator(params))
> cx_Oracle.DatabaseError: ORA-00910: specified length too long for its 
> datatype
>
> The above exception was the direct cause of the following exception:
>
> Traceback (most recent call last):
>   File "poc/manage.py", line 21, in 
> main()
>   File "poc/manage.py", line 17, in main
> execute_from_command_line(sys.argv)
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/core/management/__init__.py",
>  
> line 401, in execute_from_command_line
> utility.execute()
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/core/management/__init__.py",
>  
> line 395, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/core/management/base.py",
>  
> line 328, in run_from_argv
> self.execute(*args, **cmd_options)
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/core/management/base.py",
>  
> line 369, in execute
> output = self.handle(*args, **options)
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/core/management/base.py",
>  
> line 83, in wrapped
> res = handle_func(*args, **kwargs)
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/core/management/commands/migrate.py",
>  
> line 233, in handle
> fake_initial=fake_initial,
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/db/migrations/executor.py",
>  
> line 117, in migrate
> state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, 
> fake_initial=fake_initial)
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/db/migrations/executor.py",
>  
> line 147, in _migrate_all_forwards
> state = self.apply_migration(state, migration, fake=fake, 
> fake_initial=fake_initial)
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/db/migrations/executor.py",
>  
> line 245, in apply_migration
> state = migration.apply(state, schema_editor)
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/db/migrations/migration.py",
>  
> line 124, in apply
> operation.database_forwards(self.app_label, schema_editor, old_state, 
> project_state)
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/db/migrations/operations/fields.py",
>  
> line 249, in database_forwards
> schema_editor.alter_field(from_model, from_field, to_field)
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/db/backends/oracle/schema.py",
>  
> line 59, in alter_field
> super().alter_field(model, old_field, new_field, strict)
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/db/backends/base/schema.py",
>  
> line 565, in alter_field
> old_db_params, new_db_params, strict)
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/db/backends/base/schema.py",
>  
> line 715, in _alter_field
> params,
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/db/backends/base/schema.py",
>  
> line 142, in execute
> cursor.execute(sql, params)
>   File 
> "/mnt/c/Users/kz6lkb/Documents/django-cms-site/lib/python3.6/site-packages/django/db/backends/utils.py",
>  
> line 100, in execute
> return super().execute(sql, params)
>   File 
> 

Re: Best way to get a PR Review?

2020-06-16 Thread Tim Graham
Hi Matt,

Your patch is in the "Patches needing review" queue (along with 33 others 
issues) at https://dashboard.djangoproject.com/.  Reviewing patches isn't a 
task limited to members of the Django team. Anyone from the community is 
welcome to review patches and mark the ticket as "patch needs improvement" 
or "ready for checkin" as appropriate.

The Django fellows are prioritizing Django 3.1 blockers. Your patch is a 
new feature that would be part of Django 3.2. That feature freeze isn't 
until January 14, 2021 
(https://code.djangoproject.com/wiki/Version3.2Roadmap).

On Tuesday, June 16, 2020 at 5:25:42 PM UTC-4, mferr...@gmail.com wrote:
>
> Hi! I put together a PR (https://github.com/django/django/pull/12333) for 
> a ticket (https://code.djangoproject.com/ticket/29789) months ago and 
> have been struggling to get a review on it. How long should it usually take 
> to get a PR Review? Is there something else I should be doing? I was 
> originally excited to have a contribution to Django, but have been 
> discouraged from contributing any more by the slow turn-around.
>
> Thanks!
> - Matt
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1cae8b14-b835-4e09-9adf-b0ab7cc678eao%40googlegroups.com.


Re: Possible Django bug I am considering raising

2020-06-04 Thread Tim Graham
You can try to find the commit that introduced the issue: 
https://docs.djangoproject.com/en/dev/internals/contributing/triaging-tickets/#bisecting-a-regression

On Thursday, June 4, 2020 at 11:25:09 AM UTC-4, OwlHoot wrote:
>
> Hi all
>
> I believe the issue I have enquired about on the following Stack Exchange 
> page :
>
>
> https://stackoverflow.com/questions/62162288/baffling-error-filtering-django-objects-of-derived-class-by-values-in-foreign-ke
>
> may well be a Django bug, or at the least no longer works with Django as 
> this has evolved since v 1.10 (when it worked fine).
>
> In summary, the issue is that if a model class B inherits from A, which 
> inherits from models.model, then a call to B.objects.filter() cannot locate 
> a field actually defined in B (because, it seems, Django starts its walk 
> through the relevant/related models from A rather than B and for some 
> unfathomable reason checks everything _except_ B !)
>
> Regards
>
> John R Ramsden
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ce8987ee-a001-47bd-8d74-2d1b8469da25o%40googlegroups.com.


Re: Possible Bug? AttributeError: 'HttpResponse' object has no attribute '_resource_closers'

2020-05-30 Thread Tim Allen
Thanks for the reply, my friend. Unfortunately, no new middleware has been 
added. Some folks have said clearing the Django cache(s) worked, but it 
hasn't for me.

I've long been a mod_wsgi user, but I think it is time to move on to 
gunicorn, so I've started moving in that direction rather than sinking a 
lot more time here.

On Saturday, May 16, 2020 at 5:02:32 PM UTC-4, jlgimeno71 wrote:
>
>
>
> On Sat, May 16, 2020 at 12:06 PM Tim Allen  > wrote:
>
>> I posted this to Stack Overflow first, thinking it might be a problem 
>> with `mod_wsgi`, but people using Gunicorn have seen the issue too. Here's 
>> a link to the question on Stack Overflow:
>>
>>
>> https://stackoverflow.com/questions/61295971/django-3-0-5-with-mod-wsgi-attributeerror-httpresponse-object-has-no-attribu
>>
>> Unfortunately, purging my cache hasn't fixed the problem like it did for 
>> a commenter on the question, so I'm asking here for amplification. Here's 
>> the text of the post:
>>
>> I'm getting an error when I deploy Django 3.0.5 under mod_wsgi:  
>> AttributeError: 
>> 'HttpResponse' object has no attribute '_resource_closers'. I'm running:
>>
>>- Python: 3.6.8
>>- Django: 3.0.5
>>- Apache: 2.4.6
>>- mod_wsgi: 4.6.2
>>
>> Here's the basics of the view causing the error; nothing too exotic (I've 
>> simplified the code around meetings_struct):
>>
>>
>> class MeetingsAPIView(MeetingsBaseView):
>> def get(self, request, *args, **kwargs):
>> meetings = self.get_meetings()
>> meetings_struct = []
>>
>> for meeting in meetings:
>> meetings_struct.append({
>> "id": meeting.id,
>> "name": meeting.title,
>> "slug": meeting.slug,
>> })
>>
>> return HttpResponse(meetings_struct, content_type="application/json")
>>
>>
>> If I activate the venv and use runserver manually on the server on port 
>> 80, the same view does not give an error. When the same code and venv are 
>> running under Apache, here's the error from Apache's logs:
>>
>>
>> [Sat Apr 18 16:11:30.683980 2020] [wsgi:error] [pid 4154] [remote 
>> 100.19.146.139:54397] mod_wsgi (pid=4154): Exception occurred processing 
>> WSGI script '/var/django/sites/mysite-prod/config/wsgi.py'.[Sat Apr 18 
>> 16:11:30.684834 2020] [wsgi:error] [pid 4154] [remote 100.19.146.139:54397] 
>> Traceback (most recent call last):[Sat Apr 18 16:11:30.684891 2020] 
>> [wsgi:error] [pid 4154] [remote 100.19.146.139:54397]   File 
>> "/var/django/sites/mysite-prod/venv/lib64/python3.6/site-packages/django/core/handlers/wsgi.py",
>>  line 133, in __call__[Sat Apr 18 16:11:30.684903 2020] [wsgi:error] [pid 
>> 4154] [remote 100.19.146.139:54397] response = 
>> self.get_response(request)[Sat Apr 18 16:11:30.684925 2020] [wsgi:error] 
>> [pid 4154] [remote 100.19.146.139:54397]   File 
>> "/var/django/sites/mysite-prod/venv/lib64/python3.6/site-packages/django/core/handlers/base.py",
>>  line 76, in get_response[Sat Apr 18 16:11:30.684933 2020] [wsgi:error] [pid 
>> 4154] [remote 100.19.146.139:54397] 
>> response._resource_closers.append(request.close)[Sat Apr 18 16:11:30.684964 
>> 2020] [wsgi:error] [pid 4154] [remote 100.19.146.139:54397] AttributeError: 
>> 'HttpResponse' object has no attribute '_resource_closers'
>>
>>
>> I've rolled back to a previous version that works, running Django 2.2; 
>> the rest of the stack is the same. This one has me puzzled, as using the 
>> same deployed code with the same venv that Apache is configured to use 
>> works fine under runserver, but errors with mod_wsgi. I've tried 
>> stopping and starting Apache, running the publish process again for a fresh 
>> venv and code base, and even rebooting the server. The same error 
>> occurs, but only under Apache / mod_wsgi.
>>
>>
>> Any ideas? I'm puzzled!
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/0381e998-321e-489f-abe1-853b6997930f%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/0381e998-321e-489f-abe1-853b6997930f%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>
> Tim,
>
> Shot in the dark:  Did you add any middleware by chance?
>
> -Jorge
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f80c3888-eaac-48da-adaf-1862e1d4be5f%40googlegroups.com.


Re: GeoDjango with MySQL8

2020-05-25 Thread Tim Graham
Hi, you might have better luck getting an answer on the GeoDjango mailing 
list: https://groups.google.com/forum/#!forum/geodjango

On Monday, May 25, 2020 at 11:06:26 AM UTC-4, Utkarsh Bansal wrote:
>
> I am facing problems while trying to use GeoDjango (v2.2) with MySQL 8.0.19
>
> I created a new PointField and ran makemigrations
> geo_code = PointField(srid=4326)
>
> On running sqlmigrate on the generated migration - I notice that the 
> column does not have a SRID constrain
> BEGIN;
> --
> -- Create model Location
> --
> CREATE TABLE `locations_location` (`id` integer AUTO_INCREMENT NOT NULL 
> PRIMARY KEY, `geo_code` POINT NOT NULL);
> CREATE SPATIAL INDEX `locations_location_geo_code_id` ON 
> `locations_location`(`geo_code`);
> COMMIT;
>
> Now anything I add to the column is saved with SRID 0, which is incorrect.
>
> Next, I tried creating the column with the correct SRID by using 
> migrations.SeparateDatabaseAndState to generate the column.
> ALTER TABLE backend_userprofile ADD COLUMN geocode_point POINT NULL SRID 
> 4326;
>
> Now if I try to insert data in this new column, I get and error because 
> Django is still trying to insert with SRID 0 and MySQL does not allow that
> django.db.utils.OperationalError: (3643, "The SRID of the geometry does 
> not match the SRID of the column 'geo_code'. The SRID of the geometry is 0, 
> but the SRID of the column is 4326. Consider changing the SRID of the 
> geometry or the SRID property of the column.")
>
> Is there a way to make Django use correct SRIDs with MySQL? I also found a 
> ticket on the issue tracker which seems related 
> https://code.djangoproject.com/ticket/27464
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c9d4a387-de7e-42d5-897f-88cbd540fc1d%40googlegroups.com.


Possible Bug? AttributeError: 'HttpResponse' object has no attribute '_resource_closers'

2020-05-16 Thread Tim Allen
I posted this to Stack Overflow first, thinking it might be a problem with 
`mod_wsgi`, but people using Gunicorn have seen the issue too. Here's a 
link to the question on Stack Overflow:

https://stackoverflow.com/questions/61295971/django-3-0-5-with-mod-wsgi-attributeerror-httpresponse-object-has-no-attribu

Unfortunately, purging my cache hasn't fixed the problem like it did for a 
commenter on the question, so I'm asking here for amplification. Here's the 
text of the post:

I'm getting an error when I deploy Django 3.0.5 under mod_wsgi:  
AttributeError: 
'HttpResponse' object has no attribute '_resource_closers'. I'm running:

   - Python: 3.6.8
   - Django: 3.0.5
   - Apache: 2.4.6
   - mod_wsgi: 4.6.2

Here's the basics of the view causing the error; nothing too exotic (I've 
simplified the code around meetings_struct):


class MeetingsAPIView(MeetingsBaseView):
def get(self, request, *args, **kwargs):
meetings = self.get_meetings()
meetings_struct = []

for meeting in meetings:
meetings_struct.append({
"id": meeting.id,
"name": meeting.title,
"slug": meeting.slug,
})

return HttpResponse(meetings_struct, content_type="application/json")


If I activate the venv and use runserver manually on the server on port 80, 
the same view does not give an error. When the same code and venv are 
running under Apache, here's the error from Apache's logs:


[Sat Apr 18 16:11:30.683980 2020] [wsgi:error] [pid 4154] [remote 
100.19.146.139:54397] mod_wsgi (pid=4154): Exception occurred processing WSGI 
script '/var/django/sites/mysite-prod/config/wsgi.py'.[Sat Apr 18 
16:11:30.684834 2020] [wsgi:error] [pid 4154] [remote 100.19.146.139:54397] 
Traceback (most recent call last):[Sat Apr 18 16:11:30.684891 2020] 
[wsgi:error] [pid 4154] [remote 100.19.146.139:54397]   File 
"/var/django/sites/mysite-prod/venv/lib64/python3.6/site-packages/django/core/handlers/wsgi.py",
 line 133, in __call__[Sat Apr 18 16:11:30.684903 2020] [wsgi:error] [pid 4154] 
[remote 100.19.146.139:54397] response = self.get_response(request)[Sat Apr 
18 16:11:30.684925 2020] [wsgi:error] [pid 4154] [remote 100.19.146.139:54397]  
 File 
"/var/django/sites/mysite-prod/venv/lib64/python3.6/site-packages/django/core/handlers/base.py",
 line 76, in get_response[Sat Apr 18 16:11:30.684933 2020] [wsgi:error] [pid 
4154] [remote 100.19.146.139:54397] 
response._resource_closers.append(request.close)[Sat Apr 18 16:11:30.684964 
2020] [wsgi:error] [pid 4154] [remote 100.19.146.139:54397] AttributeError: 
'HttpResponse' object has no attribute '_resource_closers'


I've rolled back to a previous version that works, running Django 2.2; the 
rest of the stack is the same. This one has me puzzled, as using the same 
deployed code with the same venv that Apache is configured to use works 
fine under runserver, but errors with mod_wsgi. I've tried stopping and 
starting Apache, running the publish process again for a fresh venv and 
code base, and even rebooting the server. The same error occurs, but only 
under Apache / mod_wsgi.


Any ideas? I'm puzzled!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0381e998-321e-489f-abe1-853b6997930f%40googlegroups.com.


Re: Channels/Daphne offloading SSL Certs to AWS ELB fails to establish socket

2020-04-20 Thread Tim Nelson
Well if you want the clients IP logged or need to do something with it on
the request:

   set_real_ip_from 0.0.0.0/0;
   real_ip_header X-Forwarded-For;
   real_ip_recursive on;


On Mon, Apr 20, 2020 at 5:55 PM Shaheed Haque 
wrote:

>
>
> On Mon, 20 Apr 2020 at 21:54, Filbert  wrote:
>
>> *Answering my own question.AWS classic ELBs never worked properly
>> with websockets. Need to convert them to ALBs.*
>>
>
> Thanks for closing the loop; this is quite likely to be in my future. Did
> you need any nginx config changes?
>
> Shaheed
>
> On Tuesday, April 14, 2020 at 5:37:54 PM UTC-4, Filbert wrote:
>>>
>>> Using AWS ELB, I was able to serve HTTP (via uwsgi) and websockets
>>> through Nginx with Nginx handling the SSL certs.
>>>
>>> Once I tried to offloading SSL certs to the ELB so I could capture
>>> X-Forwarded-For, websockets fail to route/upgrade to Daphne and I get "Not
>>> Found: /ws/" in uwsgi's logs.
>>>
>>> Here is the relevant (working) piece of Nginx .conf file using TCP/443
>>> pass thru from the ELB:
>>>
>>> location /ws {
>>> proxy_pass http://unix:/opt/toogo/run/r117.0.4.3720.ws;
>>>  #Obviously daphne is listening here
>>> proxy_set_header Upgrade $http_upgrade;
>>> proxy_set_header Connection "upgrade";
>>> proxy_http_version 1.1;
>>> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
>>> proxy_set_header Host $host;
>>> }
>>>
>>> What change is required if I offload the SSL certs to the ELB and
>>> introduce X-Forwarded-for?
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/305b31ae-ff69-425a-a173-645c55ba07a1%40googlegroups.com
>> 
>> .
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/iNoIPxDgv90/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHAc2jf1KNYe-p2JM-XLD2q8HpC_29oNrJ24KkyjVFRj%2BpPo%2BQ%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK09zoq2pD6MsMfXA6y_rj4CUvcxgrT-w11xYCSvaUjdm8TD_Q%40mail.gmail.com.


Re: stack

2020-04-20 Thread Tim Wilson
Here's the link:

https://docs.djangoproject.com/en/3.0/intro/tutorial01/

On Mon, Apr 20, 2020, at 12:51 PM, Sead Sejo Gicić wrote:
> Do the official Django tutorial? Where can we find this tutorial? Regard
> 

> 
> 
> пон, 20. апр 2020. у 18:26 Rok Klancar  је написао/ла:
>> Do the official Django tutorial
>> 

>> --
>>  You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>>  To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users+unsubscr...@googlegroups.com.
>>  To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/d024215b-ac1e-4323-b6de-07e26152e6bd%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/d024215b-ac1e-4323-b6de-07e26152e6bd%40googlegroups.com?utm_medium=email_source=footer>.
> 

> --
>  You received this message because you are subscribed to the Google Groups 
> "Django users" group.
>  To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
>  To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CALFh0xExmi-KVt%2Bh0uxwUG_4MC94Ev0uGMVzEkfMXPbAk8LCxA%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/django-users/CALFh0xExmi-KVt%2Bh0uxwUG_4MC94Ev0uGMVzEkfMXPbAk8LCxA%40mail.gmail.com?utm_medium=email_source=footer>.

-- 
Tim Wilson
President, Savvy Technology Group
phone: 612-599-5470

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3aa0213b-b6f0-4dd8-bc81-6f8e4a5405e0%40www.fastmail.com.


Re: Capture URL values in a CBV

2020-04-17 Thread Tim Johnson

Wham! That is what I was looking for.

From a class-based-view virgin to a wise head:

**you have been so helpful**

thank you

On 4/17/20 1:08 PM, Dylan Reinhold wrote:

def get_context_data(self, **kwargs):
        # Call the base implementation first to get a context
        context = super().get_context_data(**kwargs)
        # You your stuff
        context['my_pk'] = self.kwargs['pk']
        return context


--
Tim
tj49.com

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/106db642-7f41-1cd5-b20b-a0db77f2c854%40akwebsoft.com.


Re: Capture URL values in a CBV

2020-04-17 Thread Tim Johnson
OK. I am abandoning all pretext at self-sufficiency here. I have 
researched this for days, reviewed the links below and I still cannot 
resolve this issue.


Maybe someone besides Gavin has an idea of how to capture the pattern 
between angle brackets in a url conf into a class-based view.


I am sure the solution is very easy, but I obviously am missing something.

thanks

On 4/16/20 7:26 AM, Tim Johnson wrote:



On 4/15/20 7:24 PM, Gavin Wiener wrote:

Hey Tim

Hello Gavin: Thank you for your prompt reply.


The bigger question is, what are you trying to achieve?


I gotta know. I'm a retired programmer with 19 years doing CGI. Wrote 
and implemented my own framework. First in C, than C++ then rebol, 
then python.


I really want to know what is going on "under the hood" but I also 
wish to know why those examples, taken from documentation do not work.


I'm building a website with django as an alternative to the original 
in Drupal because I want fine-grained control.


I hope that answers your question.



With the DetailView, fetching the object with the primary key is 
already handled for you, as you've seen the object will already be 
available in the template.


This website is very useful to know which functions are implemented 
in a class-based view, and which variables are available.


http://ccbv.co.uk/


Thanks for the link. Will study it after finishing my coffee.


On Thursday, April 16, 2020 at 8:26:00 AM UTC+8, tim042849 wrote:

using django.VERSION (2, 1, 5, 'final', 0) with

python 3.7.2 on ubuntu 16.04

Given the URL pattern below:

path('', ArticleDetailView.as_view(), name='article_detail'),

And the view as below:

class ArticleDetailView(DetailView):
    model = Article
    template_name = 'article_detail.html'
    login_url = 'login'

I can access the variable pk from a template as

article.pk <http://article.pk>

But I don't know how to access the pk variable from the view itself.

Adding the get_queryset method to the view doesn't work

example

def get_queryset(self):
    print(self.kwargs["pk"])

results in

'NoneType' object has no attribute 'filter' Trying def
get_object(self): queryset =
self.filter_queryset(self.get_queryset()) obj =
queryset.get(pk=self.kwargs['pk']) return obj results in
'ArticleDetailView' object has no attribute 'filter_queryset'
Please advise - pretty basic for django, new to me :) thanks

-- 
Tim

tj49.com  <http://tj49.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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/39595843-0a01-4ffb-95b9-46d2d3c442e3%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/39595843-0a01-4ffb-95b9-46d2d3c442e3%40googlegroups.com?utm_medium=email_source=footer>.

--
Tim
tj49.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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/52390ecd-3748-6c96-3a1b-a2d671322336%40akwebsoft.com 
<https://groups.google.com/d/msgid/django-users/52390ecd-3748-6c96-3a1b-a2d671322336%40akwebsoft.com?utm_medium=email_source=footer>.


--
Tim
tj49.com

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a365875b-a4a1-2214-8616-c2b749f2ef52%40akwebsoft.com.


Re: Capture URL values in a CBV

2020-04-16 Thread Tim Johnson


On 4/15/20 7:24 PM, Gavin Wiener wrote:

Hey Tim

Hello Gavin: Thank you for your prompt reply.


The bigger question is, what are you trying to achieve?


I gotta know. I'm a retired programmer with 19 years doing CGI. Wrote 
and implemented my own framework. First in C, than C++ then rebol, then 
python.


I really want to know what is going on "under the hood" but I also wish 
to know why those examples, taken from documentation do not work.


I'm building a website with django as an alternative to the original in 
Drupal because I want fine-grained control.


I hope that answers your question.



With the DetailView, fetching the object with the primary key is 
already handled for you, as you've seen the object will already be 
available in the template.


This website is very useful to know which functions are implemented in 
a class-based view, and which variables are available.


http://ccbv.co.uk/


Thanks for the link. Will study it after finishing my coffee.


On Thursday, April 16, 2020 at 8:26:00 AM UTC+8, tim042849 wrote:

using django.VERSION (2, 1, 5, 'final', 0) with

python 3.7.2 on ubuntu 16.04

Given the URL pattern below:

path('', ArticleDetailView.as_view(), name='article_detail'),

And the view as below:

class ArticleDetailView(DetailView):
    model = Article
    template_name = 'article_detail.html'
    login_url = 'login'

I can access the variable pk from a template as

article.pk <http://article.pk>

But I don't know how to access the pk variable from the view itself.

Adding the get_queryset method to the view doesn't work

example

def get_queryset(self):
    print(self.kwargs["pk"])

results in

'NoneType' object has no attribute 'filter' Trying def
get_object(self): queryset =
self.filter_queryset(self.get_queryset()) obj =
queryset.get(pk=self.kwargs['pk']) return obj results in
'ArticleDetailView' object has no attribute 'filter_queryset'
Please advise - pretty basic for django, new to me :) thanks

-- 
Tim

tj49.com  <http://tj49.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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/39595843-0a01-4ffb-95b9-46d2d3c442e3%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/39595843-0a01-4ffb-95b9-46d2d3c442e3%40googlegroups.com?utm_medium=email_source=footer>.


--
Tim
tj49.com

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/52390ecd-3748-6c96-3a1b-a2d671322336%40akwebsoft.com.


Capture URL values in a CBV

2020-04-15 Thread Tim Johnson

using django.VERSION (2, 1, 5, 'final', 0) with

python 3.7.2 on ubuntu 16.04

Given the URL pattern below:

path('', ArticleDetailView.as_view(), name='article_detail'),

And the view as below:

class ArticleDetailView(DetailView):
    model = Article
    template_name = 'article_detail.html'
    login_url = 'login'

I can access the variable pk from a template as

article.pk

But I don't know how to access the pk variable from the view itself.

Adding the get_queryset method to the view doesn't work

example

def get_queryset(self):
    print(self.kwargs["pk"])

results in

'NoneType' object has no attribute 'filter' Trying def get_object(self): 
queryset = self.filter_queryset(self.get_queryset()) obj = 
queryset.get(pk=self.kwargs['pk']) return obj results in
'ArticleDetailView' object has no attribute 'filter_queryset' Please 
advise - pretty basic for django, new to me :) thanks


--
Tim
tj49.com

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e712d934-332a-aaa9-54cd-19aeaf8552a4%40akwebsoft.com.


Re: user visit count

2020-04-15 Thread Tim Wilson
I'm planning to use django-hitcount too, but please be aware that it's not yet 
compatible with Django 3.x. There's a patch that needs to be applied and a 
release forthcoming that should take care of it.

-Tim

On Wed, Apr 15, 2020, at 4:38 AM, Omkar Parab wrote:
> Django hit count package will help you..
> 
> On Wed, Apr 15, 2020, 1:09 PM shreehari Vaasistha L  
> wrote:
>> how can i get the number of views of an endpoint by a single user.
>> 

>> --
>>  You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>>  To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users+unsubscr...@googlegroups.com.
>>  To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/b9e434ba-8378-45cb-a67f-b344773340b6%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/b9e434ba-8378-45cb-a67f-b344773340b6%40googlegroups.com?utm_medium=email_source=footer>.
> 

> --
>  You received this message because you are subscribed to the Google Groups 
> "Django users" group.
>  To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
>  To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAJY8mfxe%3Dgx4YnJj_%2BWLuVD-iTaeNy0BhMR4U1_bAXa93ObAMg%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/django-users/CAJY8mfxe%3Dgx4YnJj_%2BWLuVD-iTaeNy0BhMR4U1_bAXa93ObAMg%40mail.gmail.com?utm_medium=email_source=footer>.

-- 
Tim Wilson
President, Savvy Technology Group
phone: 612-599-5470

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/602f830a-0d4d-44f5-b346-406b6b39b5db%40www.fastmail.com.


Re: Name clashes on custom commands

2020-04-10 Thread Tim Johnson

Ah. I see the logic of it. Similar to elisp, but different also.

Thank you

On 4/10/20 12:44 AM, Andréas Kühne wrote:

Hi Tim,

You need to make sure that your commands are unique in your project. 
Otherwise like you have discovered one overwrites the other. This is 
actually a good thing though - we use it in one of our projects to 
override the "runserver" command. The order of the applications in 
your project dictates which command is run.


Regards,

Andréas


Den fre 10 apr. 2020 kl 00:18 skrev Tim Johnson <mailto:t...@akwebsoft.com>>:


I have more of an observation than a question and it is likely
that any
responses may serendipitously enlighten me.

 From the contributions of good djangoists to an earlier query on my
part (subject ORM from the command line) I have been enlightened
about
custom commands and django-extensions and I couldn't be happier about
having more tools in my kit.

I used the create_command subcommand to create a custom subcommand
under
one app, called articles. It defaults as sample so I left it as such.
Tweaked it a bit to make it runnable and examined the output of
'python
manage.py help'. I could see there that 'sample' shows under the
[articles] header.

So, I repeated the create_command process to create a command under a
different app called pages. Again, the command is named
'sample.py' in
keeping with the default action.

I could then see 'sample' listed out under the [pages] heading and
indeed, that is the one and only command that is run.

My comment/question is : is there a way to resolve such command name
clashes? I saw no sign of an option that would allow associating like
names with different apps.

It is easy to resolve, of course: trivial example being
articles_sample.py and pages_sample.py

-- 
Tim

tj49.com <http://tj49.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
<mailto:django-users%2bunsubscr...@googlegroups.com>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/3c9455ae-ba2b-a3dd-a2b2-4306f1826160%40akwebsoft.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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCeEexFZC_gEGX%3D%3DoQnNP0CJqQGQv%3DLOmdovYw6K-c_NnA%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CAK4qSCeEexFZC_gEGX%3D%3DoQnNP0CJqQGQv%3DLOmdovYw6K-c_NnA%40mail.gmail.com?utm_medium=email_source=footer>.


--
Tim
tj49.com

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1383d7fe-094e-3869-956d-5ad80b5cc91d%40akwebsoft.com.


Name clashes on custom commands

2020-04-09 Thread Tim Johnson
I have more of an observation than a question and it is likely that any 
responses may serendipitously enlighten me.


From the contributions of good djangoists to an earlier query on my 
part (subject ORM from the command line) I have been enlightened about 
custom commands and django-extensions and I couldn't be happier about 
having more tools in my kit.


I used the create_command subcommand to create a custom subcommand under 
one app, called articles. It defaults as sample so I left it as such. 
Tweaked it a bit to make it runnable and examined the output of 'python 
manage.py help'. I could see there that 'sample' shows under the 
[articles] header.


So, I repeated the create_command process to create a command under a 
different app called pages. Again, the command is named 'sample.py' in 
keeping with the default action.


I could then see 'sample' listed out under the [pages] heading and 
indeed, that is the one and only command that is run.


My comment/question is : is there a way to resolve such command name 
clashes? I saw no sign of an option that would allow associating like 
names with different apps.


It is easy to resolve, of course: trivial example being 
articles_sample.py and pages_sample.py


--
Tim
tj49.com

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3c9455ae-ba2b-a3dd-a2b2-4306f1826160%40akwebsoft.com.


Re: ORM from the command line

2020-04-09 Thread Tim Johnson

Thank you too Adam.

Great stuff!

On 4/9/20 7:43 AM, Adam Mičuda wrote:

Hi,
you can also write simple python script and run it in Django context 
via 
https://django-extensions.readthedocs.io/en/latest/runscript.html from 
`django-extensions` package.


Best regards.
Adam

čt 9. 4. 2020 v 17:14 odesílatel Tim Johnson <mailto:t...@akwebsoft.com>> napsal:


Thank you Andréas. I have come across that too, after my OT.

This is definitely what I was looking for.

cheers

On 4/9/20 2:05 AM, Andréas Kühne wrote:

    Hi Tim,

What you probably should do is use a custom command on the
manage.py command interface. You till then get access to all of
djangos goodness - and it can be run from the command line.

See here:
https://docs.djangoproject.com/en/3.0/howto/custom-management-commands/

This is how I would handle it.

Regards,

Andréas


Den tors 9 apr. 2020 kl 00:18 skrev Tim Johnson
mailto:t...@akwebsoft.com>>:

using django.VERSION (2, 1, 5, 'final', 0) with

python 3.7.2 on ubuntu 16.04

I have a need for a "Housekeeping" application. It's usage
would be to

1) connect to a database, either mysql, mariadb or postgres

2) truncate two tables and repopulate them based on an
arbitrary data
structure such as a compound list or tuple.

Such an application would not need be and most preferably
should not be
part of a deployed website.

This should not be a very complicated endeavor. The simplest
method
might be to manually establish an ORM connection using
settings.py to
import the connection credentials. I am wondering if this is
possible.

However, I am unable to find documentation that would edify
me on
manually coding an ORM connection and clearing a database
without the
loading of django resources.

If such an approach is feasible, I would welcome URLs to
appropriate
documentation and/or discussion.

Using a model-view approach would be the simplest method, I
would think,
but there would be no need to have such a view deployed.
There is
probably a solution that would necessitate installing a
custom package
to be used from manage.py, such as
https://github.com/KhaledElAnsari/django-truncate and that
might be
complicated.

Comments are welcome

thanks

-- 
Tim

tj49.com <http://tj49.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
<mailto:django-users%2bunsubscr...@googlegroups.com>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/4be7c6fc-d99e-7419-24ef-d54cbdf384d4%40akwebsoft.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
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/CAK4qSCdSf%2BJ9ZufHavQqv-9ftOkOUwNODsFd-w6QQmzzK61j5Q%40mail.gmail.com

<https://groups.google.com/d/msgid/django-users/CAK4qSCdSf%2BJ9ZufHavQqv-9ftOkOUwNODsFd-w6QQmzzK61j5Q%40mail.gmail.com?utm_medium=email_source=footer>.


-- 
Tim

tj49.com  <http://tj49.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
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/35392bf4-d25a-95d6-fb32-bf09fd01e997%40akwebsoft.com

<https://groups.google.com/d/msgid/django-users/35392bf4-d25a-95d6-fb32-bf09fd01e997%40akwebsoft.com?utm_medium=email_source=footer>.

--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB9%3DGXbjT24BoEtw-_mUc7wS8WtX9kSFQnfKTmCmWEfv5nTomQ%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CAB9%3DGXbjT24BoEtw-_m

Re: ORM from the command line

2020-04-09 Thread Tim Johnson

Thank you Andréas. I have come across that too, after my OT.

This is definitely what I was looking for.

cheers

On 4/9/20 2:05 AM, Andréas Kühne wrote:

Hi Tim,

What you probably should do is use a custom command on the manage.py 
command interface. You till then get access to all of djangos goodness 
- and it can be run from the command line.


See here:
https://docs.djangoproject.com/en/3.0/howto/custom-management-commands/

This is how I would handle it.

Regards,

Andréas


Den tors 9 apr. 2020 kl 00:18 skrev Tim Johnson <mailto:t...@akwebsoft.com>>:


using django.VERSION (2, 1, 5, 'final', 0) with

python 3.7.2 on ubuntu 16.04

I have a need for a "Housekeeping" application. It's usage would be to

1) connect to a database, either mysql, mariadb or postgres

2) truncate two tables and repopulate them based on an arbitrary data
structure such as a compound list or tuple.

Such an application would not need be and most preferably should
not be
part of a deployed website.

This should not be a very complicated endeavor. The simplest method
might be to manually establish an ORM connection using settings.py to
import the connection credentials. I am wondering if this is possible.

However, I am unable to find documentation that would edify me on
manually coding an ORM connection and clearing a database without the
loading of django resources.

If such an approach is feasible, I would welcome URLs to appropriate
documentation and/or discussion.

Using a model-view approach would be the simplest method, I would
think,
but there would be no need to have such a view deployed. There is
probably a solution that would necessitate installing a custom
package
to be used from manage.py, such as
https://github.com/KhaledElAnsari/django-truncate and that might be
complicated.

Comments are welcome

thanks

-- 
Tim

tj49.com <http://tj49.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
<mailto:django-users%2bunsubscr...@googlegroups.com>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/4be7c6fc-d99e-7419-24ef-d54cbdf384d4%40akwebsoft.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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCdSf%2BJ9ZufHavQqv-9ftOkOUwNODsFd-w6QQmzzK61j5Q%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CAK4qSCdSf%2BJ9ZufHavQqv-9ftOkOUwNODsFd-w6QQmzzK61j5Q%40mail.gmail.com?utm_medium=email_source=footer>.


--
Tim
tj49.com

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/35392bf4-d25a-95d6-fb32-bf09fd01e997%40akwebsoft.com.


ORM from the command line

2020-04-08 Thread Tim Johnson

using django.VERSION (2, 1, 5, 'final', 0) with

python 3.7.2 on ubuntu 16.04

I have a need for a "Housekeeping" application. It's usage would be to

1) connect to a database, either mysql, mariadb or postgres

2) truncate two tables and repopulate them based on an arbitrary data 
structure such as a compound list or tuple.


Such an application would not need be and most preferably should not be 
part of a deployed website.


This should not be a very complicated endeavor. The simplest method 
might be to manually establish an ORM connection using settings.py to 
import the connection credentials. I am wondering if this is possible.


However, I am unable to find documentation that would edify me on 
manually coding an ORM connection and clearing a database without the 
loading of django resources.


If such an approach is feasible, I would welcome URLs to appropriate 
documentation and/or discussion.


Using a model-view approach would be the simplest method, I would think, 
but there would be no need to have such a view deployed. There is 
probably a solution that would necessitate installing a custom package 
to be used from manage.py, such as 
https://github.com/KhaledElAnsari/django-truncate and that might be 
complicated.


Comments are welcome

thanks

--
Tim
tj49.com

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4be7c6fc-d99e-7419-24ef-d54cbdf384d4%40akwebsoft.com.


Re: Mobile friendly admin

2020-04-02 Thread Tim Graham
What version of Django are you using?

https://github.com/elky/django-flat-responsive is an extension for the 
Django admin that makes the interface mobile-friendly. It's part of Django 
2.0 and later. 

On Wednesday, April 1, 2020 at 4:02:57 AM UTC-4, guettli wrote:
>
> I know there a several third party packages which try to improve the great 
> django admin:
>
> See: https://djangopackages.org/grids/g/admin-interface/
>
> A lot of packages are already outdated. AFAIK no sane and simple default 
> package exists.
>
> I think the only solution to this would be an improvement which is not a 
> third party package.
>
> With other words: An update of the original admin. AFAIK no major change 
> is planed by
> the core developers, or am I missing something?
>
> My goal: mobile friendly admin interface.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d3987c89-2f1a-43cf-8314-becf2b456b8d%40googlegroups.com.


Where to source a very large data structure.

2020-03-03 Thread Tim Johnson
I am building a site that will render articles and essays. They will be 
arranged by topic.


 An index of topics will be rendered. Once a topic is selected, a list 
of articles will be rendered as a secondary index.


I propose to control this rendering using two data structures that will 
grow in size as articles and/or topics are added.


One data structure would be a list or tuple of topics. The other would 
be a dictionary where topics are the keys.


As I am new to django, I am not sure where to source such data 
structures? Models.py or perhaps a new, dedicated module?


python = 3.7.2

django.VERSION = (2, 2, 6, 'final', 0)

thank you

--
Tim
tj49.com

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4df33f3e-98d6-a488-7141-d64aeb6e3ed7%40akwebsoft.com.


Re: Is this mistake in utils.functional?

2020-02-06 Thread Tim Graham
The code is equivalent to:

res = self.func(instance)
instance.__dict__['self.name'] = self.func(instance)

(except that self.func(instance) isn't called twice like it would be in 
this version)

On Thursday, February 6, 2020 at 7:39:47 AM UTC-5, Akira Furude wrote:
>
> Currently I'm working on my website, and has debugging it for a while.
> Using breakpoint() function I found bug/mistake/missed error in 
> *django/utils/functional.py **cached_property.__get__(), line 48*.
> That line contains this: res = instance.__dict__[self.name] = self.func
> *(instance)*.
> May be I don't understand a lot in Python, but I think between instance.
> __dict__[self.name] and self.func*(instance)* should be check for 
> equality *(==) *statement.
> That version also proving Python interpreter itself, if you type in 
> terminal this: *print(*instance.__dict__[self.name] = self.func
> *(instance))*.
> Has attached the screenshot to proof 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e2a0819e-0d98-42ed-a49b-cfcea0e8ae31%40googlegroups.com.


Re: Where to set the DATABASE_URL environment variable on Heroku

2019-12-07 Thread Tim Johnson


On 12/6/19 9:09 PM, Jorge Gimeno wrote:


On Fri, Dec 6, 2019 at 5:40 PM Tim Johnson <mailto:t...@akwebsoft.com>> wrote:


Despite the voluminous Heroku documentation I am unable to establish
where to initialize the DATABASE_URL that would establish credentials
for my deployed database.

Heroku's documentation uses the following example

DATABASE_URL=$(heroku config:get HEROKU_POSTGRESQL_TIMS_URL -a
timsapp)

But I am not clear where this initialization code should live

would it be in the procfile? If so, what process should I use.
Release?
Worker?

OR

Would it be in an .env file?
... snip ...

I believe DATABASE_URL is set on Heroku itself as a configuration 
variable.  If you provision the database in Heroku, it will be set for 
you.  See here: 
https://devcenter.heroku.com/articles/heroku-postgresql#provisioning-heroku-postgres


Thank you Jorge, I have read that section too:

The following is highlighted as a warning on that:

"""

The value of your app’s |DATABASE_URL| config var might change at any time.

You should not rely on this value either inside or outside your Heroku app.

"""

that is precisely why I have asked this question.

more discussion of this issue is found at 
https://devcenter.heroku.com/articles/connecting-to-heroku-postgres-databases-from-outside-of-heroku


and a search for "DATABASE_URL=$("  will give an example of how to set 
DATABASE_URL from the Heroku command line.


That approach begs for a script but I am unsure of what script file to 
use. .env or Procfile or some other.


Thanks again Jorge

--
Tim
tj49.com

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/14cf27a4-eb56-5925-fcf8-50ca3344f9e8%40akwebsoft.com.


Where to set the DATABASE_URL environment variable on Heroku

2019-12-06 Thread Tim Johnson
Despite the voluminous Heroku documentation I am unable to establish 
where to initialize the DATABASE_URL that would establish credentials 
for my deployed database.


Heroku's documentation uses the following example

DATABASE_URL=$(heroku config:get HEROKU_POSTGRESQL_TIMS_URL -a timsapp)

But I am not clear where this initialization code should live

would it be in the procfile? If so, what process should I use. Release? 
Worker?


OR

Would it be in an .env file?

Using django 2.1.5, python 3.7

examples welcome :)

thanks

--
Tim
tj49.com

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a02698e8-e71a-5d42-728d-4c6d012bbb84%40akwebsoft.com.


Re: CockroachDB & Django

2019-12-05 Thread Tim Graham
Cockroach Labs engaged me to work on the CockroachDB backend for Django.

django-cockroachdb 2.2 alpha 2 (for Django 2.2.x) and 3.0 alpha 1 (for 
Django 3.0.x) are now available. These versions pass much of the Django 
test suite and are ready for real world testing.

Be aware that the latest release of CockroachDB, 19.2.1, has some bugs and 
limitations which are documented in django-cockroachdb's README. The 
CockroachDB team expects to address some of the bugs in the 19.2.2 release 
due out in the next several weeks.

GitHub: https://github.com/cockroachdb/django-cockroachdb
PyPI: https://pypi.org/project/django-cockroachdb/

On Monday, July 8, 2019 at 7:29:41 PM UTC-4, Andy Woods wrote:
>
> Hello All! 
>
> I'm a product manager at Cockroach Labs 
>  working on our SQL product 
> area. CockroachDB leverages the Postgres wire protocol to provide 
> distributed SQL to our customers. Because we support the same protocol as 
> Postgres, we can often take advantage of the drivers, ORMs, and tools 
> already created for Postgres with CockroachDB. 
>
> Over the years we've seen community interest 
>  in making a 
> CockroachDB specific implementation of Django. In fact, one of our 
> engineers even went so far as to build a working prototype 
>  that passes the 
> initial Django tutorial. 
>
> We are now seeking help from experts in the Django community in advancing 
> our prototype to the next level. We would happily welcome contributors to 
> our open-source Django prototype. 
>
> We'd also love any beta testers who would be willing to give our prototype 
> a try and provide feedback to us.
>
> If this is something you might be interested in, please let me know.
>
> Thank you! 
>
> Andy
>
> an...@cockroachlabs.com 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/51aeb94b-9d57-41c0-80d8-c4a4491aa1e8%40googlegroups.com.


Re: Fixtures for django auth groups

2019-12-03 Thread Tim Graham
Take a look at https://docs.djangoproject.com/en/stable/howto/initial-data/.

On Tuesday, December 3, 2019 at 10:31:01 AM UTC-5, Arulselvam K wrote:
>
> I want to create fixtures for auth groups to get some preloaded auth 
> groups. Kindly educate me on how to create fixtures fixtures for built in 
> django models
>
> Thanks and regards,
> Arulselvam K
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b36c369b-1c17-44a3-893f-87c364c0a076%40googlegroups.com.


Re: no such table: main.auth_user__old

2019-12-01 Thread Tim Graham
If you're using Django 2.1, try upgrading to the latest Django 2.1.x 
(2.1.14 as of this writing). You should always use the latest point release 
to get the most recent security and bug fixes. 

See 
https://stackoverflow.com/questions/53637182/django-no-such-table-main-auth-user-old

On Saturday, November 30, 2019 at 1:54:04 PM UTC-5, Chetan Rokade wrote:
>
> Hi Friends
> Getting below error while adding new user  from admin page. I am using 
> python 3.8 with django 2.1 version
> Exception Value: 
>
> no such table: main.auth_user__old   
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c9442dfe-3759-4592-9629-5ad1f9d50835%40googlegroups.com.


Re: Choosing MySQL or PostGres on Heroku

2019-11-28 Thread Tim Johnson


On 11/27/19 6:53 PM, Leon Vaks wrote:

Hello Tim,

I was given the same advice to convert to PostgreSQL because 
PostgreSQL is Horizontally scalable.

I did some research:
Horizontal scaling means that you scale by adding more machines into 
your pool of resources whereas Vertical scaling means that you scale 
by adding more power (CPU, RAM) to an existing machine.

MySQL has many different storage engines:
https://dev.mysql.com/doc/refman/8.0/en/storage-engines.html 
<https://slack-redir.net/link?url=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F8.0%2Fen%2Fstorage-engines.html>
The most popular storage engine among developers is InnoDB. For MySQL 
version 8, it can go up to 64 Terabytes per server.
However, storage engine - ndb allows unlimited horizontal scaling by 
adding nodes. Ndb stands for network db and used by number of telcos 
and gaming publishers. Ndb is super fast because it is in memory 
database (similar to SAP Hana); however, it requires more knowledge to 
setup and configure then Innodb storage engine. Innodb storage engine 
is more popular among development teams because it is more simple to 
configure and administer.
Both engines can handle transactions. In addition, both engines can 
work with SQL data as well as NoSQL data i.e. you do not need to add 
additional databases like Mongodb. For Big data, using Hadoop and 
MySQL, use Hadoop Applier. MySQL team developedAnalytical Engine which 
can do data analytics in the cloud; however, I am not sure if this 
service will be officially available in this coming release.


I hope this helps,
Happy Holiday to Everyone.
Leon

On Wed, Nov 27, 2019 at 6:34 PM Tim Johnson <mailto:t...@akwebsoft.com>> wrote:


Using python 3.7.2, Django 2.1.5 on Linux development workstation
with
deployment to Heroku.

I retired several ago, primarily coding in python and mostly
working in
legacy CGI systems with MySQL backends and still use mysql on my
workstation.

I am now essentially a hobbyist who wishes to use a django website to
publish articles, memoirs and essays.

Some have urged me to convert to PostGresql as it is "baked into"
heroku. However, my comfort level is with mysql.

Given my situation I'd welcome any reason why I should convert to
postgresgl. I am not interested in stirring up controversy. Should
there
be a pressing reason to convert to PG I'd sooner do it now than when
I've a couple of hundred articles published.

Any insights would be appreciated.


Thank you Leon.

Great analysis!


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3245d9a3-b09e-a6fa-87f7-3c01fd95e319%40akwebsoft.com.


Choosing MySQL or PostGres on Heroku

2019-11-27 Thread Tim Johnson
Using python 3.7.2, Django 2.1.5 on Linux development workstation with 
deployment to Heroku.


I retired several ago, primarily coding in python and mostly working in 
legacy CGI systems with MySQL backends and still use mysql on my 
workstation.


I am now essentially a hobbyist who wishes to use a django website to 
publish articles, memoirs and essays.


Some have urged me to convert to PostGresql as it is "baked into" 
heroku. However, my comfort level is with mysql.


Given my situation I'd welcome any reason why I should convert to 
postgresgl. I am not interested in stirring up controversy. Should there 
be a pressing reason to convert to PG I'd sooner do it now than when 
I've a couple of hundred articles published.


Any insights would be appreciated.

thanks

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6a3619c5-6c72-0c80-49c4-de0926a5041f%40akwebsoft.com.


Re: Hosting

2019-05-25 Thread Tim Chase
On 2019-05-24 23:19, Prakash Borade wrote:
> Friends tell me is hostgator.in server support django or not.

Hostgator used to be a decent company until they were bought out by
EIG, a parent company with a reputation of buying up good hosting
companies and turning them into a bucket of suck.  They over allocate
their shared hosts, customer/technical service is slow and
inconvenient (they tend to shut down email and web case submission in
favor of chat, but then are slow to answer chats if at all; nagging
on Twitter will get a "please give us the case# and we'll escalate
it" which largely means they'll actually look at it)

I had service with one that got bought out by EIG and turned
horrible (and AFAICT, ended up going under as a business), so I fled
to another (Site5) which also got bought out by EIG and also turned
horrible. So I'd avoid any EIG property unless you don't care about
the quality of your hosting:

https://www.linux-depot.com/non-endurance-international-group-eig-hosting/

I have good things to say (from either personal experience or the
experiences of those I trust) about Digital Ocean, Heroku, Linode,
OVH, and Vultr.

-tkc


-- 
You received this message because you are subscribed to the Google 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/20190525074048.56e46d94%40bigbox.christie.dr.
For more options, visit https://groups.google.com/d/optout.


Fine-tuning rich text displays

2019-05-24 Thread Tim Johnson
django 2.1.5 python 3.7.2

My django website is used to display articles in rich text format
with embedded images created by copying and pasting from libreoffice
documents.  I have no major roadblock to complain about, but there
are a number of details that I'd like to clean up. 

Things are coming together, but I could use pointers and optimizing
tips about things like:

django-template filters
div containers
css classes
content types

I'd appreciate URLs to discussions, tips, tricks, caveats,
tutorials, etc, but most important would be


keywords


I mean, you can find almost anything on google _if_ you know the
right keywords ... could use more of those.

thanks
-- 
Tim Johnson
http://www.tj49.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/20190524192520.GB2347%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1 project, X app = X subdomains (Django, Apache)

2019-05-23 Thread Tim Chase
On 2019-05-23 06:22, Jakub Jiřička wrote:
> I want to ask you if someone has solved how to prove that is
> possible the applications in one project run in different
> subdomains?
>
> I have 1 project (projekt.cz) and provide of 3 applications (app1,
> app2, app3) and I would like to get on my vps (CentOS, Apache,
> PostgreSQL, Django) app1.projekt.cz app2.projekt.cz and
> app3.projekt.cz

I can read two interpretations of what what you describe:

1) each application is distinct/independent and you want each one to
run on its own subdomain.  This seems like the most sensible
interpretation and is fairly straightforward:  you configure your
web server (apache, from your description) to farm out different
subdomains:

  
   ServerName app1.example.com
   DocumentRoot /var/www/vhosts/app1
   WSGIScriptAlias / /var/www/vhosts/app1/myproject1/wsgi.py
   ⋮
  
  
   ServerName app2.example.com
   DocumentRoot /var/www/vhosts/app2
   WSGIScriptAlias / /var/www/vhosts/app2/myproject2/wsgi.py
   ⋮
  

with the relevant configuration in each block.


2) if you want to run the same Django code, backing multiple
subdomains with the same codebase, you want a wildcard subdomain
pointed at 

  
   ServerAlias *.example.com
   ⋮
  

and then sniff the Host: HTTP header which something like
django-subdomains helps to make easier.

> I searched everywhere and I found only django-subdomains and
> django-domains ... unfortunately, I have not managed to get
> started, because out-of-date 

I'm not sure what you mean by "because out-of-date".  While
they both appear to have been last updated in 2016, I imagine they
got to the point where they just worked and didn't need much more
care & feeding.  I'd assume they're fine unless you hit an issue with
them.

-tkc











-- 
You received this message because you are subscribed to the Google 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/20190523123847.3561d870%40bigbox.christie.dr.
For more options, visit https://groups.google.com/d/optout.


Re: formfield_overrides doesn't work

2019-05-12 Thread Tim Johnson
* Jim Illback  [190512 14:22]:
> Tim, this won’t help you to use or solve the formfield_overrides issues, but 
> maybe it will be helpful. I’ve not tried this for a CharField, but it works 
> great on a TextField (which has no max_length, so model size isn’t impacted):
> 
> 1. Install  widget tweaks and add {% load widget_tweaks %} at the top of your 
> HTML page.
> 2. On your HTML page, instantiate the field using this format: {{ 
> form.notes|attr:"rows:20"|attr:"cols:50" }} - you can use either row/cols or 
> both as in this case, and any char size.
> 
> Here’s a great usage example on widget tweaks: 
> https://simpleisbetterthancomplex.com/2015/12/04/package-of-the-week-django-widget-tweaks.html.
> 
> I hope this is useful for you.
  Thanks Jim. I had seen references to 'tweaks'
  and I will give it a try.
  cheers
-- 
Tim Johnson
http://www.tj49.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/20190512235055.GG2372%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.


Re: formfield_overrides doesn't work

2019-05-12 Thread Tim Johnson
* Joe Reitman  [190512 13:34]:
> Tim,
> 
> I found this in the Django source code on Github searching for 
> 'formfield_overrides'. It is in a test module testing formfield_overrides 
> functionality. I'm assuming you imported TextInput from forms? This should 
> work to change your *admin* display. Are trying to change your Admin panel 
> form or a form going out to the user?
> 
> 
> class BandAdmin(admin.ModelAdmin):
>  formfield_overrides = {
>  CharField: {'widget': forms.TextInput(attrs={'size': '10'})}
>  }
  I am trying to change a form going to the user. 
  The form in the admin page __does__ show the size attribute in
  the HTML source code for input/text.

  So it appears that formfield_overrides only affects the admin
  page.

  I'm going to call this solved - given that I can "widen" the field
  with css.

  Thanks again Joe. You've been a great help and I've learned a lot.
  cheers

-- 
Tim Johnson
http://www.tj49.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/20190512220300.GF2372%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.


Re: formfield_overrides doesn't work

2019-05-12 Thread Tim Johnson
* Joe Reitman  [190512 10:31]:
> Tim,
> 
> Here is an example of a custom form field limiting the input to 100 
> characters. The model is defined to accept 255 chars. BTW, the text widget 
> 'attrs' sets the HTML form element attributes.
> 
> class SearchForm(forms.Form):
> 
>  search_for = forms.CharField(
>  label='',
>  label_suffix='',
>  max_length=100,
>  required=True,
>  widget=forms.TextInput(attrs={'placeholder': 'search', ' autofocus': ''}),
>  help_text='',
>  error_messages={'required': ''},
>  )
  Hi Joe:
  Thanks for the reply.
  I did try using a custom class in admin.py
  class LongTextinput(TextInput):
def __init__(self, *args, **kwargs):
attrs = kwargs.setdefault('attrs', {})
# code below aims to add a size="100" attribute
# to rendered html
attrs.setdefault('size', 100)
super(LongTextinput, self).__init__(*args, **kwargs)
implemented with formfields_ovverides as 
in :
formfield_overrides = {
models.CharField: {'widget': LongTextinput},
}
but did not have the desired effect.

the larger question is:
why is formfield_overrides not having the effect I expected?
I.E. size="100" is added to the rendered html.

According to documentation the implementation should be pretty straightforward.

Do you suppose that there is a particular plugin that enables 
formfield_overrides?

**OR** is {{ form.as_p }} in the template inhibiting the rendering?

My goal was not to change the max_length attribute, but the size attribute in
the rendered HTML code.

For the record, css widens the input field, and that gave me the
input width I sought, but the edification I seek is to understand
how to use formfield_overrides.

cheers
-- 
Tim Johnson
http://www.tj49.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/20190512190206.GE2372%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.


Re: formfield_overrides doesn't work

2019-05-11 Thread Tim Johnson
* Tim Johnson  [190511 11:20]:
> django 2.1.5 with python 3.7.2
> 
> I have a models.py class as follows:
> class Article(models.Model):
> title = models.CharField(max_length=255,)
>
> And I want to override the rendered default size attribute to 100 in
> the input/text form field.
> 
> the template rendering is done as follows
> 
> {% csrf_token %}
> {{ form.as_p}}
> Save
> 
> 
> in the application admin.py I have the following:
> class ArticleAdmin(admin.ModelAdmin):
> formfield_overrides = {
> models.CharField: {'widget': TextInput(attrs={'size': '100'}), },
> }
> # registered as 
> admin.site.register(Article, ArticleAdmin)
> 
> Sadly it appears to have no effect.
> Viewing the rendered source, I do not see a size attribute.
> the field is rendered as:
> 
> 
  Still no luck. 
  Tried a custom class:

class LongTextinput(TextInput):
def __init__(self, *args, **kwargs):
attrs = kwargs.setdefault('attrs', {})
attrs.setdefault('size', 100)
super(LongTextinput, self).__init__(*args, **kwargs)
...
formfield_overrides = {
models.CharField: {'widget': LongTextinput},
}

No luck.
Replace admin.site.register with decorator:
@admin.register(Article)
still no luck.

ArticleAdmin has an additional item, with
full code below
@admin.register(Article)
class ArticleAdmin(admin.ModelAdmin):
inlines = [CommentInline]
formfield_overrides = {
models.CharField: {'widget': LongTextinput},
}

It appears that inlines is being executed.
It says right here:
https://stackoverflow.com/questions/910169/resize-fields-in-django-admin

that it is supposed to be easy, but after hours of tweaking, I'm convinced that
formfield_overrides is being ignored.

-- 
Tim Johnson
http://www.tj49.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/20190511234232.GD2372%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.


formfield_overrides doesn't work

2019-05-11 Thread Tim Johnson
django 2.1.5 with python 3.7.2

I have a models.py class as follows:
class Article(models.Model):
title = models.CharField(max_length=255,)
 
And I want to override the rendered default size attribute to 100 in
the input/text form field.

the template rendering is done as follows

{% csrf_token %}
{{ form.as_p}}
Save


in the application admin.py I have the following:
class ArticleAdmin(admin.ModelAdmin):
formfield_overrides = {
models.CharField: {'widget': TextInput(attrs={'size': '100'}), },
}
# registered as 
admin.site.register(Article, ArticleAdmin)

Sadly it appears to have no effect.
Viewing the rendered source, I do not see a size attribute.
the field is rendered as:


Have I ommited a step?
thanks
-- 
Tim Johnson
http://www.tj49.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/20190511190931.GC2372%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.


Unit conversions between model field value and form field value

2019-05-07 Thread Tim Bell
Hi,

I have a model with an integer field storing a duration in hours, while I 
want to present that to users in a form in days. (The choice of these 
different units is imposed by other factors not under my control.)

So, when saving a form, I need to convert a value in days to hours by 
multiplying by 24. I've done that with a clean_() method on the 
form, as described at 
https://docs.djangoproject.com/en/2.2/ref/forms/validation/. That works 
fine for when saving a new model.

When editing an existing model however, I need to take the value from the 
model stored in hours, and convert that to days for display in the edit 
form. I've considered various places where I could do that conversion, for 
instance in the edit view, or the form __init__() method, or the model 
field's value_from_object() method, but none of those choices seem like the 
obvious choice, and I can't find a recommendation for how to do this either.

What would you suggest? And is the recommended approach actually documented 
somewhere that I've missed?

Thanks,

Tim

-- 
You received this message because you are subscribed to the Google 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/0d786f87-8c6e-4e0d-abc5-aaa66ab4da2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: WYSIWYG/Rich Text Editor recommendations

2019-05-06 Thread Tim Johnson
* Joel Mathew  [190430 17:29]:
> Currently I'm using quill. It's easy to implement, and has all basic
> features.

 Joel - perhaps you could check out another thread I started:
 subject - "quill tries to import deprecated django.forms.util"
 
 What version of django are you using?

 thanks again

-- 
Tim Johnson
http://www.tj49.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/20190507004739.GK2404%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.


Re: Website slowed down drasticaly

2019-05-06 Thread Tim Chase
On 2019-05-06 00:20, Saurabh Adhikary wrote:
> The point is , there are no major change that was deployed on to
> the code since Dec'18. 
> As I did mention that there has been some minor load increase of
> our users in the new year since Jan, but the change is not
> significant. (Originally we had around 2million unique people ,
> ~5million approx approx users in total, and around 50K new users
> during this time)

I imagine that, if nothing changed in the code, and nothing changed
in the back-end server infrastructure (no changes to your DB
settings, server hardware, etc), but there was an increase in
traffic, then I imagine the issue stems from some unfortunate scaling
issues.  Often this is either related to poor choices for indexing in
the database or some algorithm that used to work fine with smaller
datasets but fails to scale to larger numbers of users.

-tim



-- 
You received this message because you are subscribed to the Google 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/20190506054858.57754fa2%40bigbox.christie.dr.
For more options, visit https://groups.google.com/d/optout.


quill tries to import deprecated django.forms.util

2019-05-05 Thread Tim Johnson
Using python 3.7.2 and django 2.1.5
quill was installed via pip

I'm getting the following:

/quill/widgets.py", line 3, in 
from django.forms.util import flatatt
ModuleNotFoundError: No module named 'django.forms.util'

Indeed. In django with python 3.7.2 the module is now
forms.utils not forms.util

Before I set to hacking venv code and since I know there are quill
users on this list, I should ask: 
  Is there a later quill available for download with correct changes?

thanks
-- 
Tim Johnson
http://www.tj49.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/20190506004059.GI2404%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.


Re: WYSIWYG/Rich Text Editor recommendations

2019-05-04 Thread Tim Johnson
* Tim Johnson  [190430 16:27]:
> Using python 3.7.2 and django 2.1.5
> 
> Production is in Ubuntu 16.04 and prospective deployment is likely
> to be CentOS with same python/django.
> 
> I'm a retired python developer.
> 
> I'd welcome recommendations and/or caveats regarding  a stable
> WYSIWIG "plugin".
  Thanks to all for the recommendations. It will just be all the
  more edifying for me to try both tinymce and quill.

  cheers
-- 
Tim Johnson
http://www.tj49.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/20190504155745.GG2404%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.


Re: WYSIWYG/Rich Text Editor recommendations

2019-04-30 Thread Tim Johnson
* Joel Mathew  [190430 17:29]:
> Currently I'm using quill. It's easy to implement, and has all basic
> features.

  Cool. Thanks for that Joel.

> > I'd like to recreate the same functionality with django. I will need
> > to be able to include embedded images.

-- 
Tim Johnson
http://www.tj49.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/20190501024004.GE2404%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.


WYSIWYG/Rich Text Editor recommendations

2019-04-30 Thread Tim Johnson
Using python 3.7.2 and django 2.1.5

Production is in Ubuntu 16.04 and prospective deployment is likely
to be CentOS with same python/django.

I'm a retired python developer.

I'd welcome recommendations and/or caveats regarding  a stable
WYSIWIG "plugin".

Much is available on google, but it is always edifying to hear
individual comments.

I currently publish on drupal using its ckeditor plugin. My common
method is to compose articles in LibreOffice, then copy and paste
into the editor. Works well, except that it IS drupal.

I'd like to recreate the same functionality with django. I will need
to be able to include embedded images.

TIA
-- 
Tim 
http://www.tj49.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/20190501001716.GD2404%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrading Django from 1.11 to 2.2

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f86c4ebd-b81e-4239-a561-ba196c67e40b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrading Django from 1.11 to 2.2

2019-03-30 Thread Tim Graham
Consider the "Upgrading Django to a newer version" guide.
https://docs.djangoproject.com/en/stable/howto/upgrade-version/

On Friday, March 29, 2019 at 4:52:10 AM UTC-4, Uri Even-Chen wrote:
>
> Hi,
>
> I want to upgrade Django from 1.11 to 2.2. Do I have to upgrade first to 
> 2.0 and then to 2.1, or can I upgrade directly from 1.11 to 2.2?
>
> By the way, we use many third-party packages and I'm not sure which 
> version of Django they support. Maybe not all of them already support 
> Django 2.2.
>
> Thanks!
> אורי
> u...@speedy.net 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/00868231-d3a9-4d4d-ab8e-f5de77c28745%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django ForeignKey field name “check” raises SystemCheckError

2019-02-20 Thread Tim Graham
I believe the warning is incorrect. See 
https://code.djangoproject.com/ticket/23615 for the disucssion.

On Wednesday, February 20, 2019 at 12:25:46 PM UTC-5, Eric Palmitesta wrote:
>
> The Django docs (
> https://docs.djangoproject.com/en/1.11/topics/db/models/#field-name-restrictions)
>  
> state there are only two restrictions on model field names:
>
>
>1. A field name cannot be a Python reserved word
>2. A field name cannot contain more than one underscore in a row
>
>
> However, given the following example, it doesn't look like I can use the 
> field name `check` as a ForeignKey.
>
> class Check(models.Model):
>
>
> name = models.CharField(max_length=100)
>
>
> class MyModel(models.Model):
>
>
> # this works fine
> #check = models.BooleanField()
> 
> # this breaks
> check = models.ForeignKey(Check, on_delete=models.PROTECT, 
> related_name='+')
>
> Here's the error:
>
> $ python manage.py check
> SystemCheckError: System check identified some issues:
>
>
> ERRORS:
> myapp.MyModel: (models.E020) The 'MyModel.check()' class method is 
> currently overridden by  ForwardManyToOneDescriptor object at 0x03A818D0>
>
>
> Are the docs wrong, or am I doing something wrong?
>
> This project is using Python 2 and Django 1.11
>
> Here's the StackOverflow question: 
> https://stackoverflow.com/questions/54681167/
>

-- 
You received this message because you are subscribed to the Google 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/6a98e996-5f00-4be4-88e0-456dcff7ba96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Messages rejected?

2019-02-14 Thread Tim Graham
I don't know what happened. I doubt that the message was rejected by a 
moderator.

On Wednesday, February 13, 2019 at 5:49:39 PM UTC-5, Anton Melser wrote:
>
> Thanks for the reply. I thought there might be a moderation queue (I never 
> made it as far as the dedicate list docs). I would be quite interested in 
> finding out what was inappropriate about my first attempt at posting and 
> what changed so that my second attempt (with a different email) was 
> acceptable. I would like to make sure any future questions I post to the 
> list are in the right form. Is that possible somehow, do you know?
>
> Thanks.
>
> On Thu, 14 Feb 2019 at 02:38, Tim Graham > 
> wrote:
>
>> Messages from first time posters go through a moderation queue.
>>
>> On Tuesday, February 12, 2019 at 9:56:26 PM UTC-5, Anton Melser wrote:
>>>
>>> Hi,
>>> I asked a question last night with a Google for business account and had 
>>> the message bounce - is that normal? 
>>>
>>> Google also hasn't kept the message anywhere so it's completely lost :(.
>>>
>>> Anton
>>>
>>> ps. Also posted to see whether this will also bounce...
>>>
>> -- 
>> You received this message because you are subscribed 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/2121f6d2-a61c-40e1-97e8-40591b6a7046%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/2121f6d2-a61c-40e1-97e8-40591b6a7046%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc
> This will help you for 99.9% of your 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/074c9d96-6509-4e93-9066-466ac5810d6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: AuthenticationForm 'data' keyword argument?

2019-02-14 Thread Tim Graham
>From the docs for AuthenticationForm: "Takes request as its first 
positional argument, which is stored on the form instance for use by 
sub-classes."

https://docs.djangoproject.com/en/dev/topics/auth/default/#django.contrib.auth.forms.AuthenticationForm

On Thursday, February 14, 2019 at 7:47:23 AM UTC-5, james.pete...@gmail.com 
wrote:
>
> Hi,
>
> I have just been following the Django documention on forms:
>
> https://docs.djangoproject.com/en/2.1/topics/forms/
>
> And I was having an issue with validating the posted data in the view 
> code. 
>
> I came across this Stack Overflow post :
>
>
> https://stackoverflow.com/questions/45824046/djangos-authentication-form-is-always-not-valid
>
> Where the solution to my problem was to use the data Keyword argument when 
> creating a form from the POST'd data. Looking back on the docs I noticed 
> that this wasn't specified. 
>
> So my view function now looks like this:
>
> def login(request):
> if request.method == 'POST':
> form = LoginForm(data=request.POST)  #<- This is where I had to use 
> the data kwarg
> if form.is_valid():
> return HttpResponseRedirect('#')
> return render(request, 'scoreboard/login.html', {'form': form})
> else:
> return render(request, 'scoreboard/login.html', {'form': LoginForm()})
>
>
>
>
> [image: data kwarg.png]
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To 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/b02ec303-62b9-40ea-b048-f181aeb62a9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Messages rejected?

2019-02-13 Thread Tim Graham
Messages from first time posters go through a moderation queue.

On Tuesday, February 12, 2019 at 9:56:26 PM UTC-5, Anton Melser wrote:
>
> Hi,
> I asked a question last night with a Google for business account and had 
> the message bounce - is that normal? 
>
> Google also hasn't kept the message anywhere so it's completely lost :(.
>
> Anton
>
> ps. Also posted to see whether this will also bounce...
>

-- 
You received this message because you are subscribed to the Google 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/2121f6d2-a61c-40e1-97e8-40591b6a7046%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 2.2a1: django-admin migrate throws UnicodeEncodeError

2019-02-12 Thread Tim Graham
This was reported as crashing on Windows 
in https://code.djangoproject.com/ticket/30184 so we might revert the 
change.

On Friday, February 1, 2019 at 3:45:39 PM UTC-5, Tim Graham wrote:
>
> I think your shell/terminal isn't configured for Unicode. Take a look here 
> for some ideas about how to solve it: 
> https://stackoverflow.com/questions/9942594/unicodeencodeerror-ascii-codec-cant-encode-character-u-xa0-in-position-20/39293287
>
> On Friday, February 1, 2019 at 1:49:07 PM UTC-5, axel...@chaos1.de wrote:
>>
>> Hi, 
>>
>>  File 
>> "/usr/local/py_venv/erdb2-django/lib/python3.6/site-packages/django/core/management/commands/migrate.py",
>>  
>> line 266, in migration_progress_callback 
>> self.stdout.write("  Applying %s\u2026" % migration, ending="") 
>>   File 
>> "/usr/local/py_venv/erdb2-django/lib/python3.6/site-packages/django/core/management/base.py",
>>  
>> line 145, in write 
>> self._out.write(style_func(msg)) 
>> UnicodeEncodeError: 'ascii' codec can't encode character '\u2026' in 
>> position 48: ordinal not in range(128) 
>>
>> Should stdout not receive ASCII only? 
>>
>> Someone changed here 3 dots to ellipsis character: 
>> 
>> https://github.com/django/django/commit/50b8493581fea3d7137dd8db33bac7008868d23a#diff-e835ddfb52774b39749788a0d046e477
>>  
>>
>> Axel 
>> --- 
>> PGP-Key:29E99DD6  ☀  computing @ chaos claudius 
>>
>>

-- 
You received this message because you are subscribed to the Google 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/695ffb4c-46bc-4059-9807-2bf5db18c137%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: get_expiry_age does not use expire_date column.

2019-02-05 Thread Tim Graham
Hi Shen, I haven't looked into this much but 
https://code.djangoproject.com/ticket/19201 could be related. Feel free to 
offer a patch to improve the situation.

On Monday, February 4, 2019 at 12:59:16 PM UTC-5, Shen Li wrote:
>
> Hi community,
>
> I find it strange that in the DB session backend, the get_expiry_age does 
> not actually use the value from expire_data column in the model.
>
> What is the indention of this design?
>
> Thank you!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To 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/0d01157f-987f-4574-b4b5-3e7a782ca078%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Model's verbose_name not getting used as field label when specifying a field type in ModelForm

2019-02-01 Thread Tim Graham
When you add a form field like that, it removes inheritance of field 
attributes like verbose_name from the model.

Instead, you could override Form.__init__() and set the widget similar to 
what's described at 
https://docs.djangoproject.com/en/stable/ref/forms/widgets/ "Or if the 
field isn’t declared directly on the form..."

I think it would be: self.fields['who'].widget = forms.Textarea()

On Friday, February 1, 2019 at 5:08:48 PM UTC-5, Michael Corey wrote:
>
> I'm having trouble getting the verbose_name attribute of a model field to 
> show up when rendering a ModelForm. instead, the label uses the pretty 
> version of the field name, not the verbose_name. This occurs any time I 
> specify a field type, and works properly (shows the verbose_name) if I 
> don't specify a field type.
>
> Version 1: This works (i.e. it shows the verbose name as the label)...
> ```
> # models.py
>
> class Pitch(models.Model):
> dummy = models.CharField(verbose_name="not a real field just so I can 
> exclude something for this bug report")
> who = models.TextField(max_length=3000, verbose_name="In a few lines, 
> tell us what your story is about and what question your story is trying to 
> answer.")
>
>
> # forms.py
> class PitchForm(forms.ModelForm):
> class Meta:
> model = Pitch
> excludes = ['dummy']
>
> # pitchform.html
>
>  {% for field in form %}
>   {{ field.label }}
>   
>   {{ field.errors }}
>   {{ field.label_tag }} {{ field }}
>   {% if field.help_text %}
>   {{ field.help_text|safe }}
>   {% endif %}
>   
>   {% endif %}
>  {% endfor %}
>
> ```
>
> Version 2: This does not work (shows a prettified version of the field 
> name, not the verbose_name). The only difference is specifying a CharField 
> in forms.py
> ```
> # models.py
>
> class Pitch(models.Model):
> dummy = models.CharField(verbose_name="not a real field just so I can 
> exclude something for this bug report")
> who = models.TextField(max_length=3000, verbose_name="In a few lines, 
> tell us what your story is about and what question your story is trying to 
> answer.")
>
>
> # forms.py
> class PitchForm(forms.ModelForm):
> who = forms.CharField(widget=forms.Textarea)
> 
> class Meta:
> model = Pitch
> excludes = ['dummy']
>
> # pitchform.html
>
>  {% for field in form %}
>   {{ field.label }}
>   
>   {{ field.errors }}
>   {{ field.label_tag }} {{ field }}
>   {% if field.help_text %}
>   {{ field.help_text|safe }}
>   {% endif %}
>   
>   {% endif %}
>  {% endfor %}
>
> ```
>
> Am I doing it 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/7f2a8cbc-6707-47ac-ab1c-fae34c599b77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: inspectdb traceback

2019-02-01 Thread Tim Graham
Now I see you have 1.6.11.7 which isn't an official Django release -- it 
looks like it may have come from your Linux distribution rather than from 
PyPI.

On Friday, February 1, 2019 at 9:48:43 AM UTC-5, christia...@itsv.at wrote:
>
> well ,this is the version which "pip install django" delivered to me, it 
> was not indentionally installed. how to get a "new" version via pip?
>
> On Friday, February 1, 2019 at 3:45:15 PM UTC+1, Tim Graham wrote:
>>
>> You must use an older version of mysqlclient for such an old (and 
>> unsupported) version of Django.
>>
>> On Friday, February 1, 2019 at 7:50:11 AM UTC-5, christia...@itsv.at 
>> wrote:
>>>
>>>
>>> while trying to build an app around an existing database, inspectdb 
>>> bails out on me. the server is running fine and says "0 errors found". any 
>>> ideas ?
>>>
>>> root@lpgaixmgmtlx01:/root/django/aixregistry_nxt>./manage.py runserver 
>>> 0.0.0.0:8000
>>> Validating models...
>>>
>>> 0 errors found
>>> February 01, 2019 - 12:41:31
>>> Django version 1.6.11.7, using settings 'aixregistry_nxt.settings'
>>> Starting development server at http://0.0.0.0:8000/
>>> Quit the server with CONTROL-C.
>>>
>>>
>>>
>>>
>>> root@lpgaixmgmtlx01:/root/django/aixregistry_nxt>./manage.py inspectdb
>>> Traceback (most recent call last):
>>>   File "./manage.py", line 10, in 
>>> execute_from_command_line(sys.argv)
>>>   File 
>>> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", 
>>> line 399, in execute_from_command_line
>>> utility.execute()
>>>   File 
>>> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", 
>>> line 392, in execute
>>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>>   File "/usr/lib/python2.7/site-packages/django/core/management/base.py"
>>> , line 242, in run_from_argv
>>> self.execute(*args, **options.__dict__)
>>>   File "/usr/lib/python2.7/site-packages/django/core/management/base.py"
>>> , line 285, in execute
>>> output = self.handle(*args, **options)
>>>   File "/usr/lib/python2.7/site-packages/django/core/management/base.py"
>>> , line 415, in handle
>>> return self.handle_noargs(**options)
>>>   File 
>>> "/usr/lib/python2.7/site-packages/django/core/management/commands/inspectdb.py"
>>> , line 27, in handle_noargs
>>> for line in self.handle_inspection(options):
>>>   File 
>>> "/usr/lib/python2.7/site-packages/django/core/management/commands/inspectdb.py"
>>> , line 40, in handle_inspection
>>> cursor = connection.cursor()
>>>   File "/usr/lib/python2.7/site-packages/django/db/backends/__init__.py"
>>> , line 160, in cursor
>>> cursor = self.make_debug_cursor(self._cursor())
>>>   File "/usr/lib/python2.7/site-packages/django/db/backends/__init__.py"
>>> , line 132, in _cursor
>>> self.ensure_connection()
>>>   File "/usr/lib/python2.7/site-packages/django/db/backends/__init__.py"
>>> , line 127, in ensure_connection
>>> self.connect()
>>>   File "/usr/lib/python2.7/site-packages/django/db/backends/__init__.py"
>>> , line 115, in connect
>>> self.connection = self.get_new_connection(conn_params)
>>>   File 
>>> "/usr/lib/python2.7/site-packages/django/db/backends/mysql/base.py", 
>>> line 437, in get_new_connection
>>> conn.encoders[SafeBytes] = conn.encoders[bytes]
>>> KeyError: 
>>> Enter code here...
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google 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/782919ca-2dd9-499d-998e-e4a76da007fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 2.2a1: django-admin migrate throws UnicodeEncodeError

2019-02-01 Thread Tim Graham
I think your shell/terminal isn't configured for Unicode. Take a look here 
for some ideas about how to solve it: 
https://stackoverflow.com/questions/9942594/unicodeencodeerror-ascii-codec-cant-encode-character-u-xa0-in-position-20/39293287

On Friday, February 1, 2019 at 1:49:07 PM UTC-5, axel...@chaos1.de wrote:
>
> Hi, 
>
>  File 
> "/usr/local/py_venv/erdb2-django/lib/python3.6/site-packages/django/core/management/commands/migrate.py",
>  
> line 266, in migration_progress_callback 
> self.stdout.write("  Applying %s\u2026" % migration, ending="") 
>   File 
> "/usr/local/py_venv/erdb2-django/lib/python3.6/site-packages/django/core/management/base.py",
>  
> line 145, in write 
> self._out.write(style_func(msg)) 
> UnicodeEncodeError: 'ascii' codec can't encode character '\u2026' in 
> position 48: ordinal not in range(128) 
>
> Should stdout not receive ASCII only? 
>
> Someone changed here 3 dots to ellipsis character: 
> 
> https://github.com/django/django/commit/50b8493581fea3d7137dd8db33bac7008868d23a#diff-e835ddfb52774b39749788a0d046e477
>  
>
> Axel 
> --- 
> PGP-Key:29E99DD6  ☀  computing @ chaos claudius 
>
>

-- 
You received this message because you are subscribed to the Google 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/cc6ffdd3-d7e9-4100-a15b-977e980838b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Migration question: why causes this change a non-empty migration?

2019-02-01 Thread Tim Graham
AutoField has AUTO_INCREMENT while IntegerField does not so if the 
migration is working correctly, I think its purpose is to drop the 
AUTO_INCREMENT.

I'm reluctant to continue investigation as you're using an old version of 
Django and many bugs have been fixed since then. If you can reproduce a 
problem with Django 2.2 alpha and a fresh database, feel free to create a 
ticket if you can't find an existing ticket.

On Friday, February 1, 2019 at 8:44:47 AM UTC-5, Carsten Fuchs wrote:
>
> Dear Django group, 
>
> using a model like this: 
>
> ``` 
> class Kostenstelle(models.Model): 
> id = models.AutoField(primary_key=True) 
> name = models.CharField(max_length=60, blank=True) 
> # ... omitted fields 
>
> class Meta: 
> db_table = 'kostenstelle' 
> ``` 
>
> I replaced the `id` line with 
>
> ``` 
> id = models.IntegerField(primary_key=True, help_text="...") 
> ``` 
>
> (This was a while ago, using Django 1.11.1.) 
> Running `manage.py makemigrations` created two migration files, numbers 
> 0022 and 0023: 
>
> ``` 
> # Migration 0022. 
> class Migration(migrations.Migration): 
>
> dependencies = [ 
> ('Lori', '0021_alter_Vortraege_jahr'), 
> ] 
>
> operations = [ 
> migrations.AlterField( 
> model_name='kostenstelle', 
> name='id', 
> field=models.IntegerField(primary_key=True, serialize=False), 
> ), 
> ] 
>
> # Migration 0023. 
> class Migration(migrations.Migration): 
>
> dependencies = [ 
> ('Lori', '0022_alter_Kostenstelle_id'), 
> ] 
>
> operations = [ 
> migrations.AlterField( 
> model_name='kostenstelle', 
> name='id', 
> field=models.IntegerField(help_text='...', primary_key=True, 
> serialize=False), 
> ), 
> ] 
> ``` 
>
> This used to work properly with the Oracle DB backend, but today, using 
> Django 1.11.18 with MySQL backend, there are problems: 
> Running `./manage.py sqlmigrate Lori 0023` shows, as expected, an empty 
> commit. With comments and newlines stripped: `BEGIN; COMMIT;` 
>
> I had expected `./manage.py sqlmigrate Lori 0022` to show an empty commit 
> as well, as ttbomk, it doesn't imply any changes to the table schema. 
> However, a lot of SQL statements were generated. Here the complete output, 
> which also covers Foreign Keys that I omitted above: 
>
> ``` 
> (Zeiterfassung) carsten@black-steel-ubuntu:~/Zeiterfassung$ ./manage.py 
> sqlmigrate Lori 0022_alter_Kostenstelle_id 
> BEGIN; 
> -- 
> -- Alter field id on kostenstelle 
> -- 
> ALTER TABLE `kostenstelle` DROP FOREIGN KEY 
> `kostenstelle_parent_id_d0c73a18_fk`; 
> ALTER TABLE `Lori_oeffnungszeiten` DROP FOREIGN KEY 
> `Lori_oeffnungszeiten_kst_id_54e15381_fk`; 
> ALTER TABLE `Lori_vertragsverlauf` DROP FOREIGN KEY 
> `Lori_vertragsverlauf_kostenstelle_id_59f33815_fk`; 
> ALTER TABLE `Lori_userkstzuordnung` DROP FOREIGN KEY 
> `Lori_userkstzuordnung_kostenstelle_id_ac2cc3c0_fk`; 
> ALTER TABLE `Lori_pekosollstd` DROP FOREIGN KEY 
> `Lori_pekosollstd_kst_id_6b0156f7_fk`; 
> ALTER TABLE `kostenstelle` MODIFY `id` integer NOT NULL; 
> ALTER TABLE `kostenstelle` MODIFY `parent_id` integer NULL; 
> ALTER TABLE `Lori_oeffnungszeiten` MODIFY `kst_id` integer NOT NULL; 
> ALTER TABLE `Lori_vertragsverlauf` MODIFY `kostenstelle_id` integer NULL; 
> ALTER TABLE `Lori_userkstzuordnung` MODIFY `kostenstelle_id` integer NOT 
> NULL; 
> ALTER TABLE `Lori_pekosollstd` MODIFY `kst_id` integer NOT NULL; 
> ALTER TABLE `kostenstelle` ADD CONSTRAINT 
> `kostenstelle_parent_id_d0c73a18_fk` FOREIGN KEY (`parent_id`) REFERENCES 
> `kostenstelle` (`id`); 
> ALTER TABLE `Lori_oeffnungszeiten` ADD CONSTRAINT 
> `Lori_oeffnungszeiten_kst_id_54e15381_fk` FOREIGN KEY (`kst_id`) REFERENCES 
> `kostenstelle` (`id`); 
> ALTER TABLE `Lori_vertragsverlauf` ADD CONSTRAINT 
> `Lori_vertragsverlauf_kostenstelle_id_59f33815_fk` FOREIGN KEY 
> (`kostenstelle_id`) REFERENCES `kostenstelle` (`id`); 
> ALTER TABLE `Lori_userkstzuordnung` ADD CONSTRAINT 
> `Lori_userkstzuordnung_kostenstelle_id_ac2cc3c0_fk` FOREIGN KEY 
> (`kostenstelle_id`) REFERENCES `kostenstelle` (`id`); 
> ALTER TABLE `Lori_pekosollstd` ADD CONSTRAINT 
> `Lori_pekosollstd_kst_id_6b0156f7_fk` FOREIGN KEY (`kst_id`) REFERENCES 
> `kostenstelle` (`id`); 
> COMMIT; 
> ``` 
>
> My main question is: 
> Why is this migration not empty, and is it safe to leave it out? 
>
>
> I'm asking this because I have trouble with applying this migration. 
> Apparently, not all of the previously established foreign keys are dropped 
> with the upper statements and recreated with the lower statements. Error 
> message of `manage.py migrate`: 
> _mysql_exceptions.OperationalError: (1833, "Cannot change column 'id': 
> used in a foreign key constraint 
> 'Lori_kalendereintrag_kostenstelle_id_edc2995b_fk_kostenste' of table 
> 'LoriDB.Lori_kalendereintrag_kstellen'") 
> but this constraint is not mentioned above. 
>
> Can anyone 

Re: inspectdb traceback

2019-02-01 Thread Tim Graham
You must use an older version of mysqlclient for such an old (and 
unsupported) version of Django.

On Friday, February 1, 2019 at 7:50:11 AM UTC-5, christia...@itsv.at wrote:
>
>
> while trying to build an app around an existing database, inspectdb bails 
> out on me. the server is running fine and says "0 errors found". any ideas ?
>
> root@lpgaixmgmtlx01:/root/django/aixregistry_nxt>./manage.py runserver 0.0
> .0.0:8000
> Validating models...
>
> 0 errors found
> February 01, 2019 - 12:41:31
> Django version 1.6.11.7, using settings 'aixregistry_nxt.settings'
> Starting development server at http://0.0.0.0:8000/
> Quit the server with CONTROL-C.
>
>
>
>
> root@lpgaixmgmtlx01:/root/django/aixregistry_nxt>./manage.py inspectdb
> Traceback (most recent call last):
>   File "./manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File 
> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", 
> line 399, in execute_from_command_line
> utility.execute()
>   File 
> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", 
> line 392, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/usr/lib/python2.7/site-packages/django/core/management/base.py", 
> line 242, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File "/usr/lib/python2.7/site-packages/django/core/management/base.py", 
> line 285, in execute
> output = self.handle(*args, **options)
>   File "/usr/lib/python2.7/site-packages/django/core/management/base.py", 
> line 415, in handle
> return self.handle_noargs(**options)
>   File 
> "/usr/lib/python2.7/site-packages/django/core/management/commands/inspectdb.py"
> , line 27, in handle_noargs
> for line in self.handle_inspection(options):
>   File 
> "/usr/lib/python2.7/site-packages/django/core/management/commands/inspectdb.py"
> , line 40, in handle_inspection
> cursor = connection.cursor()
>   File "/usr/lib/python2.7/site-packages/django/db/backends/__init__.py", 
> line 160, in cursor
> cursor = self.make_debug_cursor(self._cursor())
>   File "/usr/lib/python2.7/site-packages/django/db/backends/__init__.py", 
> line 132, in _cursor
> self.ensure_connection()
>   File "/usr/lib/python2.7/site-packages/django/db/backends/__init__.py", 
> line 127, in ensure_connection
> self.connect()
>   File "/usr/lib/python2.7/site-packages/django/db/backends/__init__.py", 
> line 115, in connect
> self.connection = self.get_new_connection(conn_params)
>   File "/usr/lib/python2.7/site-packages/django/db/backends/mysql/base.py"
> , line 437, in get_new_connection
> conn.encoders[SafeBytes] = conn.encoders[bytes]
> KeyError: 
> Enter code here...
>
>
>

-- 
You received this message because you are subscribed to the Google 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/b8b50a18-b234-438c-85fc-e8c11d462b91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Projects for Beginners

2019-01-31 Thread Tim Vogt (Tim Vogt)
https://wsvincent.com <https://wsvincent.com/>

tim
t...@officerebels.nl <mailto:t...@officerebels.nl>


> Op 31 jan. 2019, om 19:02 heeft Vikram Jadhav  het 
> volgende geschreven:
> 
> Hey there!!
> Hope you are doing well in Django.
> 
> I am a beginner in Django and completed couples of a tutorial in Django.
> Please suggest project ideas or resources of Django projects to learn for me 
> as beginners.
> 
> 
> -- 
> You received this message because you are subscribed to the Google 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/aaa5b448-671f-439e-b49d-419006f40aca%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/aaa5b448-671f-439e-b49d-419006f40aca%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.
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/BD9CADE9-930D-417D-B271-B9E2A268FB88%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: beginner

2019-01-31 Thread Tim Vogt (Tim Vogt)
Wat do you want to accomplish?

Tim
t...@officerebels.nl
> Op 31 jan. 2019, om 21:51 heeft Emmanuel klutse  het 
> volgende geschreven:
> 
> I'm Emmnuel klutse, and very new to programming. 
> CAN I GET SOMEONE TO MENTOR ME PLEASE.
> i'm currently taking a python course on udemy and also learning on django via 
> youtube.
> I NEED A MENTOR PLEASE
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com 
> <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/63ac66bb-ea6e-402d-aa91-2eb82abaf4d2%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/63ac66bb-ea6e-402d-aa91-2eb82abaf4d2%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.
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/31162D20-A423-4EE3-869D-5156F4561910%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: help for django interview task

2019-01-31 Thread Tim Vogt (Tim Vogt)
draw out the program first and isolatie each problem you try to solve.

and start at the backend.
start small and increase the functions and try to grasp all.
At least in abstraction what you try to do. 

Than start writing the functions in a recipe overview. 
and after the application basics are installed( django app settings etc
write the functions in human language and/ or directly in the models forms etc.




succes!

Tim
coderebels

> Op 31 jan. 2019, om 07:44 heeft Navami K  het 
> volgende geschreven:
> 
> Can anyone help me with the project in the given image . thats my interview 
> task . i have no idea... i am starter . know only the basics
> 
> -- 
> You received this message because you are subscribed to the Google 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/36202414-5af8-4a8a-9b28-ee30481519a2%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/36202414-5af8-4a8a-9b28-ee30481519a2%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.
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/1A875307-AE5B-4B52-88D6-0671E6E7DA33%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


django wagtial docker production and staging database

2019-01-29 Thread Tim Vogt
Hi I have a wagtail application running on digital ocean,
Deployed with ansibble and docker (separate)

When I used amazon I had staging and production branches in my git 
environment (for small flask projects). 
Now I user docker and try tor find a way to handle the settings.py for 
staging with local database sqllite and for production postgres.

I found out how to implement postgres. settings.dev.py 
settings.production.py, but how to trigger the settings.production.py and 
how to trigger the local settings.dev.py?

So that the local database is data is not passing over to the production 
postgres database?

Do I set it up in my yml file? Or do I use a cli command? 
Tim

-- 
You received this message because you are subscribed to the Google 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/83c44a37-9eb9-4f5b-85a9-dc3833c93637%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Questions about MySQL notes in Django docs

2019-01-23 Thread Tim Graham
Yes, Django supports MySQL 8. If you google "django mysql 8" the second 
result is https://code.djangoproject.com/ticket/29451. Based on the commits 
there, it looks like Django 2.0.7 and above received the fixes.

On Wednesday, January 23, 2019 at 5:10:18 AM UTC-5, Carsten Fuchs wrote:
>
> Dear Django group, 
>
> can you please help me with some questions about 
> https://docs.djangoproject.com/en/2.1/ref/databases/#mysql-notes ? 
> (I've been using Django with an Oracle database for years, but I'm new 
> to MySQL.) 
>
> a) Does "Django supports MySQL 5.6 and higher." cover MySQL 8? (I'm not 
> sure about the status of some tickets and PRs.) 
>
> b) Why is the "mysqlclient" client the recommended choice? 
>
> c) Using MySQL 8 and considering 
> https://code.djangoproject.com/ticket/18392, should we set utf8 or 
> utf8mb4 as the character set? 
> https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-sets.html 
> indicates that utf8 is an alias to the deprecated utf8mb3 even with MySQL 
> 8. 
>
> d) Why is isolation level "read committed" preferred over "repeatable 
> read"? The text says "Data loss is possible with repeatable read.", but 
> how can "repeatable read" have data loss that "read committed" has not? 
>
> Thank you! 
>
> Best regards, 
> Carsten 
>
>

-- 
You received this message because you are subscribed to the Google 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/8881bcd7-2d9e-4e2d-abf8-8dd840dfdbaf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django security releases issued: 2.1.5, 2.0.10, and 1.11.18

2019-01-04 Thread Tim Graham
Today the Django team issued 2.1.5, 2.0.10, and 1.11.18 as part of our
security process. These releases address a security issue, and we encourage
all users to upgrade as soon as possible:

https://www.djangoproject.com/weblog/2019/jan/04/security-releases/

The issue was publicly reported through a GitHub pull request, therefore we
fixed the issue as soon as possible without the usual prenotification
process (
https://docs.djangoproject.com/en/dev/internals/security/#how-django-discloses-security-issues
).

As a reminder, we ask that potential security issues be reported via private
email to secur...@djangoproject.com and not via Django's Trac  instance,
Django's GitHub repositories, or the django-developers list. Please see
https://www.djangoproject.com/security for further 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/CAD-rxRBEb3zdu_43VEHyy7ntz-Sy4tvUCQzVOGivycMyc%2B2JVg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Form no longer validates after upgrading django from 2.0.5 to 2.1. Should I report a bug?

2018-12-31 Thread Tim Graham
I think the behavior changed in 
https://github.com/django/django/commit/5fa4f40f45fcdbb7e48489ed3039a314b5c961d0.

The old behavior looks like a bug to me (can you explain why it would be 
expected?) and we don't generally document bug fixes in the release notes.

On Monday, December 31, 2018 at 8:24:49 AM UTC-5, Franc Boekelo wrote:
>
> Hello,
>
> In our project we have a Model with this field:
>
> has_drivers_license = models.BooleanField(verbose_name=_('Heeft 
> rijbewijs'), default=False, choices=BOOL_CHOICES)
>
>
> and we have a ModelForm, where this field is used:
>
>
> fields = [*...* 'has_drivers_license', ]
>
>
> and we use a radio select widget:
>
>
> widgets = {
> 'has_drivers_license': forms.RadioSelect
> }
>
>
> Now, in one specific template where we use this form, we don't include this 
> specific field. In the view, the form would validate anyway. After upgrading 
> to django 2.1  (from 2.0.5), this form no longer validates, saying that 
> has_drivers_license is required. 
>
> I have now added "blank = True" to the Model field, after which the form 
> validates again.
>
>
> Should I report a bug? I didn't see anything in the release notes that would 
> lead to me to expect backward incompatible behavior on this issue.
>
>
> 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/b23647bb-6675-4fc7-8917-9d3f61a5a88a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Update of issue (Trac) rejected (SPAM ...)

2018-11-28 Thread Tim Graham
I marked your comment as "ham" so maybe it'll pass the Bayes filter now. 
"Easy pickings" is subjective but I wouldn't consider that issue "easy" 
since there's not a clear consensus about how to proceed.

On Wednesday, November 28, 2018 at 5:10:06 AM UTC-5, guettli wrote:
>
> I wanted to update this issue https://code.djangoproject.com/ticket/27936
>
> it was not possible. Trac told me this was Spam with this message:
>
> SpamBayes determined spam probability of 98.09%
>
> What can I do now?
>
> I wanted to add this text:
>
> {{{
> I still think a visual help like the diagram I painted here 21 month ago 
> would be nice.
>
> But maybe I am getting old, wise or just even more lazy.
>
> I think this issue is great for a new comer.
>
> Is "easy picking" applicable for this issue?
> }}}
>

-- 
You received this message because you are subscribed to the Google 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/8ef6c577-14ac-491a-a511-8c6ce1a03c35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Recommend Tutorials

2018-11-27 Thread Tim Johnson
* Phako Perez <13.phak...@gmail.com> [181126 19:29]:
> What I can recommend to you for this, is to use same versions for each module 
> on the tutorial so your code will works
> 
> You can create a virtual environment for each tutorial using viertualenv and 
> as a good practice you can list all module requirements on requirements.txt 
> file
  I am using a virtual environment, however I have not implemented a
  requirements.txt, will look into it.

  In the meantime, tutorials, tutorials ... my poor little brain has
  nothing to grab onto otherwise.

  thanks
> Regards
> 
> Sent from my iPhone
> 
> > On Nov 26, 2018, at 7:33 PM, Tim Johnson  wrote:
> > 
> > Using django 2.0 on ubuntu with python 3.5.2
> > 
> > Some tutorials that I have tried have deprecated code and I get
> > errors. 
> > 
> > I would appreciate recommendations for tutorials that are concurrent
> > with my version of django.
> > 
> > I presume that one at
> > https://docs.djangoproject.com/en/2.1/intro/tutorial01/ is about as
> > current as they come :).
> > 
> > It would be fun to experiment with others however.
> > thanks
> > -- 
> > Tim Johnson
> > http://www.tj49.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/20181127013328.GA2345%40mail.akwebsoft.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/97DDF3D3-7320-4FB8-A81E-7A32F9273351%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
Tim Johnson
http://www.tj49.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/20181127161451.GB2345%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.


Recommend Tutorials

2018-11-26 Thread Tim Johnson
Using django 2.0 on ubuntu with python 3.5.2

Some tutorials that I have tried have deprecated code and I get
errors. 

I would appreciate recommendations for tutorials that are concurrent
with my version of django.

I presume that one at
https://docs.djangoproject.com/en/2.1/intro/tutorial01/ is about as
current as they come :).

It would be fun to experiment with others however.
thanks
-- 
Tim Johnson
http://www.tj49.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/20181127013328.GA2345%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.


Re: Looking for a Django Co-Founder.

2018-11-26 Thread Tim Vogt
Hi Zack just made an account to live plan. It seems you have removed me 
form the plan.

Tim

On Sunday, November 25, 2018 at 7:46:53 PM UTC+1, Tim Vogt wrote:
>
> Hi Zack do I need an account for liveplan?
>
> Tim
>
> Verstuurd vanaf mijn iPhone
>
> Op 18 nov. 2018 om 00:53 heeft Lucas G. Navarro  
> het volgende geschreven:
>
> Hi! How are you? Can you tell us more about this?
>
> Regards!
>
> El sáb., 17 nov. 2018 7:29 PM, Zack Amaral  
> escribió:
>
>> Hi,
>>
>> I have an idea for a next generation PaaS. I was wondering if there are 
>> any Django developers that would be interested in being a co-founder with 
>> my company. I'm an AWS Architect but sadly a really bad developer. If 
>> there's anybody on this forum that would be interested please let me know 
>> and we can setup a time to talk about the details of the project.
>>
>> Thanks,
>>
>> Zack
>>
>> -- 
>> You received this message because you are subscribed to the Google 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/987d359b-263b-4ecf-957c-f2537f2d4ad1%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/987d359b-263b-4ecf-957c-f2537f2d4ad1%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/CABomRVVygn%3DNqk1b%2BLkvA5Ktn7PmGYz3W226QQucwWhfx0OwEQ%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/django-users/CABomRVVygn%3DNqk1b%2BLkvA5Ktn7PmGYz3W226QQucwWhfx0OwEQ%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/a98e1226-09cc-4031-b2e0-0e8fa5e5b526%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Strange intermittent UUID bug

2018-11-26 Thread Tim Graham
See if 
https://groups.google.com/d/msg/django-users/ZGb8ofw1Ux8/TnMdqsj4AgAJ helps.

On Friday, November 23, 2018 at 1:11:21 PM UTC-5, Zach wrote:
>
> You could try modifying to_python with something like this:
>
> import logging
>
>
> def to_python(self, value):
> if value is not None and not isinstance(value, uuid.UUID):
> try:
> value = uuid.UUID(value)
> except Exception as e:
> logging.info('class: %s', e.__class__)
> logging.info('module: %s', e.__module__)
> logging.info('type(value): %s', type(value))
> logging.info('value: %s', value)
> raise exceptions.ValidationError(
> self.error_messages['invalid'],
> code='invalid',
> params={'value': value},
> )
> return value
>
>
> On Tuesday, November 20, 2018 at 9:47:25 AM UTC-8, Jerry Vinokurov wrote:
>>
>> Hi all,
>>
>> We have a project that uses UUIDs as a primary key for some objects. Our 
>> project is deployed on AWS via Elastic Beanstalk. After the initial deploy, 
>> everything works fine, but at some point, we encounter the following error, 
>> deep within Django:
>>
>> ValidationError: ["'7c6eee47-53d0-48f6-a8b7-8aff82bc47c3' is not a valid 
>> UUID."]
>>
>> Now, that certainly is a valid UUID; just pass it as a parameter to 
>> uuid.UUID to verify that. So this is definitely odd. We use Sentry for 
>> our error logging, and I dove into the stack trace, which I'll post a 
>> picture of:
>>
>> [image: stack_trace.png]
>>
>>
>> As can be seen in the stack trace, the following thing seems to happen:
>>
>> 1. Line 2315 is supposed to check for whether the value is already a 
>> UUID. That check fails (the purple line above indicates that the execution 
>> path has reached that line). Note that below, Sentry gives value as a 
>> UUID object.
>> 2. Line 2316 is therefore invoked, calling self.to_python(value)
>>
>> Here's the to_python function in its entirety (it can be found in 
>> django/db/models/fields/__init__.py):
>>
>> 2322:def to_python(self, value):
>> 2323:if value is not None and not isinstance(value, uuid.UUID):
>> 2324:try:
>> 2325:return uuid.UUID(value)
>> 2326:except (AttributeError, ValueError):
>> 2327:raise exceptions.ValidationError(
>> 2328:self.error_messages['invalid'],
>> 2329:code='invalid',
>> 2330:params={'value': value},
>> 2331:)
>> 2332:return value
>>
>> 3. The isinstance check at 2323 also fails, and so uuid.UUID(value) is 
>> invoked, which throws the ValidationError shown above, since the value 
>> passed into the constructor is not a string.
>>
>> Now, the really, really weird thing about this problem is that *it goes 
>> away when we redeploy the code*. We then seem to operate normally for 
>> some time (as short as half a day, as long as several weeks) and then the 
>> problem crops up again. And on top of all of this, we can't seem to at all 
>> reproduce it locally; it only shows up in the production environment on AWS.
>>
>> This is bedeviling our entire team and I would love to know if anyone has 
>> encountered a something like this or can provide any insight into just what 
>> is happening here. It seems that it should not be possible and yet it's 
>> happening.
>>
>>

-- 
You received this message because you are subscribed to the Google 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/f4e190cd-5a2f-4e0c-95f8-6d570e4df2a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unapplied Migration - how to apply

2018-11-20 Thread Tim Johnson
* Joel Mathew  [181120 11:18]:
> Yes, for your special case where you seem to have a pre-existing migration,
> you dont need makemigrations before migrate. I was just commenting that
> this is not the usual case.
  Thank you. 
 
> On Wed, 21 Nov 2018 at 01:43, Tim Johnson  wrote:
> 
> > * Joel Mathew  [181120 10:35]:
> > > makemigrations should come before migrate. You cant migrate without
> > > creating the migrations first.
> >   Now I am being confused:
> >
> >   The sequence that Joel suggests did not work for me.
> >   (I tried it before opening this thread)
> >
> >   The reverse sequence that was suggested by Shubham Rewale
> >   did fully apply the migration.
> >
> >   Which is correct?
> > --
> > Tim Johnson
> > http://www.tj49.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/20181120201324.GK30127%40mail.akwebsoft.com
> > .
> > For more options, visit https://groups.google.com/d/optout.
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAA%3Diw_-_35s-zzkB77YUHttjuUU4mMjvkC7r3HDAfyCOFg_g2A%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
Tim Johnson
http://www.tj49.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/20181120210805.GL30127%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unapplied Migration - how to apply

2018-11-20 Thread Tim Johnson
* Joel Mathew  [181120 10:35]:
> makemigrations should come before migrate. You cant migrate without
> creating the migrations first.
  Now I am being confused:

  The sequence that Joel suggests did not work for me.
  (I tried it before opening this thread)

  The reverse sequence that was suggested by Shubham Rewale
  did fully apply the migration.

  Which is correct?
-- 
Tim Johnson
http://www.tj49.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/20181120201324.GK30127%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unapplied Migration - how to apply

2018-11-20 Thread Tim Johnson
* Shubham Rewale  [181120 08:44]:
> python manage.py migrate
> Then use
> Python manage.py makemigrations
 
  Thank you. That worked to apply the missing item.
  Note: Had tried that in the past but reversed the sequence of the
  two commands.

  Have a great day Shubham

> On Tue, 20 Nov 2018, 10:10 p.m. Tim Johnson  
> > using django on ubuntu 16.04
> > python 3.5.2
> > django.VERSION =
> > (2, 0, 0, 'final', 0)
> > Working from the Django Core book by Nigel George.
> > When launching
<...> For more options, visit https://groups.google.com/d/optout.

-- 
Tim Johnson
http://www.tj49.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/20181120191706.GJ30127%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.


Unapplied Migration - how to apply

2018-11-20 Thread Tim Johnson
using django on ubuntu 16.04
python 3.5.2
django.VERSION =
(2, 0, 0, 'final', 0)
Working from the Django Core book by Nigel George.
When launching

(djenv) tim@linus:~/prj/cgi/djenv/djtest$ ./manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).

# the following is a matter of concern:

You have 1 unapplied migration(s). Your project may not work
properly until you apply the migrations for app(s): admin.
Run 'python manage.py migrate' to apply them.

November 19, 2018 - 23:05:05
Django version 2.1.3, using settings 'djtest.settings'
Starting development server at http://127.0.0.1:8000/

# Listing migrations shows:

(djenv) tim@linus:~/prj/cgi/djenv/djtest$ python manage.py showmigrations --list
admin
 [X] 0001_initial
 [X] 0002_logentry_remove_auto_add
 [ ] 0003_logentry_add_action_flag_choices
auth
 [X] 0001_initial
 [X] 0002_alter_permission_name_max_length
 [X] 0003_alter_user_email_max_length
 [X] 0004_alter_user_username_opts
 [X] 0005_alter_user_last_login_null
 [X] 0006_require_contenttypes_0002
 [X] 0007_alter_validators_add_error_messages
 [X] 0008_alter_user_username_max_length
 [X] 0009_alter_user_last_name_max_length
contenttypes
 [X] 0001_initial
 [X] 0002_remove_content_type_name
sessions
 [X] 0001_initial

# It appears that 0003_logentry_add_action_flag_choices
# is not applied

Questions: 
1) How do I apply this feature?
2) Where is further relevant discussions or documentation on this
issue? (I've so far not found anything to clarify)
3) How do the migrations above correspond to DB tables (I'm using
the default sqlite3 configuration)?

Thanks
-- 
Tim Johnson
http://www.tj49.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/20181120164001.GI30127%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.


Re: makemigrations makes migration even if no changes in model

2018-11-10 Thread Tim Graham
I think you'll need to provide a sample project that reproduces the 
problem. I tried with the models you gave (and removed references to the 
models that you didn't provide) but can't reproduce.

On Friday, November 9, 2018 at 6:51:49 AM UTC-5, Michał Redmerski wrote:
>
> Hello! 
>
> All issues with this I googled, are with the opposite problem. 
>
> I have models: Record, Stage, StageFetch 
> here is my code: 
> https://gist.github.com/redmeros/bd70481cae2e4471eee0501146b2945c 
>
> After every use of (no matter if there changes in any models) 
>
> python manage.py makemigrations 
>
> I've got such result 
>
> - Alter field stage on record 
> - Alter field stage on stagesfetch 
>
>
> I'm using django 2.1.3 running on debian. 
>
> Any ideas? 
>
> 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/71d98102-ec92-4e6a-91f9-9f9bbf9932f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Prepopulate blog in b.entry_set.all()[i].blog ?

2018-10-31 Thread Tim Graham
It seems to be a bug as reported in 
https://code.djangoproject.com/ticket/29908. The ForeignKey must use 
to_field to reproduce the problem.

On Saturday, October 20, 2018 at 4:38:51 AM UTC-4, Carsten Fuchs wrote:
>
> Can anyone help please? 
>
> Am 2018-10-11 um 16:58 schrieb Carsten Fuchs: 
> > Dear Django group, 
> > 
> > with Django 1.11.15, using the example models Blog and Entry at 
> > <
> https://docs.djangoproject.com/en/2.1/topics/db/queries/#related-objects> 
> > for reference, I have code like this: 
> > 
> >  b = Blog.objects.get(name="...") 
> >  for e in b.entry_set.all(): 
> >  print(e.blog) 
> > 
> > Obviously, e.blog == b, but I found that for each e, the access to 
> > e.blog causes a subquery to fetch the blog object. 
> > 
> > While I understand the concepts of select_related() and 
> > prefetch_related(), I was surprised that the e.blog attributes are not 
> > prepopulated with b. Why is that and what is the proper way to fix the 
> > problem? 
> > 
> > Best regards, 
> > Carsten 
> > 
>

-- 
You received this message because you are subscribed to the Google 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/8466e1c0-8e47-4e69-ae8b-9861014f9878%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't Upload Image Field With Django 2.1

2018-10-31 Thread Tim Graham
You've misunderstood the purpose of height_field and width_field. Please 
read the documentation: 
https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ImageField.height_field

You need to use a third-party app to do image resizing. Check out 
https://djangopackages.org/grids/g/thumbnails/.

On Wednesday, October 31, 2018 at 11:44:17 AM UTC-4, Pacôme Avahouin wrote:
>
> My model fields look like this:
>>
>> class CustomAbstractUser(AbstractBaseUser, PermissionsMixin):
>> """
>> An abstract base class implementing a fully featured User model with
>> admin-compliant permissions.
>>
>> Email and password are required. Other fields are optional.
>> """
>> email = models.EmailField(
>> _('email address'),
>> unique=True,
>> error_messages={
>> 'unique': _("A user with that email address already exists."),
>> },
>> )
>> first_name = models.CharField(_('first name'), max_length=30, blank=True)
>> last_name = models.CharField(_('last name'), max_length=150, blank=True)
>> is_staff = models.BooleanField(
>> _('staff status'),
>> default=False,
>> help_text=_('Designates whether the user can log into this admin 
>> site.'),
>> )
>> is_active = models.BooleanField(
>> _('active'),
>> default=True,
>> help_text=_(
>> 'Designates whether this user should be treated as active. '
>> 'Unselect this instead of deleting accounts.'
>> ),
>> )
>> date_joined = models.DateTimeField(_('date joined'), 
>> default=timezone.now)
>>
>> phone_number = models.PositiveSmallIntegerField(null=True, blank=True)
>> current_title = models.CharField(max_length=30, blank=True)
>> website_url = models.URLField(blank=True)
>> avatar = models.ImageField(upload_to='accounts/%Y/%m/%d',
>>height_field='160', width_field='160',
>>max_length=100, null=True, blank=True
>>)
>>
>> objects = CustomUserManager()
>>
>> EMAIL_FIELD = 'email'
>> USERNAME_FIELD = 'email'
>>
>>
>> And this is the traceback:
>>
>>
>
>
> Environment:
>
>
> Request Method: POST
> Request URL: http://127.0.0.1:8000/user/edit-profile/
>
> Django Version: 2.1.2
> Python Version: 3.7.0
> Installed Applications:
> ['django.contrib.admin',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'bootstrap4',
>  'accounts',
>  'posts']
> Installed Middleware:
> ['django.middleware.security.SecurityMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.common.CommonMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware',
>  'django.middleware.clickjacking.XFrameOptionsMiddleware']
>
>
>
> Traceback:
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\exception.py"
>  
> in inner
>   34. response = get_response(request)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\base.py"
>  
> in _get_response
>   126. response = self.process_exception_by_middleware(e, 
> request)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\base.py"
>  
> in _get_response
>   124. response = wrapped_callback(request, 
> *callback_args, **callback_kwargs)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\base.py"
>  
> in view
>   68. return self.dispatch(request, *args, **kwargs)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\utils\decorators.py"
>  
> in _wrapper
>   45. return bound_method(*args, **kwargs)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\contrib\auth\decorators.py"
>  
> in _wrapped_view
>   21. return view_func(request, *args, **kwargs)
>
> File "D:\ISMAEL\APPS\EMX\emlaxpress\accounts\views.py" in dispatch
>   36. return super().dispatch(*args, **kwargs)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\base.py"
>  
> in dispatch
>   88. return handler(request, *args, **kwargs)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\edit.py"
>  
> in post
>   194. return super().post(request, *args, **kwargs)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\edit.py"
>  
> in post
>   141. if form.is_valid():
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\forms.py" 
> in is_valid
>   185. return self.is_bound and not self.errors
>
> File 
> 

Re: Can't Upload Image Field With Django 2.1

2018-10-31 Thread Tim Graham
height_field and width_field should be strings. What's the error and what 
does your model fields look like?

On Wednesday, October 31, 2018 at 10:53:53 AM UTC-4, Pacôme Avahouin wrote:
>
> Tim you just saved me right now:) I have spent the all night trying to 
> figure it out.
> Thanks a lot.
> Now when i removed the width_field it works fine. But how to 
> define height_field and width_field directly from the model?
> Cause when i put their values in quotes i got another 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/8a125129-305b-4bcb-b6c3-74c728d47ecc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't Upload Image Field With Django 2.1

2018-10-31 Thread Tim Graham
It looks like the width_field option on the model field isn't a string.

On Wednesday, October 31, 2018 at 10:28:42 AM UTC-4, Pacôme Avahouin wrote:
>
> Hello Tim,
>
> Thanks for answering.
>
> Here is the complete traceback.
> By the way when i commented out the 'upload_file' function still i'm 
> getting the same error. 
> I believe the origin might be somewhere else.
>
>
>
> Environment:
>
>
> Request Method: POST
> Request URL: http://127.0.0.1:8000/user/edit-profile/
>
> Django Version: 2.1.2
> Python Version: 3.7.0
> Installed Applications:
> ['django.contrib.admin',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'bootstrap4',
>  'accounts',
>  'posts']
> Installed Middleware:
> ['django.middleware.security.SecurityMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.common.CommonMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware',
>  'django.middleware.clickjacking.XFrameOptionsMiddleware']
>
>
>
> Traceback:
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\exception.py"
>  
> in inner
>   34. response = get_response(request)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\base.py"
>  
> in _get_response
>   126. response = self.process_exception_by_middleware(e, 
> request)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\base.py"
>  
> in _get_response
>   124. response = wrapped_callback(request, 
> *callback_args, **callback_kwargs)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\base.py"
>  
> in view
>   68. return self.dispatch(request, *args, **kwargs)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\utils\decorators.py"
>  
> in _wrapper
>   45. return bound_method(*args, **kwargs)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\contrib\auth\decorators.py"
>  
> in _wrapped_view
>   21. return view_func(request, *args, **kwargs)
>
> File "D:\ISMAEL\APPS\EMX\emlaxpress\accounts\views.py" in dispatch
>   36. return super().dispatch(*args, **kwargs)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\base.py"
>  
> in dispatch
>   88. return handler(request, *args, **kwargs)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\edit.py"
>  
> in post
>   194. return super().post(request, *args, **kwargs)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\edit.py"
>  
> in post
>   141. if form.is_valid():
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\forms.py" 
> in is_valid
>   185. return self.is_bound and not self.errors
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\forms.py" 
> in errors
>   180. self.full_clean()
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\forms.py" 
> in full_clean
>   383. self._post_clean()
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\models.py" 
> in _post_clean
>   398. self.instance = construct_instance(self, self.instance, 
> opts.fields, opts.exclude)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\models.py" 
> in construct_instance
>   63. f.save_form_data(instance, cleaned_data[f.name])
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\db\models\fields\files.py"
>  
> in save_form_data
>   317. setattr(instance, self.name, data or '')
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\utils\functional.py"
>  
> in __setattr__
>   244. setattr(self._wrapped, name, value)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\db\models\fields\files.py"
>  
> in __set__
>   346. self.field.update_dimension_fields(instance, force=True)
>
> File 
> "C:\Users\ATM\Anaconda3\envs\EmXp\lib\sit

Re: How to edit model.py and serializer so I can recieve contact":{"name":"asdf","email":"ma...@email.com","phone":"1111111111"}}

2018-10-31 Thread Tim Vogt
So Do you mean i change the angular?
Of my models file? If the last apply how?
Sincere,
Tim

On Wednesday, October 31, 2018 at 12:10:51 PM UTC+1, Krishnasagar 
Subhedarpage wrote:
>
> Hi Tim,
>
> IMHO, you can change angular's request body as per model defined in app so 
> that, serializer can validate and save into table.  
>
> Regards, 
> Krishna
>
>
>
> On Wed, 31 Oct 2018 at 15:11, Tim Vogt > 
> wrote:
>
>> Hi group ;-)
>>
>> I have a little challenge.
>>
>> We have a frontend angular api. Wich sinds data to my django backend from 
>> an input form.
>>
>> And Contact in the frontend How to just my serializer / models file right 
>> so the contact data is in my database?
>>
>>
>> contact?: {
>> name: string;
>> email: string;
>> phone: string;
>> }
>>
>> *What gets forwarded to my backend?*
>>
>> {"id":189267,"name":"asdf","address":"asdf","description":"asdf","totalSpots":"0","spotsTaken":"0","location":"0,0","contact":{"name":"asdf","email":"
>> ma...@email.com ","phone":"11"}}
>>
>> *this part is sending the data and arrives in the database.√*
>>
>>
>> {"id":189267,"name":"asdf","address":"asdf","description":"asdf","totalSpots":"0","spotsTaken":"0","location":"0,0",
>>
>>
>> *This part is my challenge and I made this ajustment in my models.py file 
>> and serialisers.py*
>>
>>
>> "contact":{"name":"asdf","email":"ma...@email.com 
>> ","phone":"11"}}
>>
>>
>> What are the files?
>>
>> the angular file:
>>
>> export interface IWorkPlace {
>> id: string;
>> name: string;
>> address: string;
>> description: string;
>> totalSpots: number;
>> spotsTaken: number;
>> location: [number, number];
>> contact?: {
>> name: string;
>> email: string;
>> phone: string;
>> }
>> }
>>
>> *my models.py*
>>
>>
>> name = models.CharField(max_length=250)
>> address = models.CharField(max_length=250)
>> description = models.CharField(max_length=250)
>> totalSpots = models.CharField(max_length=250)
>> spotsTaken =models.CharField(max_length=250, blank=True)
>>
>> image = models.ImageField(upload_to='workplace_image', blank =True)
>> location = models.CharField(max_length=250)
>> name = models.CharField(max_length=150)
>> email = models.EmailField(max_length=100, default='ma...@example.com 
>> ',blank=False)
>> phone = models.CharField(max_length=14 ,default='11"', blank=
>> False)
>>
>>
>>
>> my serializer 
>> class Workspace_bookingSerializer(serializers.ModelSerializer):
>> class Meta:
>> model = Workspace_booking
>> fields = ( 'id','name','address','description','totalSpots','spotsTaken',
>> 'location','name','email','phone')
>>
>>
>>
>>
>> Sincere!
>>
>> Tim
>>
>> -- 
>> You received this message because you are subscribed 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/7ed5caaf-7140-4b1f-a490-916a7c67d45d%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/7ed5caaf-7140-4b1f-a490-916a7c67d45d%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/f43fa087-8f02-4a12-a271-a1b7a24017f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't Upload Image Field With Django 2.1

2018-10-31 Thread Tim Graham
It would be helpful to see the complete traceback. What you provided 
doesn't show where the exception originates.

On Tuesday, October 30, 2018 at 10:38:38 PM UTC-4, Pacôme Avahouin wrote:
>
> Hello guys, 
>
> I'm trying to upload user avatar (ImageField type) with my own custom user 
> model following the documentation like this:
>
> class MyUsersProfileView(UpdateView):
>
> # First try
>
> def upload_file(request):
>
> if request.method == 'POST':
>
> form = MyModelFormWithFileField(request.POST, request.FILES)
>
> if form.is_valid():
>
> # file is saved
>
> form.save()
>
> return HttpResponseRedirect('/success/url/')
>
> else:
>
> form = MyModelFormWithFileField()
>
> return render(request, '/my-model-form-with-the-upload-field.html', 
> {'form': form})
>
>
> # Second try
>
> def upload_file(request):
>
> if request.method == 'POST':
>
> form = MyUploadFileForm(request.POST, request.FILES)
>
> if form.is_valid():
>
> instance = 
> MyModelFormWithFileField(file_field=request.FILES['file'])
>
> instance.save()
>
> return HttpResponseRedirect('/success/url/')
>
> else:
>
> form = MyUploadFileForm()
>
> return render(request, 'my-model-form-with-the-upload-field.html', 
> {'form': form})
>
>
>
> but i'm always getting the same error:
>
>
> TypeError at /user/edit-profile/
> getattr(): attribute name must be string
> Request Method:   POST
> Request URL:  http://127.0.0.1:8000/user/edit-profile/
>
>
> All other fields got updated but not the profile picture.
>
> I have tried everything but couldn't figure it out.
>
> Any help would be appreciate.
>
> Thanks 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/17436ab7-ed23-4420-98df-c04705c9074b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to edit model.py and serializer so I can recieve contact":{"name":"asdf","email":"m...@email.com","phone":"1111111111"}}

2018-10-31 Thread Tim Vogt
Hi group ;-)

I have a little challenge.

We have a frontend angular api. Wich sinds data to my django backend from 
an input form.

And Contact in the frontend How to just my serializer / models file right 
so the contact data is in my database?


contact?: {
name: string;
email: string;
phone: string;
}

*What gets forwarded to my backend?*
{"id":189267,"name":"asdf","address":"asdf","description":"asdf","totalSpots":"0","spotsTaken":"0","location":"0,0","contact":{"name":"asdf","email":"m...@email.com","phone":"11"}}

*this part is sending the data and arrives in the database.√*

{"id":189267,"name":"asdf","address":"asdf","description":"asdf","totalSpots":"0","spotsTaken":"0","location":"0,0",


*This part is my challenge and I made this ajustment in my models.py file 
and serialisers.py*


"contact":{"name":"asdf","email":"m...@email.com","phone":"11"}}


What are the files?

the angular file:

export interface IWorkPlace {
id: string;
name: string;
address: string;
description: string;
totalSpots: number;
spotsTaken: number;
location: [number, number];
contact?: {
name: string;
email: string;
phone: string;
}
}

*my models.py*


name = models.CharField(max_length=250)
address = models.CharField(max_length=250)
description = models.CharField(max_length=250)
totalSpots = models.CharField(max_length=250)
spotsTaken =models.CharField(max_length=250, blank=True)

image = models.ImageField(upload_to='workplace_image', blank =True)
location = models.CharField(max_length=250)
name = models.CharField(max_length=150)
email = models.EmailField(max_length=100, default='m...@example.com',blank=
False)
phone = models.CharField(max_length=14 ,default='11"', blank=False)



my serializer 
class Workspace_bookingSerializer(serializers.ModelSerializer):
class Meta:
model = Workspace_booking
fields = ( 'id','name','address','description','totalSpots','spotsTaken',
'location','name','email','phone')




Sincere!

Tim

-- 
You received this message because you are subscribed to the Google 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/7ed5caaf-7140-4b1f-a490-916a7c67d45d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


test error

2018-10-20 Thread Tim Vogt (Tim Vogt)
I try to make a test with has an error
any suggestions?
tim


expected_author = f'{post.author}
^
SyntaxError: EOL while scanning string literal


--
Ran 1 test in 0.000s

FAILED (errors=1)
Destroying test database for alias 'default'...
MacBook-Pro-15-Officerebel:blogapi timvogt$


from django.test import TestCase
from django.contrib.auth.models import User

from .models import Post

class BlogTests(TestCase):

@classmethod 
def setUpTestData(cls):
#Create a user
testuser1 = User.objects.create_user(
username='testuser1', password='abc123')
testuser1.save()

# Create a blog post
test_post = Post.objects.create(
author=testuser1, title='Blog title', body='Body content...')
test_post.save()

def test_blog_content(self):
post = Post.objects.get(id=1)
expected_author = f'{post.author}'
expected_title = f'{post.title}'
expected_body = f'{post.body}'
self.assertEquals(expected_author, 'testuser1')
self.assertEquals(expected_title,'Blog title')
self.assertEquals(expected_body, 'Body content ...')

-- 
You received this message because you are subscribed to the Google 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/FCBEF0A0-EDB1-4842-BB4E-42249F3F48EB%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: GEOSContextHandle leak probably due to thread local storage destructing order

2018-10-19 Thread Tim Graham
Yes, if you can demonstrate that Django is at fault, you may create a 
ticket.

If you're unsure, you might have better luck on the 
https://groups.google.com/forum/#!forum/geodjango mailing list.

On Thursday, October 18, 2018 at 9:08:10 PM UTC-4, Yong Li wrote:
>
> I have seen consistent GEOSContextHandle leak when a thread using GEOS 
> exits. The source code is in django/contrib/gis/geos.
>
> I can get rid of the leak by clearing all attributes of io.thread_context 
> before exiting that thread.
>
> It seems to me that the root cause is the destructors of thread local 
> objects in io.thread_context call GEOS functions, so they need the 
> GEOSContextHandle. If threadsafe.thread_context has been cleared by Python 
> engine, they will create another one.
>
> Assume Python clears threading.local objects in this order:
>
> 1. thread_safe.thread_context
> 2. io.thread_context
>
> When doing the second step above, it creates another GEOScontextHandle and 
> saves to thread_safe.thread_context.handle. And this is never cleared again.
>
> This is just my thought. Should a Django ticket be created for this?
>
>
> Best regards,
> Yong Li
>

-- 
You received this message because you are subscribed to the Google 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/74fdee42-1850-4e1c-bd63-3d624e73273c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


/usr/share/nginx/html

2018-10-03 Thread Tim Vogt (Tim Vogt)
I am trying to deploy my wagtail/dajngo app to ngnix with Gunicorn.

http://devopspy.com/python/deploy-django-with-nginx-gunicorn-postgresql-virtualenv/



usr/share/nginx/html


include /etc/nginx/conf.d/*.conf;

server {
listen   80 default_server;
listen   [::]:80 default_server;
server_name  _;
root /usr/share/nginx/html;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
}

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
I can not just my ngnix settings.
But still what do I need to change?

and how to get the proxy_pass http://unix:/var/www/myproject.sock; ?
Do i need to make this?


Tim

-- 
You received this message because you are subscribed to the Google 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/BE3D8EC0-200B-4A9E-8CB8-F34C0DD1C4AD%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to create a form builder in django

2018-09-29 Thread Tim Vogt (Tim Vogt)
Do you need a Cms too?
I had used wagtail for its formnuilder and cms is keeps the django applications 
as it workes similar with the route en views.

https://blog.michaelyin.info/how-build-form-page-wagtail/

or just built the blog and the forms later 
http://docs.wagtail.io/en/v2.0/getting_started/tutorial.html


tim


> Op 29 sep. 2018, om 08:26 heeft django_learner  het 
> volgende geschreven:
> 
> I am a newbie in Django. Can anyone help me how to create a form builder in 
> Django without using django-fobi or any other packages
> 
> -- 
> You received this message because you are subscribed to the Google 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/f239efe6-4efd-4edd-b161-074da1df40be%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/f239efe6-4efd-4edd-b161-074da1df40be%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.
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/F2793137-867D-44F1-B85D-7E45881075CF%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Allow a limit_choices_to callable to accept the current model instances object

2018-09-25 Thread Tim Graham
There's a ticket with that feature request: 
https://code.djangoproject.com/ticket/25306

On Tuesday, September 25, 2018 at 6:25:38 PM UTC-4, Ochui Princewill wrote:
>
> Hello, 
>
> Am current working on a project and i want to filter the content of a 
> ForeignkeyField base on the current model object
>
> class Subscription(models.Model):
> user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete
> =models.CASCADE)
> plan = models.ForeignKey(Plan, on_delete=models.CASCADE)
> expires = models.DateField()
> created_at = models.DateTimeField(auto_now_add=True)
>
> class Profile(models.Model):
> user = models.OneToOneField(settings.AUTH_USER_MODEL, 
> on_delete=models.CASCADE, 
> editable=False)
> subscription = models.ForeignKey(Subscription, limit_choices_to={'user_id': 
> settings.AUTH_USER_MODEL}, on_delete=models.SET_NULL, null=True, blank=
> 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/5abc1695-ae5b-45c2-ac8f-c73d7c2d0be7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


rest api is installed but does not run

2018-09-25 Thread Tim Vogt (Tim Vogt)
Hoi we had a django project and we have pipenv and django installed and 
django rest

when running python manage.py django keept telling the rest is not installed.

any tips?

we have django_rest in installed apps..

tim

-- 
You received this message because you are subscribed to the Google 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/E0B081FE-2876-40AA-B26B-795C8BACB6D9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Release 1.11.16 on hold?

2018-09-21 Thread Tim Graham
We'll release it October 1.

-- 
You received this message because you are subscribed to the Google 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/8b2d6b8a-88a4-479f-844d-1eee386e63af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   4   5   6   7   8   9   10   >