Saturday, October 31, 2020

Re: Newbie looking for some help with Postgres <> Django connection

It's been a while since I used heroku, but iirc it just uses a formatted pg url.

Install the module dj-database-url and use this in settings instead of the default DATABASES layout, something like:

DATABASES = {
    'default': dj_database_url.config(os.environ['DATABASE_URL'], conn_max_age=1800)
}

Then set DATABASE_URL in the heroku (and your development) environment. This setting will be of the form:

DATABASE_URL=postgresql://<username>:<password>@<host>:<port>/<databasename>

Again, its been a while but I also seem to recall that the DATABASE_URL is provided to your app automagically(?) a part of the provisioning so does not need to be explicitly set there.  Using the dj_database_url module in your settings above is the key.



Re: How to access using foreing key

Restaurant.objects.filter(rating_restaurant=5.0)

Regards
/d

Re: Deploying an app on heroku

please set debug value to True then deploy, that will allow us to see what is causing the server error

On Sun, Nov 1, 2020 at 12:46 AM programmer 262 <achraf12chahin@gmail.com> wrote:
hy guys i want to deploy my app on heroku and i having a bad time this is the website that i deployed
if someone could help me on deploying it. i will be very GLADE and i will be very thankful if someone can talk to me on facebook 
thanks t everyone

--
You received this message because you are subscribed 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/0352f07b-2d6f-4e0c-ab95-c4ce8dd32226n%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/CAE0AZG%2BmBoqd2KEToXuGd65JtYM5x-PsKP3QHOcUEXvAgf4m7g%40mail.gmail.com.

Deploying an app on heroku

hy guys i want to deploy my app on heroku and i having a bad time this is the website that i deployed
https://khadijaoumelmouminine.herokuapp.com/
if someone could help me on deploying it. i will be very GLADE and i will be very thankful if someone can talk to me on facebook 
https://www.facebook.com/achraf.chahin.3/
thanks t everyone

--
You received this message because you are subscribed 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/0352f07b-2d6f-4e0c-ab95-c4ce8dd32226n%40googlegroups.com.

Re: Question about permissions for django.git

Hey Kasper-

Many thanks! Tried your suggestion and it works.

Does this mean that my specific git configuration is such that the 'git' URL will not work? If so, it is possible that https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/working-with-git/ could be updated to show both ways of setting up the remote?

Best regards,
Chris
On Saturday, October 31, 2020 at 10:39:44 AM UTC-7 Kasper Laudrup wrote:
Hi Chris,

On 31/10/2020 17.02, Christopher Keith wrote:
> Folks -
>
> I am following the instructions from
> https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/working-with-git/
> .
>
> However, when I try to 'git fetch' the source repo, I get 'Permission
> denied'
>
> PS C:\Users\chris\Documents\Github>  git clone
> https://github.com/chrisxkeith/django.git

