Friday, August 13, 2021

Re: GeoDjango with SpatialLite on Windows 10

Ah OK, this was helpful. I never thought about this, but as it turns out on Windows, Python ships with it's own compiled version of SQLite (see picture below). This is problematic. If i just swap this DLL with another one, I would change every other Python Script on my machine. Hmm..., is it possible to change some environment Paths in a venv and just point to another DLL? I have to look this up. Thanks a lot Micheal.

sqlite.png

Michael Ross schrieb am Freitag, 13. August 2021 um 00:51:02 UTC+2:
On Thu, 12 Aug 2021 04:15:57 -0700 (PDT)
Tugg Speedman <ts.sim...@gmail.com> wrote:

>
> Hello everyone,
>
> I'm new to GeoDjango and therefore I tried to follow the tutorial
> (https://docs.djangoproject.com/en/3.2/ref/contrib/gis/tutorial/) first.
> But the problem is, it doesn't work with SQLite a.k.a SpatialLite. When I
> try to build the migrations, a Windows error pops up (see picture below).
> It's german and says there is no entry point in gdal301.dll.
>
> So why do I post this problem here in Django mailing list? Because the
> Tutorial is very fuzzy for Spatial & Windows. It basically just says
> download the SQLite files from here: https://www.gaia-gis.it/gaia-sins/
>
> But what to do with this files? Can I put them wherever I want? Do I have
> to add them on System/Python path?
>
> I would really appreciate any help
> Thank you[image: error.png]

Maybe this helps:

https://stackoverflow.com/questions/53682315/error-on-libcurl-dll-when-using-gdal-of-osgeo4w-in-django

TLDR: IntelliJ loads wrong sqlite3.dll?

--
Michael Ross <g...@ross.cx>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/771326b9-4f29-4a5f-9e48-7171d6221878n%40googlegroups.com.

Thursday, August 12, 2021

Re: Async Help Needed

The example you presented should Just Work - that error generally only occurs if you return an un-awaited coroutine, which if you're just returning a response, should be impossible.

What version of Python and Django are you running?

Andrew

On Thu, Aug 12, 2021, at 11:03 AM, Steven Mapes wrote:
Does anyone have some links to good guides on getting asnyc to work with Django? I have a use case where I really need to have a view give an async response but I can't get even the most basic of examples working.

I've tried the examples from https://testdriven.io/blog/django-async-views/ with a simple view of:

async def test_view(request):
    return HttpResponse("Hello, async Django!")

I've installed uvicorn and am running it with  uvicorn my_project.asgi:application --reload

My sync views work as expected but the async one just returns an error of "The view sample.views.test_view didn't return an HttpResponse object. It returned an unawaited coroutine instead. You may need to add an 'await' into your view."



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

Async Help Needed

Does anyone have some links to good guides on getting asnyc to work with Django? I have a use case where I really need to have a view give an async response but I can't get even the most basic of examples working.

I've tried the examples from https://testdriven.io/blog/django-async-views/ with a simple view of:

async def test_view(request):
    return HttpResponse("Hello, async Django!")

I've installed uvicorn and am running it with  uvicorn my_project.asgi:application --reload

My sync views work as expected but the async one just returns an error of "The view sample.views.test_view didn't return an HttpResponse object. It returned an unawaited coroutine instead. You may need to add an 'await' into your view."


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

Wednesday, August 11, 2021

url_conf workaround causes warning

I know I'm doing things the wrong way so the solution to this problem is
to learn how to do it correctly if anyone can help please.

WARNINGS:
?: (urls.W005) URL namespace 'admin' isn't unique. You may not be able
to reverse all URLs in this namespace

In my home page template I have ...

{% if channel %}
    {% include channel %}
{% endif %}

... where 'channel' is a short paragraph (one of six) aimed at six
different kinds of customers for the site. They are plain html with no
templating at all. The home page has a top menu of links one of which
has six sub-menu links each one pointing to a different 'channel'.

This worked well at inserting the selected paragraph. But it also picked
up random stuff and generated 404 errors. So I made the view only serve
the nominated six paras. Unfortunately 'admin' generated a 404 as well.

The solution was to rearrange url_conf as follows ...

urlpatterns = [
    ...
    re_path(r"^admin/", adminurls),
    # need this "admin" to gazump <channel> ... is a bit fragile
    path("admin", adminurls),
    path("<channel>", company_views.channel, name="channel"),
]


Here is the view ...

def channel(request, channel):
    if channel in [
        "formulators",
        "regaffairs",
        "cosmetics",
        "coatings",
        "polymers",
        "consultants",
        "disruption",
    ]:
        templ = "home.html"
        cont = {
            "title": settings.BRAND,
            "privacy": "/privacy",
            "security": "/security",
            "licence": "/licence",
            "about": "/about",
            "contact": "/contact",
            "support": "/support",
            "manager": ismanager(request),
        }
        cont["channel"] = f"{channel}.html"
    else:
        templ = "404.html"
        cont = {}
    return render(request=request, template_name=templ, context=cont)

Many thanks for advice

Cheers

Mike



--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/447e7c8d-355b-1c39-a3d6-e40183c9e0a8%40dewhirst.com.au.

Friday, July 30, 2021

Re: Django-salesforce integration

On 29/07/2021 06.55, Venkatesh Nagandla wrote:
>
> I need to write the code in Django and am not supposed to use any
> existing third-party salesforce integration app.
>

What's the reason you cannot you use any existing thirdparty code?

Kind regards,

Kasper Laudrup

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

Re: Django-salesforce integration

Hello Django experts, do you have any guide or resources for this task?



On Thu, 29 Jul 2021 at 18:36, Venkatesh Nagandla <venkateshcalifornia@gmail.com> wrote:
Hi,

Please help with this task. Require insights in an easier way.

I have to implement salesforce integration which includes fetching user token from salesforce using OAuth2. Once I have the token then fetch the list of Users, Accounts, and Contacts from salesforce and store it in the database.

I need to write the code in Django and am not supposed to use any existing third-party salesforce integration app.

If you similar projects or resources, please provide.



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

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

Thursday, July 29, 2021

Re: Please remove me from this user group.

Just click on the unsubscribe button

On Tue, Jul 27, 2021, 3:16 AM Shirley Nelson <star2jem@gmail.com> wrote:
Please remove me from this user group. Thank you.

Regards, Shirley Nelson

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BN15oZhNz6SYsnN1tiBoyjyn-8nM0tfQ2Ua1MWSrVJTdiWa8A%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CADkdEzF55QAQXw6QYaJ5jf2MD8Czn96Zr6-rddtrE9w6PgwgNA%40mail.gmail.com.