Here you are using an https URL (https://github.com/chrisxkeith/django.git)

> g...@github.com:django/django.git
> PS C:\Users\chris\Documents\Github\django> git fetch upstream
> g...@github.com: Permission denied (publickey).
> fatal: Could not read from remote repository.

Here you are using a "git" URL (g...@github.com:django/django.git).

Instead of:

# git remote add upstream g...@github.com:django/django.git

Try:

# git remote add upstream https://github.com/django/django.git

Or something similar.

Hope you see the difference.

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/3f79206c-e65c-4c03-94f6-51be34a079a2n%40googlegroups.com.

Re: Question about permissions for django.git

Hi Chris,

On 31/10/2020 17.02, Christopher Keith wrote:
> Folks -
>
> I am following the instructions from
> https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/working-with-git/
> .
>
> However, when I try to 'git fetch' the source repo, I get 'Permission
> denied'
>
> PS C:\Users\chris\Documents\Github>  git clone
> https://github.com/chrisxkeith/django.git

Here you are using an https URL (https://github.com/chrisxkeith/django.git)

> git@github.com:django/django.git
> PS C:\Users\chris\Documents\Github\django> git fetch upstream
> git@github.com: Permission denied (publickey).
> fatal: Could not read from remote repository.

Here you are using a "git" URL (git@github.com:django/django.git).

Instead of:

# git remote add upstream git@github.com:django/django.git

Try:

# git remote add upstream https://github.com/django/django.git

Or something similar.

Hope you see the difference.

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/19d48991-afe4-81d8-5b62-2fcb8539d96f%40stacktrace.dk.

Question about permissions for django.git

Folks -

I am following the instructions from https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/working-with-git/ .

However, when I try to 'git fetch' the source repo, I get 'Permission denied'

PS C:\Users\chris\Documents\Github>  git clone https://github.com/chrisxkeith/django.git
Cloning into 'django'...
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 465879 (delta 0), reused 0 (delta 0), pack-reused 465878
Receiving objects: 100% (465879/465879), 197.61 MiB | 3.93 MiB/s, done.
Resolving deltas: 100% (339992/339992), done.
Updating files: 100% (6412/6412), done.
PS C:\Users\chris\Documents\Github> cd django
PS C:\Users\chris\Documents\Github\django> git remote add upstream git@github.com:django/django.git
PS C:\Users\chris\Documents\Github\django> git fetch upstream
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I have tried this on Linux Mint also, and get the same error. Do I need to be added to some permissions list?

Thanks in advance for any help.
- Chris

--
You received this message because you are subscribed 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/bef4b33d-e989-4c94-9278-9a9c862283ccn%40googlegroups.com.

Newbie looking for some help with Postgres <> Django connection

Hi All,

I'm looking for tips/resources for a problem I'm facing with my Django app: https://ndcportal.herokuapp.com/

I'm attempting to connect my Dockerized Django app with a PostgreSQL db. The postgres db is already populated, and I can access the data via pgadmin, but I cannot figure out the appropriate settings in my docker-compose.yml & settings.py files to make the postgres db populate my django app.

I've reviewed multiple tutorials/blog posts, including Will Vincents Docker & PostgreSQL tutorial, but I feel like I'm missing one or two final & crucial steps. 

When I change my DB settings for Postgres, & I bring up the app via Docker, I continue running into this OperationalError: 

message:django.db.utils.OperationalError: could not connect to server: Connection refused
Is the server running on host "db" (172.29.0.2) and accepting
TCP/IP connections on port 5433?


Any tips/resources/feedback would be greatly appreciated. Thanks in advance.

Best,
Marc

--
You received this message because you are subscribed 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/5b11f9df-d246-4b25-b9b6-8a67193f413en%40googlegroups.com.

Problem with For and Forloop

Hello good, I have a problem using the for and for loop, what I want is that this process is repeated in all pages, so I put it in the base page.html. I want the last added in all pages like, in the blog, login and index. At this moment you can only see it in the index.

This is code inside the base:
<div>
                    <h3 class="blog-title">Latest Additions</h3>
                    {% for anime in num_blog %}
                    {% if forloop.revcounter %}
                    <a href="{% url 'anime-detail' anime.pk%}">
                        <img class="img-asides" src="{{ anime.image.url }}" alt=""></a>
                    <h3
                        style="text-align: center; max-width: 180px; font-size: 13px; margin-right: auto; margin-left: auto;">
                        {{ anime.tituloPag }}</h3>
                    {% endif %}
                    {% endfor %}
                </div>

This is the code in views.py:
def index(request):
    num_blog = Anime.objects.all()
    
    return render(
        request,
        'index.html',
        context={'num_blog':num_blog}
    )

def blog(request):
    num_blog = Anime.objects.all()

    return render(
        request,
        'blog.html',
        context={'num_blog':num_blog}
    )

But as I said you can only see the loop inside the index.html and not in the other pages, what can I do?

--
You received this message because you are subscribed 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/7b2c6cdf-1a38-4b66-8a24-3c473f8c281an%40googlegroups.com.

Friday, October 30, 2020

How to access using foreing key

class User(models.Model):
name=models.CharField(max_length=50,blank=True,null=True)
latitude = models.CharField('Latitude', max_length=30, blank=True, null=True)
longitude = models.CharField('Longitude', max_length=30, blank=True, null=True)
location = models.PointField(blank=True, null=True)

def __str__(self):
return str(self.name)

class Restaurant(models.Model):
restaurant_name=models.CharField(max_length=50,blank=True,null=True)
latitude = models.CharField('Latitude', max_length=30, blank=True, null=True)
longitude = models.CharField('Longitude', max_length=30, blank=True, null=True)
location = models.PointField(blank=True, null=True)

def __str__(self):
return str(self.restaurant_name)


class RestaurantRating(models.Model):
user = models.ForeignKey(User,on_delete=models.CASCADE,null=True,related_name="customer_rating")
restaurant = models.ForeignKey(Restaurant, on_delete=models.CASCADE, null=True, related_name="rating_restaurant")
rating = models.FloatField()

def __str__(self):
return str(self.user)

How can i filter the restaurants whose rating is 5,Restaurant.objects.filter()

--
You received this message because you are subscribed 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/cdaa9adf-5b4e-4de7-9c9d-f9e875e17acbn%40googlegroups.com.

Django Doctor: a bot that suggests fixes to code smells in your GitHub Pull Request

Today I released Django Doctor: it's a bot that suggests fixes to any code smells it finds in your GitHub Pull Request. Just click "approve" to commit the fix for low effort code improvement!

I made this after realising I can automate some of the dev effort during code review: there are some checks we perform during code review that a bot can pick up - allowing us to spend more of our time on things bots are not good at.

Plus it suggests the fix so it does not show problems - it comes to table with solutions ;) Much quicker than reading a linter error in CI, locating the line in the file, fixing it, commiting and pushing to remote.

Scan your entire codebase at https://django.doctor

Or install the GitHub bot: https://github.com/marketplace/django-doctor/


--
You received this message because you are subscribed 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/4161bab8-3516-4c35-858a-4a65ed712e66n%40googlegroups.com.

Re: Patreon and Django-AllAuth Integration

You guys are awesome!  I will try these solutions later this evening.

On Wednesday, October 28, 2020 at 11:30:56 PM UTC-4 oladipo...@gmail.com wrote:
Hello Sir,
You need to set the LOGIN_REDIRECT_URL in your settings.py file.

On Mon, Oct 26, 2020, 8:47 PM Andrew Stringfield <thefund...@gmail.com> wrote:
Hello all,

    I am trying to use Patreon's API Version 2 with Django 3.1.  I read: https://docs.patreon.com/#third-party-libraries and found that Patreon supported the django-allauth library.  I installed the library by following the instructions of: https://django-allauth.readthedocs.io/en/latest/installation.html.  I start up the default dev server and I go to http://127.0.0.1:8000/accounts/signup/ and fill out the form and hit submit.  I get the response of:
---------------------
Page not found (404)Request Method:
GETRequest URL:
http://127.0.0.1:8000/accounts/profile/

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:

  1. admin/
  2. accounts/ signup/ [name='account_signup']
  3. accounts/ login/ [name='account_login']
  4. accounts/ logout/ [name='account_logout']
  5. accounts/ password/change/ [name='account_change_password']
  6. accounts/ password/set/ [name='account_set_password']
  7. accounts/ inactive/ [name='account_inactive']
  8. accounts/ email/ [name='account_email']
  9. accounts/ confirm-email/ [name='account_email_verification_sent']
  10. accounts/ ^confirm-email/(?P<key>[-:\w]+)/$ [name='account_confirm_email']
  11. accounts/ password/reset/ [name='account_reset_password']
  12. accounts/ password/reset/done/ [name='account_reset_password_done']
  13. accounts/ ^password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$ [name='account_reset_password_from_key']
  14. accounts/ password/reset/key/done/ [name='account_reset_password_from_key_done']
  15. accounts/ social/
  16. accounts/ patreon/

The current path, accounts/profile/, didn't match any of these.

You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.

---------------------

I want to get data from Patreon, but it looks like I am just creating local user accounts in the database.  What am I doing wrong?

--
You received this message because you are subscribed 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.

--
You received this message because you are subscribed 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/d2db7ef8-36a7-4f98-9c53-cdc7f2a0f4e7n%40googlegroups.com.

Django and Vue

hello family please i need guidance on how to integrate vue and django to:
1. use one url
2. drf and vue

--
You received this message because you are subscribed 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/CALYpPT8Ek%2B_6HxGJbW8SCRRrskVDeEx1WVq4_b5nLEuXw3ZY%3Dw%40mail.gmail.com.

Re: Get datetime now, not at server initialisation

Hi Clive,

On Oct/28/2020, Clive Bruton wrote:
> Thanks, that was very helpful. I had another pointer on this and found out
> that the easiest way to do this is just to change the ```file``` line in the
> class to:
>
> ```
> file = ImageField(_('image'), upload_to='images/items/%Y/%m/%d/%H/%M/%S')
> ````

I haven't used this method. I always pass a callable (passing a
function).

(I'm deleting a part of your message...)

> So, given that ```upload_path``` returns a string, I don't understand why I
> also have to concatenate the ```filename```:
>
> ```
> def upload_path(instance, filename):
> dtnow = datetime.now(timezone.utc)
> dtstr = '{:%Y/%m/%d}'.format(dtnow)
> dtstr = 'images/items/' + dtstr + '/' + filename
> return dtstr
> ```
> In this case, if I do not concatenate ```filename``` then the uploaded file
> gets named with the last element of the date formatting and without a file
> extension, ie potentially like this:
>
> ```images/items/2020/10/28/20/59/55```
>
> rather than:
>
> ```images/items/2020/10/28/20/59/55/image.jpg```

I see...

> The other thing I don't understand is how ```instance``` and ```filename```
> are passed to the function ```upload_path```. I would expect to do something
> like:
>
> ``` file = ImageField(_('image'), upload_to=upload_path(instance,
> filename))```
>
> But if I do that I get:
>
> ```NameError: name 'instance' is not defined```
>
> Sorry for so many more questions!

I see...

I'll explain two things that put together might help you.

What Django is doing (for now believe me, but keep reading to see it
yourself :-) ) is similar to this:
------------
def print_name(name):
print(f'The name is {name}')

def print_short_name(name):
print(f'Short name: {name[0:2]}')

def call_with_upper_parameter(function_to_call, param):
param = param.upper()
function_to_call(param)

for name in ['Clive', 'Jannett']:
call_with_upper_parameter(print_name, name)
call_with_upper_parameter(print_short_name, name)
------------

The output is:

The name is CLIVE
Short name: CL
The name is JANNETT
Short name: JA

Note that "call_with_upper_parameter" gets two parameters: a callable
and a parameter. It converts the parameter to upper case and
then calls the function_to_call with this parameter.

If you would do "print(function_to_call)" you would see "<function ... at
0x......>"

There is the Python function "callable" to know if a variable can be
called (so if it can be executed: pass parameter -or not- and with () )

Or in another way:
------------------
In [1]: def f():
...: pass
...:

In [2]: name = 'Clive'

In [3]: callable(f)
Out[3]: True

In [4]: callable(name)
Out[4]: False

In [5]: f()

In [6]: name()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-6-8afa4fbf817e> in <module>()
----> 1 name()

TypeError: 'str' object is not callable

In [7]:
------------------

In my opinion: it takes a bit of effort the first times to understand
them. After this it stays for you for any language.

And now the Django part:
You are using ImageField. ImageField is a FileField: https://github.com/django/django/blob/master/django/db/models/fields/files.py#L370

FileField in the init saves the upload_to into self.upload_to: https://github.com/django/django/blob/966b5b49b6521483f1c90b4499c4c80e80136de3/django/db/models/fields/files.py#L240

Side note: if self.upload_to is a str at some point forces to be relative: https://github.com/django/django/blob/966b5b49b6521483f1c90b4499c4c80e80136de3/django/db/models/fields/files.py#L265

But here the interesting code: https://github.com/django/django/blob/966b5b49b6521483f1c90b4499c4c80e80136de3/django/db/models/fields/files.py#L308
In "generate_filename" is doing:
if it's a callable: it calls self.upload_to with the instance and the
filename
If it's not a callable (a str in your case): it executes
datetime.datetime.now().strftime(str(self.upload_to)) : so it's
interpolating the %Y, %m, etc. that you had used and uses it as a base
directory and then adds the filename (posixpath.join(dirname, filename))

Does this explain how it works? I think that your questions might be
answered with the callable code and the Django code.

(I think that you had read the documentation but here it is:
https://docs.djangoproject.com/en/3.1/ref/models/fields/#django.db.models.FileField.upload_to
, it doesn't explain how it is implemented internally).

It might help you to use a Python debugger and see the steps as they
happen, variables, etc. (adding a breakpoint in the Django code and
inspect variables).

Let me know if it's not clear or if I explained something that you
didn't ask!

Cheers,

--
Carles Pina i Estany
https://carles.pina.cat

--
You received this message because you are subscribed 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/20201030110035.GA22706%40pina.cat.

Gyftr api integration

Plz, Tell me how to integrate Gyftr api in rest-framework.

--
You received this message because you are subscribed 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/CAH0koyxKuymKSoS-Nc363mOtFPYj1iPRJji16uD0%2B4t_U7MTVA%40mail.gmail.com.

Thursday, October 29, 2020

How to recover from Django Channels connection limit?

I'm running a server on heroku where I have intermittent channel layer communications between instances of asyncConsumers. Running heroku locally, I have no problem with redis channel connection since I can have as many of them as I want, but once I upload my server to heroku, it gives me a 20 redis connection limit. If I use more than that my server errors out, so I try to lower the expiry time so inactive redis connections would close. BUT, if a redis connection expires and I try to use the channel name with self.channel_layer.send(), I'll get the error below, how do I recover from this error without having to have external calls to create another asyncConsumer instance?


ERROR Exception inside application: Reader at end of file File "/app/.heroku/python/lib/python3.6/site-packages/channels/consumer.py", line 59, in __call__ [receive, self.channel_receive], self.dispatch File "/app/.heroku/python/lib/python3.6/site-packages/channels/utils.py", line 51, in await_many_dispatch await dispatch(result) File "/app/.heroku/python/lib/python3.6/site-packages/channels/consumer.py", line 73, in dispatch await handler(message) File "./myapp/webhook.py", line 133, in http_request await self.channel_layer.send(userDB.backEndChannelName,{"type": "device.query"}) File "/app/.heroku/python/lib/python3.6/site-packages/channels_redis/core.py", line 296, in send if await connection.llen(channel_key) >= self.get_capacity(channel): File "/app/.heroku/python/lib/python3.6/site-packages/aioredis/commands/list.py", line 70, in llen return self.execute(b'LLEN', key) File "/app/.heroku/python/lib/python3.6/site-packages/aioredis/commands/__init__.py", line 51, in execute return self._pool_or_conn.execute(command, *args, **kwargs) File "/app/.heroku/python/lib/python3.6/site-packages/aioredis/connection.py", line 322, in execute raise ConnectionClosedError(msg) Reader at end of file

--
You received this message because you are subscribed 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/8b63c910-b230-42da-b230-b7babe3caacfn%40googlegroups.com.

Re: Filter a field in a form CreatView

Hi David,

Thanks so much for your reply. Im checking the  videos at the google search.

So hopefully I'l develop a combobox with that.

Thanks so much sir!


El jue., 29 oct. 2020 a las 1:24, David Nugent (<davidn@uniquode.io>) escribió:
This is known as a "combo box", somewhat different to a select.

Check this google search: html5 combo box django

Some useful video tutorials + some explanations on how it all works.

A simpler approach - override the widget class similar to how you have done, but there is no need to override them all and I would avoid doing so. If you just need to add some attributes, you can add to the attrs dict of the existing widget instead of replacing it entirely. Plenty of examples exist for that, including the (excellent) django documentation. For your combo box selector you would need to override the widget in order to render the html so you use something different to Select.

Something like (except from a recent project of mine) the following in the form:

class SomeForm(forms.Form)
...
    HEAR_ABOUT_US = (
        'Celebrant',
        'brochure about us',
        'funeral director',
        'facebook page or post',
        'medical or social worker',
        'priest, pastor or minister',
        'friend or family member',
        'other...',
    )
 ...
    hear_about = forms.CharField(label='Where did you hear about us?', max_length=64, required=False,
                        widget=ListTextWidget(name='hear_about', data_list=HEAR_ABOUT_US),
                        help_text='Please let us know how you heard about us (press down or click arrow for options)')
...


And the widget, which could probably do with some improvement:

class ListTextWidget(forms.TextInput):

    def __init__(self, name, data_list, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self._name = name
        self._list = data_list
        self.attrs.update(list=f'list__{self._name}')

    def render(self, name, value, attrs=None, renderer=None):
        text_html = super(ListTextWidget, self).render(name, value, attrs=attrs)
        data_list = f'<datalist id="list__{self._name}">'
        for item in self._list:
            data_list += f'<option value="{item}">'
        data_list += '</datalist>'
        return (text_html + data_list)


HTH, David

On 29 Oct 2020, at 00:23, Walter Randazzo <wwrandazzo@gmail.com> wrote:

Hi guys, How r u doing?

I have a field called articulos that is foreign key,  in a form is defined as follow:

forms.py
from django import forms
#from django.contrib.auth.models import User
from .models import Stockmov

class StockmovForm(forms.ModelForm):
    class Meta:
        model = Stockmov
        #fields ="__all__"
        fields =  ['articulo', 'motivo', 'Cantidad' ]
        widgets = {
        'articulo': forms.Select(attrs={'class':'form-control', 'placeholder':'Articulo'}),
        'motivo': forms.TextInput(attrs={'class':'form-control', 'placeholder':'Motivo'}),
        'Cantidad': forms.NumberInput(attrs={'class':'form-control', 'placeholder':'Cantidad'}),
        }
        labels = {
            'articulo':'', 'motivo':'', 'Cantidad':'',
        }

I want to allow the user to search an instance in the same  combobox articulo in the createview. Check the pic.

Whats is the best native way to do that?Other alternatives?

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/692f2017-ab9e-40b7-8a7c-5c22bffaf368n%40googlegroups.com.
<WhatIWant.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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAL7Dry60-w%2BQXZeQEPwjN6HKpk_Kw%2Bdv-yqCYfnCGrL4fshNTg%40mail.gmail.com.

Re: Can anyone help me fix this issue

You are looking for a key in the response from youtube that doesn't exist - therefore you get this error. You will need to go to the youtube api and see what the response should be.

Regards,

Andréas


Den tors 29 okt. 2020 kl 14:03 skrev Allen Yesudasan <allen@cet.ac.in>:
Environment: Request Method: POST Request URL: https://youtubedownloader244.herokuapp.com/lint Django Version: 3.1.1 Python Version: 3.6.12 Installed Applications: ['tube', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles'] Installed Middleware: ['whitenoise.middleware.WhiteNoiseMiddleware', '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 (most recent call last): File "/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/base.py", line 179, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/app/maker/views.py", line 20, in lint yt = YouTube(video_url) File "/app/.heroku/python/lib/python3.6/site-packages/pytube/__main__.py", line 91, in __init__ self.prefetch() File "/app/.heroku/python/lib/python3.6/site-packages/pytube/__main__.py", line 183, in prefetch self.js_url = extract.js_url(self.watch_html) File "/app/.heroku/python/lib/python3.6/site-packages/pytube/extract.py", line 143, in js_url base_js = get_ytplayer_config(html)["assets"]["js"] Exception Type: KeyError at /lint Exception Value: 'assets'

--
You received this message because you are subscribed 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/6b4ec456-8122-4f00-9159-ac98b3f47cebn%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/CAK4qSCeh%2Bfn%3DiiMnnEw9D4wLuRYFXwspS%3DQUz%3DTP20ANQFTJfQ%40mail.gmail.com.

Re: Django Sending Mail

Hi Samiddha,

On 29/10/2020 17.08, Samiddha সমিদ্ধ wrote:
> I want to include an email service in my project. But for that I need to
> provide my email password to django setings.py in EMAIL_HOST_PASSWORD
> <https://docs.djangoproject.com/en/3.1/ref/settings/#std:setting-EMAIL_HOST_PASSWORD>.
> I want to know that secure to provide email password. When I deploy the
> project with a host, then is there are any risk of theft my password;
> how do I encrypt my password in django setings.py?
>

You can't really avoid making some secrets available on your production
system. I personally use django-configurations:

https://django-configurations.readthedocs.io/en/stable/

and set my secrets as environment variables in my systemd service file
for gunicorn. That is mostly for convenience. You definitely shouldn't
store your secrets in the settings.py file you keep in revision control,
but using environment variables doesn't make them any less accessible to
your hosting provider.

I don't think there's any way to avoid having to trust your hosting
provider, but you can try to ensure the secrets are only known to you
and your hosting provider.

If you don't want to use django-configurations, a more "traditional"
approach is described here:

https://djangostars.com/blog/configuring-django-settings-best-practices/

It doesn't make much sense to encrypt your password, since you still
need to provide the secret to decrypt it when it needs to be used and
then you're back to square one. You might be able to store a private key
in some secure storage from your hosting provider that ensures the
private key can never be retrieved and only used for decrypting your
password, but I don't really think it's worth the effort, especially
considering you still have to trust your hosting provider.

Hope that makes some sense.

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/2765334e-5f4c-72e4-f40c-ad3b8eda4062%40stacktrace.dk.

Django Sending Mail

I want to include an email service in my project. But for that I need to provide my email password to django setings.py in  EMAIL_HOST_PASSWORD. I want to know that secure to provide email password. When I deploy the project with a host, then is there are any risk of theft my password; how do I encrypt my password in django setings.py?

--
You received this message because you are subscribed 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/bb4dc1d9-53ad-48b6-829d-474d9b4fb098n%40googlegroups.com.

How to create a approval login using django

Hi everyone,
I have created a website with models as alumini,college . In that website I have made sure that each alumini is associated to a college.Now what i want to create is whenever a new alumini fills the information in registration page and click register under a particular college ,then that college should approve that alumini in order to register till then the alumini should see a waiting page but shouldn't be logged into the website .
so how to create such a approval .
Is there any tutorials regarding this ,if so please share it here or else I can share the code of my website about the models so that you can guide me to achieve the result  

--
You received this message because you are subscribed 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/42262f44-2744-4f65-a382-da5043823132n%40googlegroups.com.

Re: Fetching data from database

Have a look at:


and then:

Not too hard for a beginner.

On Wednesday, 28 October 2020 at 20:43:02 UTC+2 kiran...@gmail.com wrote:
Hi everyone,

Iam stuck at a point ...I want to fetch a data from a database , where data should be insert manually , plz help me how to do that how to fire a queries in DB and how to use primary key and foreign key over here. 
Please help me ,Iam new to Django . 

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8838b1be-66dc-41e5-82c4-f2566591813cn%40googlegroups.com.

We Are Looking For Python Developers !

WE ARE HIRING

JOIN OUR TEAM!

Python Developer Position


We are looking for a highly skilled computer programmer who is comfortable with both front and back end programming. Full Stack Developers are responsible for developing and designing front end web architecture, ensuring the responsiveness of applications and working alongside graphic designers for web design features, among other duties.


Full Stack Developers will be required to see out a project from conception to final product, requiring good organizational skills and attention to detail.


Qualifications

  • Bachelor's degree in IT, Engineering, Computer Science, Business

  • 5+ years of experience in Web Developing and Python Language

  • Fluent in English

  • Must have extensive Python development experience

  • Experience in web server technologies in Django/Python is necessary

  • Experience with social media APIs is also recommended

  • Experience and/or interest in data science, including but not limited to AI, machine learning, sentiment analysis, topic modeling, and NLP, is recommended

  • Experience with textual analysis is also recommended

  • Strong communication skills, both verbal and written, and the ability to listen effectively



Apply now at

https://careers.bopbo.com/apply/remotely



--
This message (including attachments) is confidential and may be privileged, subject to copyright, trade secret, or other legal rules and may not be forwarded without the author's permission. If you are not the intended recipient, or received it in error you must not read, copy, store or disseminate this message, and please delete the message from all storage devices and notify the sender immediately.

--
You received this message because you are subscribed 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/32ed8b54-d34f-4a85-82e3-e3fe38674aa8n%40googlegroups.com.

Wednesday, October 28, 2020

Can anyone help me fix this issue

Environment: Request Method: POST Request URL: https://youtubedownloader244.herokuapp.com/lint Django Version: 3.1.1 Python Version: 3.6.12 Installed Applications: ['tube', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles'] Installed Middleware: ['whitenoise.middleware.WhiteNoiseMiddleware', '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 (most recent call last): File "/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/base.py", line 179, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/app/maker/views.py", line 20, in lint yt = YouTube(video_url) File "/app/.heroku/python/lib/python3.6/site-packages/pytube/__main__.py", line 91, in __init__ self.prefetch() File "/app/.heroku/python/lib/python3.6/site-packages/pytube/__main__.py", line 183, in prefetch self.js_url = extract.js_url(self.watch_html) File "/app/.heroku/python/lib/python3.6/site-packages/pytube/extract.py", line 143, in js_url base_js = get_ytplayer_config(html)["assets"]["js"] Exception Type: KeyError at /lint Exception Value: 'assets'

--
You received this message because you are subscribed 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/6b4ec456-8122-4f00-9159-ac98b3f47cebn%40googlegroups.com.

Re: Fetching data from database

Thanks, I'll check them out. 

On Thu, 29 Oct, 2020, 10:08 AM David Nugent, <davidn@uniquode.io> wrote:
You question isn't very specific, however I'll try to add a couple of touch-points that may provide some direction.

Django manage.py can provide direct access to your models.

python manage.py shell

is your friend, for manually manipulating data, including the database via the Django ORM.

This link to the Django docs could provide a good starting point, particularly further down the page where models are queried using the Django shell.

Secondly are the import and export data commands available in manage.py, in particular the dumpdata and loaddata commands. I suspect this is what you are looking for.



On 29 Oct 2020, at 05:33, Kiran Bangde <kiranb0218@gmail.com> wrote:

Hi everyone,

Iam stuck at a point ...I want to fetch a data from a database , where data should be insert manually , plz help me how to do that how to fire a queries in DB and how to use primary key and foreign key over here. 
Please help me ,Iam new to Django . 

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAH3w0pg60HpYHzta5hjHTw7NaiBbuh7Q1uOfG%2BkZnRAGgQLOYA%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/CAH3w0phj6R1MTZNwttAXc92TYK-FcA3uptP_6HKHiEMv9e8Y_w%40mail.gmail.com.

Re: Fetching data from database

You question isn't very specific, however I'll try to add a couple of touch-points that may provide some direction.

Django manage.py can provide direct access to your models.

python manage.py shell

is your friend, for manually manipulating data, including the database via the Django ORM.

This link to the Django docs could provide a good starting point, particularly further down the page where models are queried using the Django shell.

Secondly are the import and export data commands available in manage.py, in particular the dumpdata and loaddata commands. I suspect this is what you are looking for.



On 29 Oct 2020, at 05:33, Kiran Bangde <kiranb0218@gmail.com> wrote:

Hi everyone,

Iam stuck at a point ...I want to fetch a data from a database , where data should be insert manually , plz help me how to do that how to fire a queries in DB and how to use primary key and foreign key over here. 
Please help me ,Iam new to Django . 

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAH3w0pg60HpYHzta5hjHTw7NaiBbuh7Q1uOfG%2BkZnRAGgQLOYA%40mail.gmail.com.

Re: Filter a field in a form CreatView

This is known as a "combo box", somewhat different to a select.

Check this google search: html5 combo box django

Some useful video tutorials + some explanations on how it all works.

A simpler approach - override the widget class similar to how you have done, but there is no need to override them all and I would avoid doing so. If you just need to add some attributes, you can add to the attrs dict of the existing widget instead of replacing it entirely. Plenty of examples exist for that, including the (excellent) django documentation. For your combo box selector you would need to override the widget in order to render the html so you use something different to Select.

Something like (except from a recent project of mine) the following in the form:

class SomeForm(forms.Form)
...
    HEAR_ABOUT_US = (
        'Celebrant',
        'brochure about us',
        'funeral director',
        'facebook page or post',
        'medical or social worker',
        'priest, pastor or minister',
        'friend or family member',
        'other...',
    )
 ...
    hear_about = forms.CharField(label='Where did you hear about us?', max_length=64, required=False,
                        widget=ListTextWidget(name='hear_about', data_list=HEAR_ABOUT_US),
                        help_text='Please let us know how you heard about us (press down or click arrow for options)')
...


And the widget, which could probably do with some improvement:

class ListTextWidget(forms.TextInput):

    def __init__(self, name, data_list, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self._name = name
        self._list = data_list
        self.attrs.update(list=f'list__{self._name}')

    def render(self, name, value, attrs=None, renderer=None):
        text_html = super(ListTextWidget, self).render(name, value, attrs=attrs)
        data_list = f'<datalist id="list__{self._name}">'
        for item in self._list:
            data_list += f'<option value="{item}">'
        data_list += '</datalist>'
        return (text_html + data_list)


HTH, David

On 29 Oct 2020, at 00:23, Walter Randazzo <wwrandazzo@gmail.com> wrote:

Hi guys, How r u doing?

I have a field called articulos that is foreign key,  in a form is defined as follow:

forms.py
from django import forms
#from django.contrib.auth.models import User
from .models import Stockmov

class StockmovForm(forms.ModelForm):
    class Meta:
        model = Stockmov
        #fields ="__all__"
        fields =  ['articulo', 'motivo', 'Cantidad' ]
        widgets = {
        'articulo': forms.Select(attrs={'class':'form-control', 'placeholder':'Articulo'}),
        'motivo': forms.TextInput(attrs={'class':'form-control', 'placeholder':'Motivo'}),
        'Cantidad': forms.NumberInput(attrs={'class':'form-control', 'placeholder':'Cantidad'}),
        }
        labels = {
            'articulo':'', 'motivo':'', 'Cantidad':'',
        }

I want to allow the user to search an instance in the same  combobox articulo in the createview. Check the pic.

Whats is the best native way to do that?Other alternatives?

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/692f2017-ab9e-40b7-8a7c-5c22bffaf368n%40googlegroups.com.
<WhatIWant.png>

Re: Patreon and Django-AllAuth Integration

Hello Sir,
You need to set the LOGIN_REDIRECT_URL in your settings.py file.

On Mon, Oct 26, 2020, 8:47 PM Andrew Stringfield <thefundeveloper@gmail.com> wrote:
Hello all,

    I am trying to use Patreon's API Version 2 with Django 3.1.  I read: https://docs.patreon.com/#third-party-libraries and found that Patreon supported the django-allauth library.  I installed the library by following the instructions of: https://django-allauth.readthedocs.io/en/latest/installation.html.  I start up the default dev server and I go to http://127.0.0.1:8000/accounts/signup/ and fill out the form and hit submit.  I get the response of:
---------------------
Page not found (404)Request Method:
GETRequest URL:
http://127.0.0.1:8000/accounts/profile/

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:

  1. admin/
  2. accounts/ signup/ [name='account_signup']
  3. accounts/ login/ [name='account_login']
  4. accounts/ logout/ [name='account_logout']
  5. accounts/ password/change/ [name='account_change_password']
  6. accounts/ password/set/ [name='account_set_password']
  7. accounts/ inactive/ [name='account_inactive']
  8. accounts/ email/ [name='account_email']
  9. accounts/ confirm-email/ [name='account_email_verification_sent']
  10. accounts/ ^confirm-email/(?P<key>[-:\w]+)/$ [name='account_confirm_email']
  11. accounts/ password/reset/ [name='account_reset_password']
  12. accounts/ password/reset/done/ [name='account_reset_password_done']
  13. accounts/ ^password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$ [name='account_reset_password_from_key']
  14. accounts/ password/reset/key/done/ [name='account_reset_password_from_key_done']
  15. accounts/ social/
  16. accounts/ patreon/

The current path, accounts/profile/, didn't match any of these.

You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.

---------------------

I want to get data from Patreon, but it looks like I am just creating local user accounts in the database.  What am I doing wrong?

--
You received this message because you are subscribed 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/090d5b8f-d8cf-4ba7-86b1-35017dec2397n%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/CA%2BARzD-iGnGq3mMm-vVWxH3AoopSfPey%3D_vWvAE30L7F2OvCPg%40mail.gmail.com.

Re: Fetching data from database

How to queries in DB: https://docs.djangoproject.com/en/3.1/topics/db/queries/#retrieving-all-objects
For the primary key:  https://docs.djangoproject.com/en/3.1/ref/models/fields/#primary-key
For the foreign key :   https://docs.djangoproject.com/en/3.1/ref/models/fields/#django.db.models.ForeignKey

You can get these informations from the official Django doc.

在2020年10月29日星期四 UTC+8 上午2:43:02<kiran...@gmail.com> 写道:
Hi everyone,

Iam stuck at a point ...I want to fetch a data from a database , where data should be insert manually , plz help me how to do that how to fire a queries in DB and how to use primary key and foreign key over here. 
Please help me ,Iam new to Django . 

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/04921889-ff29-44be-9863-4b1d64718413n%40googlegroups.com.

Re: Patreon and Django-AllAuth Integration

Here's the django-allauth callback URL for Patreon:
https://django-allauth.readthedocs.io/en/latest/providers.html#patreon

That "callback URL" needs to be configured in the Patreon dev
portal. Make sure you change the URL to match your Django project's
domain/port/etc.

On Wed, Oct 28, 2020 at 06:16:43PM -0500, Ryan Nowakowski wrote:
> Typically oauth requires a callback URL[1] configured at the
> provider(Patreon in this case). Maybe double check that? Perhaps that's
> what Patreon is referring to("redirect URL") in the error below?
>
> [1] https://django-allauth.readthedocs.io/en/latest/providers.html#providers
>
> On Wed, Oct 28, 2020 at 10:29:57AM -0700, Andrew Stringfield wrote:
> > I would not be shocked.
> >
> > On Wednesday, October 28, 2020 at 9:55:15 AM UTC-4 Ryan Nowakowski wrote:
> >
> > > The patreon error you're seeing might be a different redirect URL than the
> > > login redirect URL. i.e. these may be two different problems.
> > >
> > >
> > >
> > >
> > > On October 28, 2020 6:55:48 AM CDT, Andrew Stringfield <
> > > thefund...@gmail.com> wrote:
> > >>
> > >> I almost forgot. I have checked my settings in Django and Patreon and
> > >> the URL redirect matches for all that I can see. I have an idea to try and
> > >> use the testing framework to see what values I am passing to Patreon.
> > >>
> > >> On Wednesday, October 28, 2020 at 7:53:42 AM UTC-4 Andrew Stringfield
> > >> wrote:
> > >>
> > >>> Sorry for the late reply. I found a youtube video of:
> > >>> https://www.youtube.com/watch?v=-TUEM2NCuVE and I followed the
> > >>> instructions as best as I could. I created a button for a Patreon login
> > >>> and I get the below results:
> > >>>
> > >>> In my URL bar I get:
> > >>> https://www.patreon.com/oauth2/errors?error=invalid_request&error_description=Mismatching+redirect+URI.&state=z5ycBAl8AI5V
> > >>> and in my HTML Body I get:
> > >>> {"error":"invalid_request","error_description":"Mismatching redirect
> > >>> URI.","state":"z5ycBAl8AI5V"}
> > >>>
> > >>>
> > >>> On Tuesday, October 27, 2020 at 9:28:38 AM UTC-4 Ryan Nowakowski wrote:
> > >>>
> > >>>> On Mon, Oct 26, 2020 at 12:16:03PM -0700, Andrew Stringfield wrote:
> > >>>> > Hello all,
> > >>>> >
> > >>>> > I am trying to use Patreon's API Version 2 with Django 3.1. I
> > >>>> > read: https://docs.patreon.com/#third-party-libraries and found that
> > >>>> > Patreon supported the django-allauth library. I installed the library
> > >>>> by
> > >>>> > following the instructions
> > >>>> > of: https://django-allauth.readthedocs.io/en/latest/installation.html.
> > >>>> I
> > >>>> > start up the default dev server and I go
> > >>>> > to http://127.0.0.1:8000/accounts/signup/ and fill out the form and
> > >>>> hit
> > >>>> > submit. I get the response of:
> > >>>> > ---------------------
> > >>>> > Page not found (404)Request Method:
> > >>>> > GETRequest URL:
> > >>>> > http://127.0.0.1:8000/accounts/profile/
> > >>>> >
> > >>>> > Using the URLconf defined in mysite.urls, Django tried these URL
> > >>>> patterns,
> > >>>> > in this order:
> > >>>> >
> > >>>> > 1. admin/
> > >>>> > 2. accounts/ signup/ [name='account_signup']
> > >>>> > 3. accounts/ login/ [name='account_login']
> > >>>> > 4. accounts/ logout/ [name='account_logout']
> > >>>> > 5. accounts/ password/change/ [name='account_change_password']
> > >>>> > 6. accounts/ password/set/ [name='account_set_password']
> > >>>> > 7. accounts/ inactive/ [name='account_inactive']
> > >>>> > 8. accounts/ email/ [name='account_email']
> > >>>> > 9. accounts/ confirm-email/ [name='account_email_verification_sent']
> > >>>> > 10. accounts/ ^confirm-email/(?P<key>[-:\w]+)/$
> > >>>> > [name='account_confirm_email']
> > >>>> > 11. accounts/ password/reset/ [name='account_reset_password']
> > >>>> > 12. accounts/ password/reset/done/
> > >>>> [name='account_reset_password_done']
> > >>>> > 13. accounts/
> > >>>> ^password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$
> > >>>> > [name='account_reset_password_from_key']
> > >>>> > 14. accounts/ password/reset/key/done/
> > >>>> > [name='account_reset_password_from_key_done']
> > >>>> > 15. accounts/ social/
> > >>>> > 16. accounts/ patreon/
> > >>>> >
> > >>>> > The current path, accounts/profile/, didn't match any of these.
> > >>>>
> > >>>> That's the default LOGIN_REDIRECT_URL[1]. Explicitly set that in your
> > >>>> settings.py to wherever you want the user to land after login succeeds.
> > >>>>
> > >>>> [1]
> > >>>> https://docs.djangoproject.com/en/3.1/ref/settings/#login-redirect-url
> > >>>>
> > >>>
> >
> > --
> > You received this message because you are subscribed 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/914b5ef0-c1f0-408b-b1c3-0b1977ddd43an%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/20201028231642.GR12495%40fattuba.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/20201028233633.GS12495%40fattuba.com.

Re: Template rendering problem

Hi Realdox,

Please share the code also. The explanation of the problem isnt enough to help u.

thanks,





El mié., 28 oct. 2020 a las 20:15, Realdox Opeyemi (<realdox2yk47jay@gmail.com>) escribió:

My template work fine with dummy data, but my data disappear when I try render data from my model

--
You received this message because you are subscribed 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/CAPqMW_Sb_i6MOANyQMbKXxEJ%2BUNHdFDBA1RkuCOLH0Jurez1Tw%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/CAL7Dry62DcC7NZGxYDxVEGyQuCeDxWSEvEiHqbDAVjVTZi04ww%40mail.gmail.com.