Integrate a microphone in the Django app

2021-05-24 Thread מוריה יצחקי
Hello everyone
I want to allow my app to receive input from a microphone
I would be happy for help on how to do this in the visual section as well: 
how to put a microphone that allows you to type from the user in HTML and 
how to convert the audio to the text in Python
Will really really help me
thank you very much

-- 
You received this message because you are subscribed to the Google Groups 
"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/2be50a50-946c-4cbd-8041-70848cc52bcen%40googlegroups.com.


Re: Integrate a microphone in the Django app

2021-05-24 Thread Nick Sarbicki
Hi,

This isn't really a Django problem to solve, it's more general than that.
First you need the client to record and send an audio file of their mic
recording. This is likely something you want to do in JavaScript, as it is
something that they will have to do on their machine - the server does not
have access to their microphone. I believe you want this:
https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia

After that, converting audio to text is a hard problem. However luckily it
has been solved by several third parties (e.g. Google). So you can rely on
a third party package to do the conversion for you e.g.
https://github.com/Uberi/speech_recognition#readme

- Nick


‪On Mon, May 24, 2021 at 12:40 PM ‫מוריה יצחקי‬‎ 
wrote:‬

> Hello everyone
> I want to allow my app to receive input from a microphone
> I would be happy for help on how to do this in the visual section as well:
> how to put a microphone that allows you to type from the user in HTML and
> how to convert the audio to the text in Python
> Will really really help me
> thank you very much
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/2be50a50-946c-4cbd-8041-70848cc52bcen%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGuvt93Kf%3DrK2xLoZ3QhK1HPLn%3Ds0k5wHcnCL82piQr%3DFn8m_g%40mail.gmail.com.


OperationalError at /admin/products/product/add/

2021-05-24 Thread Harsh Saini
Environment: Request Method: POST Request URL: 
http://127.0.0.1:8000/admin/products/product/add/ Django Version: 2.0.7 Python 
Version: 3.8.10 Installed Applications: ['django.contrib.admin', 
'django.contrib.auth', 
'django.contrib.contenttypes', 'django.contrib.sessions', 
'django.contrib.messages', 
'django.contrib.staticfiles', 'products'] 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:\Dev\trydjango\trydjango\lib\site-packages\django\db\backends\utils.py" 
in _execute 85. return self.cursor.execute(sql, params) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\db\backends\sqlite3\base.py"
 
in execute 303. return Database.Cursor.execute(self, query, params) The 
above exception (no such table: main.auth_user__old) was the direct cause 
of the following exception: File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\core\handlers\exception.py"
 
in inner 35. response = get_response(request) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\core\handlers\base.py" 
in _get_response 128. response = self.process_exception_by_middleware(e, 
request) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\core\handlers\base.py" 
in _get_response 126. response = wrapped_callback(request, *callback_args, 
**callback_kwargs) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\contrib\admin\options.py" 
in wrapper 575. return self.admin_site.admin_view(view)(*args, **kwargs) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\utils\decorators.py" 
in _wrapped_view 142. response = view_func(request, *args, **kwargs) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\views\decorators\cache.py" 
in _wrapped_view_func 44. response = view_func(request, *args, **kwargs) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\contrib\admin\sites.py" 
in inner 223. return view(request, *args, **kwargs) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\contrib\admin\options.py" 
in add_view 1554. return self.changeform_view(request, None, form_url, 
extra_context) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\utils\decorators.py" 
in _wrapper 62. return bound_func(*args, **kwargs) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\utils\decorators.py" 
in _wrapped_view 142. response = view_func(request, *args, **kwargs) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\utils\decorators.py" 
in bound_func 58. return func.__get__(self, type(self))(*args2, **kwargs2) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\contrib\admin\options.py" 
in changeform_view 1451. return self._changeform_view(request, object_id, 
form_url, extra_context) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\contrib\admin\options.py" 
in _changeform_view 1495. self.log_addition(request, new_object, 
change_message) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\contrib\admin\options.py" 
in log_addition 768. return LogEntry.objects.log_action( File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\contrib\admin\models.py" 
in log_action 23. return self.model.objects.create( File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\db\models\manager.py" 
in manager_method 82. return getattr(self.get_queryset(), name)(*args, 
**kwargs) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\db\models\query.py" in 
create 417. obj.save(force_insert=True, using=self.db) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\db\models\base.py" in 
save 728. self.save_base(using=using, force_insert=force_insert, File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\db\models\base.py" in 
save_base 759. updated = self._save_table(raw, cls, force_insert, 
force_update, using, update_fields) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\db\models\base.py" in 
_save_table 842. result = self._do_insert(cls._base_manager, using, fields, 
update_pk, raw) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\db\models\base.py" in 
_do_insert 879. return manager._insert([self], fields=fields, 
return_id=update_pk, File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\db\models\manager.py" 
in manager_method 82. return getattr(self.get_queryset(), name)(*args, 
**kwargs) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\db\models\query.py" in 
_insert 1125. return query.get_compiler(using=using).execute_sql(return_id) 
File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\db\models\sql\compiler.py" 
in execute_sql 1285. cursor.execute(sql, params) File 
"C:\Dev\trydjango\trydjango\lib\site-packages\django\db\backends\uti

hey there! i really want to have a friend here

2021-05-24 Thread Hassan Adamu
good day dear friends.
i have created a website just a few month a go. but now i was unable to 
access the website. please my friends can any body help me out?


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


Announcing DjHTML: A Django template indender

2021-05-24 Thread Jaap Joris Vens
Dear all,

I would like to take this opportunity to announce my side project to
the Django community. It's a Django template indenter called DjHTML.
It's Black for Django templates!

https://github.com/rtts/djhtml/

Over the past year I have fallen in love with Black and pre-commit to
automatically format code upon each commit. However, I could not find
any tool that would do the same for HTML files and so I decided to
write one myself. Take for instance the following template:

{% block content %}
 1 %}
class="extra"
{% endif %}
>
{% localize on %}
{% if clickable %}

{% endif %}
Blog post {{ nr }}
{% if clickable %}

{% endif %}
{% endlocalize %}

{% endblock %}

This is what it looks like after processing by DjHTML:

{% block content %}
 1 %}
class="extra"
{% endif %}
>
{% localize on %}
{% if clickable %}

{% endif %}
Blog post {{ nr }}
{% if clickable %}

{% endif %}
{% endlocalize %}

{% endblock %}

Currently, DjHTML is able to parse DTL, HTML, CSS, Javascript and any
combinations of these inside the same template. The indentation rules
are similar to Emacs' web-mode.el but with better handling of some
edge cases.

The difference with Black is that DjHTML is an indenter and not a
formatter: It will only add/remove whitespace and not insert newlines
or any other characters. The goal is to indent already well-structured
templates but not to fix broken ones. Also, unlike Black, the tabwidth
is configurable :-)

I am hoping that some of you will give it a try and hopefully provide
me with some feedback, test cases, and bug reports that will help me
improve this tool.

Greetings,
Jaap Joris Vens

-- 
You received this message because you are subscribed to the Google Groups 
"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/YKug2AoTDvcMSLz4%40logos.


How to fix this error

2021-05-24 Thread Hugh Frost

Request Method: POST Request URL: http://127.0.0.1:8000/profile/ Django 
Version: 3.1.7 Python Version: 3.9.2 Installed Applications: 
['django.contrib.admin', 
'django.contrib.auth', 'django.contrib.contenttypes', 
'django.contrib.sessions', 
'django.contrib.messages', 'django.contrib.staticfiles', 'bootstrap4', 
'crispy_forms', 
'userapp', 'rest_framework', 'rest_framework.authtoken'] Installed 
Middleware: ['django.middleware.security.SecurityMiddleware', 
'django.contrib.sessions.middleware.SessionMiddleware', 
'django.middleware.common.CommonMiddleware', 
'django.contrib.auth.middleware.AuthenticationMiddleware', 
'django.contrib.messages.middleware.MessageMiddleware', 
'django.middleware.clickjacking.XFrameOptionsMiddleware'] 
Traceback (most recent call last): File 
"D:\envi\lib\site-packages\django\db\backends\utils.py", line 84, in 
_execute return self.cursor.execute(sql, params) File 
"D:\envi\lib\site-packages\django\db\backends\sqlite3\base.py", line 413, 
in execute return Database.Cursor.execute(self, query, params) The above 
exception (NOT NULL constraint failed: userapp_profile.babyinfo_id) was the 
direct cause of the following exception: File 
"D:\envi\lib\site-packages\django\core\handlers\exception.py", line 47, in 
inner response = get_response(request) File 
"D:\envi\lib\site-packages\django\core\handlers\base.py", line 181, in 
_get_response response = wrapped_callback(request, *callback_args, 
**callback_kwargs) File "D:\project_kuttystory\userapp\views.py", line 35, 
in detail baby_form2.save() File 
"D:\envi\lib\site-packages\django\forms\models.py", line 460, in save 
self.instance.save() 
File "D:\envi\lib\site-packages\django\db\models\base.py", line 753, in 
save self.save_base(using=using, force_insert=force_insert, File 
"D:\envi\lib\site-packages\django\db\models\base.py", line 790, in 
save_base updated = self._save_table( File 
"D:\envi\lib\site-packages\django\db\models\base.py", line 895, in 
_save_table results = self._do_insert(cls._base_manager, using, fields, 
returning_fields, raw) File 
"D:\envi\lib\site-packages\django\db\models\base.py", line 933, in 
_do_insert return manager._insert( File 
"D:\envi\lib\site-packages\django\db\models\manager.py", line 85, in 
manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File 
"D:\envi\lib\site-packages\django\db\models\query.py", line 1254, in 
_insert return 
query.get_compiler(using=using).execute_sql(returning_fields) File 
"D:\envi\lib\site-packages\django\db\models\sql\compiler.py", line 1397, in 
execute_sql cursor.execute(sql, params) File 
"D:\envi\lib\site-packages\django\db\backends\utils.py", line 98, in 
execute return super().execute(sql, params) File 
"D:\envi\lib\site-packages\django\db\backends\utils.py", line 66, in 
execute return self._execute_with_wrappers(sql, params, many=False, 
executor=self._execute) File 
"D:\envi\lib\site-packages\django\db\backends\utils.py", line 75, in 
_execute_with_wrappers return executor(sql, params, many, context) File 
"D:\envi\lib\site-packages\django\db\backends\utils.py", line 84, in 
_execute return self.cursor.execute(sql, params) File 
"D:\envi\lib\site-packages\django\db\utils.py", line 90, in __exit__ raise 
dj_exc_value.with_traceback(traceback) from exc_value File 
"D:\envi\lib\site-packages\django\db\backends\utils.py", line 84, in 
_execute return self.cursor.execute(sql, params) File 
"D:\envi\lib\site-packages\django\db\backends\sqlite3\base.py", line 413, 
in execute return Database.Cursor.execute(self, query, params) Exception 
Type: IntegrityError at /profile/ Exception Value: NOT NULL constraint 
failed: userapp_profile.babyinfo_id 

Request Method: POST Request URL: http://127.0.0.1:8000/profile/ Django 
Version: 3.1.7 Python Version: 3.9.2 Installed Applications: 
['django.contrib.admin', 
'django.contrib.auth', 'django.contrib.contenttypes', 
'django.contrib.sessions', 
'django.contrib.messages', 'django.contrib.staticfiles', 'bootstrap4', 
'crispy_forms', 
'userapp', 'rest_framework', 'rest_framework.authtoken'] Installed 
Middleware: ['django.middleware.security.SecurityMiddleware', 
'django.contrib.sessions.middleware.SessionMiddleware', 
'django.middleware.common.CommonMiddleware', 
'django.contrib.auth.middleware.AuthenticationMiddleware', 
'django.contrib.messages.middleware.MessageMiddleware', 
'django.middleware.clickjacking.XFrameOptionsMiddleware'] 
Traceback (most recent call last): File 
"D:\envi\lib\site-packages\django\db\backends\utils.py", line 84, in 
_execute return self.cursor.execute(sql, params) File 
"D:\envi\lib\site-packages\django\db\backends\sqlite3\base.py", line 413, 
in execute return Database.Cursor.execute(self, query, params) The above 
exception (NOT NULL constraint failed: userapp_profile.babyinfo_id) was the 
direct cause of the following exception: File 
"D:\envi\lib\site-packages\django\core\handlers\exception.py", line 47, in 
inner response = get_response(request) File 
"D:\envi\lib\si

Re: hey there! i really want to have a friend here

2021-05-24 Thread Yonatan Girma
You can create a new super user

On Mon, May 24, 2021 at 6:23 AM Hassan Adamu 
wrote:

> good day dear friends.
> i have created a website just a few month a go. but now i was unable to
> access the website. please my friends can any body help me out?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/fe324813-cc72-4146-8976-f0647da8a0c2n%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAbCZeDAeh30pF3Yd%3D5%3DVoeXCd3_kwY2AmxshTp36Q%3DZ_XkKTg%40mail.gmail.com.


Re: hey there! i really want to have a friend here

2021-05-24 Thread Sharif Mehedi
You should probably contact your "cloud service" (or what other ever service it 
is) provider.
I will try to help you if you'd provide some more details of your problem.

Regards,Sharif
   On Monday, May 24, 2021, 7:23:16 PM GMT+6, Hassan Adamu 
 wrote:  
 
 good day dear friends.i have created a website just a few month a go. but now 
i was unable to access the website. please my friends can any body help me out?



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fe324813-cc72-4146-8976-f0647da8a0c2n%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/13324.1039510.162186258%40mail.yahoo.com.


Re: hey there! i really want to have a friend here

2021-05-24 Thread Hassan Adamu
OK thanks. What are the details you need?
On 24 May 2021 2:31 pm, "Sharif Mehedi"  wrote:

> You should probably contact your "cloud service" (or what other ever
> service it is) provider.
> I will try to help you if you'd provide some more details of your problem.
>
>
> Regards,
> Sharif
> On Monday, May 24, 2021, 7:23:16 PM GMT+6, Hassan Adamu <
> kindnesscom...@gmail.com> wrote:
>
>
> good day dear friends.
> i have created a website just a few month a go. but now i was unable to
> access the website. please my friends can any body help me out?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/fe324813-cc72-4146-8976-f0647da8a0c2n%
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/13324.1039510.162186258%40mail.yahoo.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/CA%2BWHeE6SneerKXR0-h4ovOCjA6VF73kf6hMAmzsf%3D7SP-ahR_Q%40mail.gmail.com.


Exception Value: relation "django_session" does not exist

2021-05-24 Thread Mic
Hello,
I found a Django project and failed to get it running in Docker container 
in the following way:

 1. `*git clone git clone https://github.com/NAL-i5K/django-blast.git*`
 2. `*$ cat requirements.txt*` in this files the below dependencies had to 
be updated:
- psycopg2==2.8.6 

I have the following Dockerfile:

```
*FROM python:2*
*ENV PYTHONUNBUFFERED=1*
*RUN apt-get update && apt-get install -y postgresql-client*
*WORKDIR /code*
*COPY requirements.txt /code/*
*RUN pip install -r requirements.txt*
*COPY . /code/*
*RUN mkdir -p /var/log/django*
*RUN mkdir -p /var/log/i5k*
```

For `docker-compose.yml` I use:

```
*version: "3"*

*services:*
*  db:*
*image: postgres*
*volumes:*
*  - ./data/db:/var/lib/postgresql/data*
*  - 
./scripts/install-extensions.sql:/docker-entrypoint-initdb.d/install-extensions.sql*

*environment:*
*  - POSTGRES_DB=postgres*
*  - POSTGRES_USER=postgres*
*  - POSTGRES_PASSWORD=postgres*

*  web:*
*build: .*
*command: python manage.py runserver 0.0.0.0:8000*
*volumes:*
*  - .:/code*
*ports:*
*  - "8000:8000"*
*depends_on:*
*  - db*
*links:*
*  - db*
```

```
*$ cat scripts/install-extensions.sql *
*CREATE EXTENSION hstore;*
```

I had to change:

```
*$ vim i5k/settings.py*
*DATABASES = {*
*'default': {*
*'ENGINE': 'django.db.backends.postgresql_psycopg2',*
*'NAME': 'postgres',*
*'USER': 'postgres',*
*'PASSWORD': 'postgres',*
*'HOST': 'db',*
*'PORT': '5432',*
*}*
*}*
```

Next, I ran `*docker-compose up --build*` and opened in Browser `
*http://localhost:8000/admin/*` which caused:

```
*Environment:*


*Request Method: GET*
*Request URL: http://localhost:8000/admin/*

*Django Version: 1.8.12*
*Python Version: 2.7.18*
*Installed Applications:*
*('django.contrib.auth',*
* 'django.contrib.contenttypes',*
* 'django.contrib.sessions',*
* 'django.contrib.sites',*
* 'django.contrib.messages',*
* 'django.contrib.staticfiles',*
* 'django.contrib.postgres',*
* 'axes',*
* 'rest_framework',*
* 'rest_framework_swagger',*
* 'pipeline',*
* 'app',*
* 'blast',*
* 'migrate_account',*
* 'suit',*
* 'filebrowser',*
* 'django.contrib.admin',*
* 'django.contrib.admindocs',*
* 'social.apps.django_app.default',*
* 'captcha',*
* 'dashboard',*
* 'proxy',*
* 'hmmer',*
* 'clustal',*
* 'webapollo_sso',*
* 'drupal_sso')*
*Installed Middleware:*
*('django.middleware.common.CommonMiddleware',*
* 'django.contrib.sessions.middleware.SessionMiddleware',*
* 'django.middleware.csrf.CsrfViewMiddleware',*
* 'django.contrib.auth.middleware.AuthenticationMiddleware',*
* 'django.contrib.messages.middleware.MessageMiddleware',*
* 'axes.middleware.FailedLoginMiddleware',*
* 'app.middleware.SocialAuthExceptionMiddleware')*


*Traceback:*
*File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" 
in get_response*
*  132. response = wrapped_callback(request, 
*callback_args, **callback_kwargs)*
*File 
"/usr/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in 
wrapper*
*  254. return self.admin_view(view, cacheable)(*args, 
**kwargs)*
*File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py" 
in _wrapped_view*
*  110. response = view_func(request, *args, **kwargs)*
*File 
"/usr/local/lib/python2.7/site-packages/django/views/decorators/cache.py" 
in _wrapped_view_func*
*  57. response = view_func(request, *args, **kwargs)*
*File 
"/usr/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in 
inner*
*  222. if not self.has_permission(request):*
*File 
"/usr/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in 
has_permission*
*  162. return request.user.is_active and request.user.is_staff*
*File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py" 
in inner*
*  225. self._setup()*
*File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py" 
in _setup*
*  376. self._wrapped = self._setupfunc()*
*File 
"/usr/local/lib/python2.7/site-packages/django/contrib/auth/middleware.py" 
in *
*  22. request.user = SimpleLazyObject(lambda: get_user(request))*
*File 
"/usr/local/lib/python2.7/site-packages/django/contrib/auth/middleware.py" 
in get_user*
*  10. request._cached_user = auth.get_user(request)*
*File 
"/usr/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py" in 
get_user*
*  167. user_id = _get_user_session_key(request)*
*File 
"/usr/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py" in 
_get_user_session_key*
*  59. return 
get_user_model()._meta.pk.to_python(request.session[SESSION_KEY])*
*File 
"/usr/local/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py"
 
in __getitem__*
*  48. return self._session[key]*
*File 
"/usr/local/lib/python2.7/site-packages/django

Re: hey there! i really want to have a friend here

2021-05-24 Thread Sharif Mehedi
The nature of you website, how is it running, where is it running etc   On 
Monday, May 24, 2021, 7:50:15 PM GMT+6, Hassan Adamu  
wrote:  
 
 
OK thanks. What are the details you need?
On 24 May 2021 2:31 pm, "Sharif Mehedi"  wrote:

You should probably contact your "cloud service" (or what other ever service it 
is) provider.
I will try to help you if you'd provide some more details of your problem.

Regards,Sharif
   On Monday, May 24, 2021, 7:23:16 PM GMT+6, Hassan Adamu 
 wrote:  
 
 good day dear friends.i have created a website just a few month a go. but now 
i was unable to access the website. please my friends can any body help me out?



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscribe@ googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/ 
msgid/django-users/fe324813- cc72-4146-8976-f0647da8a0c2n% 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/13324. 1039510.162186258%40mail. yahoo.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/CA%2BWHeE6SneerKXR0-h4ovOCjA6VF73kf6hMAmzsf%3D7SP-ahR_Q%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/736789683.1052963.1621864643378%40mail.yahoo.com.


Re: OperationalError at /admin/products/product/add/

2021-05-24 Thread Kasper Laudrup
Learn how to ask a question. This could be a good start:

https://betterprogramming.pub/how-to-ask-questions-about-programming-dcd948fcd2bd

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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2b8e50ae-d490-ee15-f0b7-07d11ffe1af1%40stacktrace.dk.


OpenPGP_signature
Description: OpenPGP digital signature


Re: How to fix this error

2021-05-24 Thread Thomas Lockhart
A “not null constraint failed” is in the error message. So you have a field 
which is not being set and the database itself is complaining.

It looks like you have extended the user profile to include a foreign key to 
“babyinfo” and that is empty apparently.

Either change the model to allow a null field or make sure that it is filled in.

hth

- Tom

> On May 24, 2021, at 6:01 AM, Hugh Frost  wrote:
> 
> 
> Request Method: POST  <>Request URL: http://127.0.0.1:8000/profile/  <> 
> <>Django Version: 3.1.7  <>Python Version: 3.9.2  <>Installed Applications:  
> <>['django.contrib.admin',  <>'django.contrib.auth',  
> <>'django.contrib.contenttypes',  <>'django.contrib.sessions',  
> <>'django.contrib.messages', <>'django.contrib.staticfiles',  <>'bootstrap4', 
>  <>'crispy_forms',  <>'userapp',  <>'rest_framework',  
> <>'rest_framework.authtoken']  <>Installed Middleware:  
> <>['django.middleware.security.SecurityMiddleware',  
> <>'django.contrib.sessions.middleware.SessionMiddleware', 
> <>'django.middleware.common.CommonMiddleware',  
> <>'django.contrib.auth.middleware.AuthenticationMiddleware', 
> <>'django.contrib.messages.middleware.MessageMiddleware',  
> <>'django.middleware.clickjacking.XFrameOptionsMiddleware']  <> <> <> 
> <>Traceback (most recent call last):  <>File 
> "D:\envi\lib\site-packages\django\db\backends\utils.py", line 84, in _execute 
>  <>return self.cursor.execute(sql, params)  <>File 
> "D:\envi\lib\site-packages\django\db\backends\sqlite3\base.py", line 413, in 
> execute  <>return Database.Cursor.execute(self, query, params)  <> <>The 
> above exception (NOT NULL constraint failed: userapp_profile.babyinfo_id) was 
> the direct cause of the following exception:  <>File 
> "D:\envi\lib\site-packages\django\core\handlers\exception.py", line 47, in 
> inner  <>response = get_response(request)  <>File 
> "D:\envi\lib\site-packages\django\core\handlers\base.py", line 181, in 
> _get_response  <>response = wrapped_callback(request, *callback_args, 
> **callback_kwargs) <>File "D:\project_kuttystory\userapp\views.py", line 35, 
> in detail  <>baby_form2.save()  <>File 
> "D:\envi\lib\site-packages\django\forms\models.py", line 460, in save  
> <>self.instance.save()  <>File 
> "D:\envi\lib\site-packages\django\db\models\base.py", line 753, in save  
> <>self.save_base(using=using, force_insert=force_insert,  <>File 
> "D:\envi\lib\site-packages\django\db\models\base.py", line 790, in save_base  
> <>updated = self._save_table(  <>File 
> "D:\envi\lib\site-packages\django\db\models\base.py", line 895, in 
> _save_table  <>results = self._do_insert(cls._base_manager, using, fields, 
> returning_fields, raw)  <>File 
> "D:\envi\lib\site-packages\django\db\models\base.py", line 933, in _do_insert 
>  <>return manager._insert(  <>File 
> "D:\envi\lib\site-packages\django\db\models\manager.py", line 85, in 
> manager_method  <>return getattr(self.get_queryset(), name)(*args, **kwargs) 
> <>File "D:\envi\lib\site-packages\django\db\models\query.py", line 1254, in 
> _insert  <>return 
> query.get_compiler(using=using).execute_sql(returning_fields)  <>File 
> "D:\envi\lib\site-packages\django\db\models\sql\compiler.py", line 1397, in 
> execute_sql  <>cursor.execute(sql, params)  <>File 
> "D:\envi\lib\site-packages\django\db\backends\utils.py", line 98, in execute  
> <>return super().execute(sql, params)  <>File 
> "D:\envi\lib\site-packages\django\db\backends\utils.py", line 66, in execute  
> <>return self._execute_with_wrappers(sql, params, many=False, 
> executor=self._execute)  <>File 
> "D:\envi\lib\site-packages\django\db\backends\utils.py", line 75, in 
> _execute_with_wrappers  <>return executor(sql, params, many, context)  <>File 
> "D:\envi\lib\site-packages\django\db\backends\utils.py", line 84, in _execute 
>  <>return self.cursor.execute(sql, params)  <>File 
> "D:\envi\lib\site-packages\django\db\utils.py", line 90, in __exit__  <>raise 
> dj_exc_value.with_traceback(traceback) from exc_value  <>File 
> "D:\envi\lib\site-packages\django\db\backends\utils.py", line 84, in _execute 
>  <>return self.cursor.execute(sql, params)  <>File 
> "D:\envi\lib\site-packages\django\db\backends\sqlite3\base.py", line 413, in 
> execute  <>return Database.Cursor.execute(self, query, params)  <> 
> <>Exception Type: IntegrityError at /profile/  <>Exception Value: NOT NULL 
> constraint failed: userapp_profile.babyinfo_id
> 
> Request Method: POST  <>Request URL: http://127.0.0.1:8000/profile/  <> 
> <>Django Version: 3.1.7  <>Python Version: 3.9.2  <>Installed Applications:  
> <>['django.contrib.admin',  <>'django.contrib.auth',  
> <>'django.contrib.contenttypes',  <>'django.contrib.sessions',  
> <>'django.contrib.messages', <>'django.contrib.staticfiles',  <>'bootstrap4', 
>  <>'crispy_forms',  <>'userapp',  <>'rest_framework',  
> <>'rest_framework.authtoken']  <>Installed Middleware:  
> <>['django.middleware.security.SecurityMiddleware',  
> <>'django.contrib.sessions.middleware.Se

Re: Exception Value: relation "django_session" does not exist

2021-05-24 Thread RANGA BHARATH JINKA
hi,

Run migrations. python manage.py makemigrations and python manage.py migrate

On Mon, May 24, 2021 at 7:20 PM Mic  wrote:

> Hello,
> I found a Django project and failed to get it running in Docker container
> in the following way:
>
>  1. `*git clone git clone https://github.com/NAL-i5K/django-blast.git
> *`
>  2. `*$ cat requirements.txt*` in this files the below dependencies had
> to be updated:
> - psycopg2==2.8.6
>
> I have the following Dockerfile:
>
> ```
> *FROM python:2*
> *ENV PYTHONUNBUFFERED=1*
> *RUN apt-get update && apt-get install -y postgresql-client*
> *WORKDIR /code*
> *COPY requirements.txt /code/*
> *RUN pip install -r requirements.txt*
> *COPY . /code/*
> *RUN mkdir -p /var/log/django*
> *RUN mkdir -p /var/log/i5k*
> ```
>
> For `docker-compose.yml` I use:
>
> ```
> *version: "3"*
>
> *services:*
> *  db:*
> *image: postgres*
> *volumes:*
> *  - ./data/db:/var/lib/postgresql/data*
> *  -
> ./scripts/install-extensions.sql:/docker-entrypoint-initdb.d/install-extensions.sql*
>
> *environment:*
> *  - POSTGRES_DB=postgres*
> *  - POSTGRES_USER=postgres*
> *  - POSTGRES_PASSWORD=postgres*
>
> *  web:*
> *build: .*
> *command: python manage.py runserver 0.0.0.0:8000
> *
> *volumes:*
> *  - .:/code*
> *ports:*
> *  - "8000:8000"*
> *depends_on:*
> *  - db*
> *links:*
> *  - db*
> ```
>
> ```
> *$ cat scripts/install-extensions.sql *
> *CREATE EXTENSION hstore;*
> ```
>
> I had to change:
>
> ```
> *$ vim i5k/settings.py*
> *DATABASES = {*
> *'default': {*
> *'ENGINE': 'django.db.backends.postgresql_psycopg2',*
> *'NAME': 'postgres',*
> *'USER': 'postgres',*
> *'PASSWORD': 'postgres',*
> *'HOST': 'db',*
> *'PORT': '5432',*
> *}*
> *}*
> ```
>
> Next, I ran `*docker-compose up --build*` and opened in Browser 
> `*http://localhost:8000/admin/
> *` which caused:
>
> ```
> *Environment:*
>
>
> *Request Method: GET*
> *Request URL: http://localhost:8000/admin/ *
>
> *Django Version: 1.8.12*
> *Python Version: 2.7.18*
> *Installed Applications:*
> *('django.contrib.auth',*
> * 'django.contrib.contenttypes',*
> * 'django.contrib.sessions',*
> * 'django.contrib.sites',*
> * 'django.contrib.messages',*
> * 'django.contrib.staticfiles',*
> * 'django.contrib.postgres',*
> * 'axes',*
> * 'rest_framework',*
> * 'rest_framework_swagger',*
> * 'pipeline',*
> * 'app',*
> * 'blast',*
> * 'migrate_account',*
> * 'suit',*
> * 'filebrowser',*
> * 'django.contrib.admin',*
> * 'django.contrib.admindocs',*
> * 'social.apps.django_app.default',*
> * 'captcha',*
> * 'dashboard',*
> * 'proxy',*
> * 'hmmer',*
> * 'clustal',*
> * 'webapollo_sso',*
> * 'drupal_sso')*
> *Installed Middleware:*
> *('django.middleware.common.CommonMiddleware',*
> * 'django.contrib.sessions.middleware.SessionMiddleware',*
> * 'django.middleware.csrf.CsrfViewMiddleware',*
> * 'django.contrib.auth.middleware.AuthenticationMiddleware',*
> * 'django.contrib.messages.middleware.MessageMiddleware',*
> * 'axes.middleware.FailedLoginMiddleware',*
> * 'app.middleware.SocialAuthExceptionMiddleware')*
>
>
> *Traceback:*
> *File
> "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" in
> get_response*
> *  132. response = wrapped_callback(request,
> *callback_args, **callback_kwargs)*
> *File
> "/usr/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in
> wrapper*
> *  254. return self.admin_view(view, cacheable)(*args,
> **kwargs)*
> *File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py"
> in _wrapped_view*
> *  110. response = view_func(request, *args, **kwargs)*
> *File
> "/usr/local/lib/python2.7/site-packages/django/views/decorators/cache.py"
> in _wrapped_view_func*
> *  57. response = view_func(request, *args, **kwargs)*
> *File
> "/usr/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in
> inner*
> *  222. if not self.has_permission(request):*
> *File
> "/usr/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in
> has_permission*
> *  162. return request.user.is_active and request.user.is_staff*
> *File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py"
> in inner*
> *  225. self._setup()*
> *File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py"
> in _setup*
> *  376. self._wrapped = self._setupfunc()*
> *File
> "/usr/local/lib/python2.7/site-packages/django/contrib/auth/middleware.py"
> in *
> *  22. request.user = SimpleLazyObject(lambda: get_user(request))*
> *File
> "/usr/local/lib/python2.7/site-packages/django/contrib/auth/middleware.py"
> in get_user*
> *  10. request._cached_user = auth.get_user(reque

Re: help on autologging users after signup

2021-05-24 Thread I,M& M
in drf, the request.POST dictionary does not contain the body of the 
request instead use the request.data to access the requests body.
ex.
email = request.data.get('email')
password= request.data.get('password') 
new_user = authenticate(request, email, password)
request.data contains the username and password

On Monday, May 24, 2021 at 9:29:33 AM UTC+3 tosina...@gmail.com wrote:

> I've tried that it didn't wrk
> On 24 May 2021 05:21, "lalit suthar"  wrote:
>
>> in authenticate function take values from request.data dictionary
>> email = request.data.get('email')
>> poassword = request.data.get('password')
>> On Sunday, 23 May 2021 at 07:27:51 UTC+5:30 tosina...@gmail.com wrote:
>>
>>> halo guys, i wan  make it possible for user to auto login user after 
>>> signup in my app using drf
>>> but still getting null as d user-id & returning anonymous user err
>>> can anyone help out
>>> [image: image.png]
>>> [image: image.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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/a3a45860-b65c-45f0-9c24-cd23165e5048n%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cfbe09d9-00b9-4993-abc2-a3a87846d8e7n%40googlegroups.com.


Making a rather small web app, is Django right for it?

2021-05-24 Thread Devin Prater
Hi all. I am a rather new Python learner, although I've made the following
script:

https://github.com/prater-devin/src/blob/main/lunch/lunch.py

I want to turn this into a central place where students can get not just
the lunch menu, but also other menus, upcoming events, things like that,
but not much more than that. So, in order to bypass the need for submitting
to the App Store because this isn't that big of an app, I decided to go
with web development instead. Since I already know Python, enough to make
that simple program at least, I thought I'd just use Django to make this.

Now, I've also tried using Beeware to make an actual app, and that seems
easy compared to getting started with Django, but I don't want to disregard
Django just because Beeware is easier. Plus Beeware doesn't seem to have
web app creation support yet. So, any ideas? How hard would it be to take
something like that simple code, probably for the backend more than
frontend, and enhance it, mainly adding more requests to a URL, then
getting text using BS4, then showing it on the app? I imagine tabs at the
bottom of the screen for "menus", "vending machines", and "events and
news." Stuff like that, then the main content in the middle, then buttons
at the top to change between menu sources on the menus tab and such. So,
not that much interaction I'd think. So, what do you all think? Thanks for
any help.

Devin Prater

Technical Assistant


256 761-3423

[image: Alabama Institute for Deaf and Blind]

P.O. Box 698 | 1105 Fort Lashley Ave.

Talladega, AL 35161

www.aidb.org
[image: Facebook] Discover how we’re limitless.


-- 
You received this message because you are subscribed to the Google Groups 
"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/CAKXtajAeZPSpgZg9a38YtCksi4N7VF51DJYxWAQ1K0P3V%3D-P_A%40mail.gmail.com.


Re: In need of immediate help from Django community

2021-05-24 Thread Mottaz Hegaze
I think in second image ( usercreateform ) your model needs to be User not
profile

On Mon, May 24, 2021 at 10:08 PM Aritra Ray  wrote:

> Hi,
>
> I've been facing a problem recently in creating a Django Profile model for
> an E-commerce website.
> Error: FieldError(message) django.core.exceptions.FieldError: Unknown
> field(s) (username) specified for Profile
> Kindly help me out if possible. The screenshots have been attached below
> and the github link for the project has been provided.
>
> Link: https://github.com/First-project-01/Django-ecommerce (Check out the
> 'changes' branch)
>
> Regards,
> Aritra
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/CAFecadvxBCa6w02%3DZ887%2BnaEdY-R6B9%2BVVFzVW5zYvkt1gA2hg%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/CAHV4E-epA2sH8LrAX7y6kQ0HePvpir%3DLwCCJB%3DcC4Som4JBo0g%40mail.gmail.com.


Re: In need of immediate help from Django community

2021-05-24 Thread Omkar Parab
Error is in forms.py file.

"model = User" not profile.

Default "User" model comes with username, email filed.

Why you're creating another email field in the Profile model?

Just fetch it using {{ user.email }}


On Tue, May 25, 2021, 1:38 AM Aritra Ray  wrote:

> Hi,
>
> I've been facing a problem recently in creating a Django Profile model for
> an E-commerce website.
> Error: FieldError(message) django.core.exceptions.FieldError: Unknown
> field(s) (username) specified for Profile
> Kindly help me out if possible. The screenshots have been attached below
> and the github link for the project has been provided.
>
> Link: https://github.com/First-project-01/Django-ecommerce (Check out the
> 'changes' branch)
>
> Regards,
> Aritra
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/CAFecadvxBCa6w02%3DZ887%2BnaEdY-R6B9%2BVVFzVW5zYvkt1gA2hg%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/CAJY8mfzFT-GqqZ0YvdLKH9gKcTAv%2B1srG9973pXYfA5f_qVA7w%40mail.gmail.com.


Base Template per User

2021-05-24 Thread sebasti...@gmail.com
Hello,

i want that every user from website can upload a base html file that are 
then used on every views as base template. Every User have then his own 
layout... 

Have anyone experience with such a thing?

Regards

-- 
You received this message because you are subscribed to the Google Groups 
"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/22701bf0-c5ad-48c5-a4e7-5bce4bc337f4n%40googlegroups.com.


Re: Making a rather small web app, is Django right for it?

2021-05-24 Thread Arthur Obo Nwakaji
Hello, django is an awesome tool in the hands of a great developer who know
how to use it. You're on the right track because django is great for
building scalable web applications and restful APIs. I am always ready to
do my best to help as I can in the django community. If you need any
assistance or questions, you can reach out to me.

On Mon, 24 May 2021, 9:09 PM Devin Prater  Hi all. I am a rather new Python learner, although I've made the following
> script:
>
> https://github.com/prater-devin/src/blob/main/lunch/lunch.py
>
> I want to turn this into a central place where students can get not just
> the lunch menu, but also other menus, upcoming events, things like that,
> but not much more than that. So, in order to bypass the need for submitting
> to the App Store because this isn't that big of an app, I decided to go
> with web development instead. Since I already know Python, enough to make
> that simple program at least, I thought I'd just use Django to make this.
>
> Now, I've also tried using Beeware to make an actual app, and that seems
> easy compared to getting started with Django, but I don't want to disregard
> Django just because Beeware is easier. Plus Beeware doesn't seem to have
> web app creation support yet. So, any ideas? How hard would it be to take
> something like that simple code, probably for the backend more than
> frontend, and enhance it, mainly adding more requests to a URL, then
> getting text using BS4, then showing it on the app? I imagine tabs at the
> bottom of the screen for "menus", "vending machines", and "events and
> news." Stuff like that, then the main content in the middle, then buttons
> at the top to change between menu sources on the menus tab and such. So,
> not that much interaction I'd think. So, what do you all think? Thanks for
> any help.
>
> Devin Prater
>
> Technical Assistant
>
>
> 256 761-3423
>
> [image: Alabama Institute for Deaf and Blind]
>
> P.O. Box 698 | 1105 Fort Lashley Ave.
>
> Talladega, AL 35161
>
> www.aidb.org
> [image: Facebook] Discover how we’re limitless.
> 
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/CAKXtajAeZPSpgZg9a38YtCksi4N7VF51DJYxWAQ1K0P3V%3D-P_A%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/CAGOrV0fcNz5ByPfkuQZb3qHXDzgVPvX65Mq_UbdbKP%2BOtQiuyQ%40mail.gmail.com.


Re: Exception Value: relation "django_session" does not exist

2021-05-24 Thread Michał T . Lorenc
Hi,
Thank you it works.

On Tue, May 25, 2021 at 12:31 AM RANGA BHARATH JINKA <
bharathjink...@gmail.com> wrote:

> hi,
>
> Run migrations. python manage.py makemigrations and python manage.py
> migrate
>
> On Mon, May 24, 2021 at 7:20 PM Mic  wrote:
>
>> Hello,
>> I found a Django project and failed to get it running in Docker container
>> in the following way:
>>
>>  1. `*git clone git clone https://github.com/NAL-i5K/django-blast.git
>> *`
>>  2. `*$ cat requirements.txt*` in this files the below dependencies had
>> to be updated:
>> - psycopg2==2.8.6
>>
>> I have the following Dockerfile:
>>
>> ```
>> *FROM python:2*
>> *ENV PYTHONUNBUFFERED=1*
>> *RUN apt-get update && apt-get install -y postgresql-client*
>> *WORKDIR /code*
>> *COPY requirements.txt /code/*
>> *RUN pip install -r requirements.txt*
>> *COPY . /code/*
>> *RUN mkdir -p /var/log/django*
>> *RUN mkdir -p /var/log/i5k*
>> ```
>>
>> For `docker-compose.yml` I use:
>>
>> ```
>> *version: "3"*
>>
>> *services:*
>> *  db:*
>> *image: postgres*
>> *volumes:*
>> *  - ./data/db:/var/lib/postgresql/data*
>> *  -
>> ./scripts/install-extensions.sql:/docker-entrypoint-initdb.d/install-extensions.sql*
>>
>> *environment:*
>> *  - POSTGRES_DB=postgres*
>> *  - POSTGRES_USER=postgres*
>> *  - POSTGRES_PASSWORD=postgres*
>>
>> *  web:*
>> *build: .*
>> *command: python manage.py runserver 0.0.0.0:8000
>> *
>> *volumes:*
>> *  - .:/code*
>> *ports:*
>> *  - "8000:8000"*
>> *depends_on:*
>> *  - db*
>> *links:*
>> *  - db*
>> ```
>>
>> ```
>> *$ cat scripts/install-extensions.sql *
>> *CREATE EXTENSION hstore;*
>> ```
>>
>> I had to change:
>>
>> ```
>> *$ vim i5k/settings.py*
>> *DATABASES = {*
>> *'default': {*
>> *'ENGINE': 'django.db.backends.postgresql_psycopg2',*
>> *'NAME': 'postgres',*
>> *'USER': 'postgres',*
>> *'PASSWORD': 'postgres',*
>> *'HOST': 'db',*
>> *'PORT': '5432',*
>> *}*
>> *}*
>> ```
>>
>> Next, I ran `*docker-compose up --build*` and opened in Browser 
>> `*http://localhost:8000/admin/
>> *` which caused:
>>
>> ```
>> *Environment:*
>>
>>
>> *Request Method: GET*
>> *Request URL: http://localhost:8000/admin/ *
>>
>> *Django Version: 1.8.12*
>> *Python Version: 2.7.18*
>> *Installed Applications:*
>> *('django.contrib.auth',*
>> * 'django.contrib.contenttypes',*
>> * 'django.contrib.sessions',*
>> * 'django.contrib.sites',*
>> * 'django.contrib.messages',*
>> * 'django.contrib.staticfiles',*
>> * 'django.contrib.postgres',*
>> * 'axes',*
>> * 'rest_framework',*
>> * 'rest_framework_swagger',*
>> * 'pipeline',*
>> * 'app',*
>> * 'blast',*
>> * 'migrate_account',*
>> * 'suit',*
>> * 'filebrowser',*
>> * 'django.contrib.admin',*
>> * 'django.contrib.admindocs',*
>> * 'social.apps.django_app.default',*
>> * 'captcha',*
>> * 'dashboard',*
>> * 'proxy',*
>> * 'hmmer',*
>> * 'clustal',*
>> * 'webapollo_sso',*
>> * 'drupal_sso')*
>> *Installed Middleware:*
>> *('django.middleware.common.CommonMiddleware',*
>> * 'django.contrib.sessions.middleware.SessionMiddleware',*
>> * 'django.middleware.csrf.CsrfViewMiddleware',*
>> * 'django.contrib.auth.middleware.AuthenticationMiddleware',*
>> * 'django.contrib.messages.middleware.MessageMiddleware',*
>> * 'axes.middleware.FailedLoginMiddleware',*
>> * 'app.middleware.SocialAuthExceptionMiddleware')*
>>
>>
>> *Traceback:*
>> *File
>> "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" in
>> get_response*
>> *  132. response = wrapped_callback(request,
>> *callback_args, **callback_kwargs)*
>> *File
>> "/usr/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in
>> wrapper*
>> *  254. return self.admin_view(view, cacheable)(*args,
>> **kwargs)*
>> *File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py"
>> in _wrapped_view*
>> *  110. response = view_func(request, *args,
>> **kwargs)*
>> *File
>> "/usr/local/lib/python2.7/site-packages/django/views/decorators/cache.py"
>> in _wrapped_view_func*
>> *  57. response = view_func(request, *args, **kwargs)*
>> *File
>> "/usr/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in
>> inner*
>> *  222. if not self.has_permission(request):*
>> *File
>> "/usr/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in
>> has_permission*
>> *  162. return request.user.is_active and request.user.is_staff*
>> *File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py"
>> in inner*
>> *  225. self._setup()*
>> *File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py"
>> in _setup*
>> *  376. self._wrapped = self._setupfunc()*
>> *File
>> "/usr/local/lib/python2.7/sit

Error finding Upload-Folder. Maybe it does not exist?

2021-05-24 Thread Michał T . Lorenc
Hello,
I found a Django project and failed to get it running in Docker container
in the following way:

 1. `*git clone git clone https://github.com/NAL-i5K/django-blast.git
*`
 2. `*$ cat requirements.txt*` in this files the below dependencies had to
be updated:
- psycopg2==2.8.6

I have the following Dockerfile:

```
*FROM python:2*
*ENV PYTHONUNBUFFERED=1*
*RUN apt-get update && apt-get install -y postgresql-client*
*WORKDIR /code*
*COPY requirements.txt /code/*
*RUN pip install -r requirements.txt*
*COPY . /code/*
*RUN mkdir -p /var/log/django*
*RUN mkdir -p /var/log/i5k*
```

For `docker-compose.yml` I use:

```
*version: "3"*

*services:*
*  db:*
*image: postgres*
*volumes:*
*  - ./data/db:/var/lib/postgresql/data*
*  -
./scripts/install-extensions.sql:/docker-entrypoint-initdb.d/install-extensions.sql*

*environment:*
*  - POSTGRES_DB=postgres*
*  - POSTGRES_USER=postgres*
*  - POSTGRES_PASSWORD=postgres*

*  web:*
*build: .*
*command: python manage.py runserver 0.0.0.0:8000 *
*volumes:*
*  - .:/code*
*ports:*
*  - "8000:8000"*
*depends_on:*
*  - db*
*links:*
*  - db*
```

```
*$ cat scripts/install-extensions.sql *
*CREATE EXTENSION hstore;*
```

I had to change:

```
*$ vim i5k/settings.py*
*DATABASES = {*
*'default': {*
*'ENGINE': 'django.db.backends.postgresql_psycopg2',*
*'NAME': 'postgres',*
*'USER': 'postgres',*
*'PASSWORD': 'postgres',*
*'HOST': 'db',*
*'PORT': '5432',*
*}*
*}*
```

Next, I ran:

   1. `*docker-compose up --build*`
   2. `*docker-compose run web python manage.py`*
   3. `*docker-compose run web python manage.py migrate*`
   4. `*docker-compose run web python manage.py createsuperuser`*

Finally, I opened in Browser `
http://localhost:8000/admin/blast/blastdb/add/` and try to upload a file
and got this error:


*```*















*web_1  | [24/May/2021 18:04:53] "POST
/admin/blast/sequencetype/add/?_to_field=id&_popup=1 HTTP/1.1" 200 237web_1
 | [24/May/2021 18:04:58] "GET /admin/blast/blastdb/add/ HTTP/1.1" 200
15281web_1  | [24/May/2021 18:04:58] "GET /admin/jsi18n/ HTTP/1.1" 200
2372web_1  | django.request ERROR 2021-05-24 18:05:05,381 10 [Internal
Server Error: /admin/filebrowser/browse/]web_1  | Traceback (most recent
call last):web_1  |   File
"/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line
132, in get_responseweb_1  | response = wrapped_callback(request,
*callback_args, **callback_kwargs)web_1  |   File
"/usr/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py",
line 22, in _wrapped_viewweb_1  | return view_func(request, *args,
**kwargs)web_1  |   File
"/usr/local/lib/python2.7/site-packages/django/views/decorators/cache.py",
line 57, in _wrapped_view_funcweb_1  | response = view_func(request,
*args, **kwargs)web_1  |   File "/code/filebrowser/views.py", line 89, in
browseweb_1  | raise ImproperlyConfigured, _("Error finding
Upload-Folder. Maybe it does not exist?")web_1  | ImproperlyConfigured:
Error finding Upload-Folder. Maybe it does not exist?web_1  | [24/May/2021
18:05:05] "GET
/admin/filebrowser/browse/?pop=1&dir=blast/db/&type=FASTA&filter_type=FASTA
HTTP/1.1" 500 101471*
*```*
Where do I have to create *blast**/db* folder?


Thank you in advance

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


Re: Base Template per User

2021-05-24 Thread Kelvin Sajere
I don't know why you would want users to upload their own base HTML file,
but if it's to make every user have a unique frontend view, then I think it
would be better just having the users choose layouts, styles and other
frontend properties that would be saved to the database, then use these
saved properties to dynamically alter the UI.

On Mon, May 24, 2021 at 10:05 PM sebasti...@gmail.com <
sebastian.ju...@gmail.com> wrote:

> Hello,
>
> i want that every user from website can upload a base html file that are
> then used on every views as base template. Every User have then his own
> layout...
>
> Have anyone experience with such a thing?
>
> Regards
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/22701bf0-c5ad-48c5-a4e7-5bce4bc337f4n%40googlegroups.com
> 
> .
>


-- 
KeLLs

-- 
You received this message because you are subscribed to the Google Groups 
"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/CADYqDX2ERE%3DY8D3qN3mD3gOY3cpOC%3D6fFy_7LuQacto%3DoJZbPQ%40mail.gmail.com.


Re: In need of immediate help from Django community

2021-05-24 Thread Kelvin Sajere
Import the User model in your forms.py and use it instead of Profile. As
the error clearly states, the Profile model does not have a username field.
Django actually recommends using the AbstractUser, or the AbstractBaseUser
to extend the default User model if you wish to create something like a
profile.

On Mon, May 24, 2021 at 9:31 PM Omkar Parab  wrote:

> Error is in forms.py file.
>
> "model = User" not profile.
>
> Default "User" model comes with username, email filed.
>
> Why you're creating another email field in the Profile model?
>
> Just fetch it using {{ user.email }}
>
>
> On Tue, May 25, 2021, 1:38 AM Aritra Ray  wrote:
>
>> Hi,
>>
>> I've been facing a problem recently in creating a Django Profile model
>> for an E-commerce website.
>> Error: FieldError(message) django.core.exceptions.FieldError: Unknown
>> field(s) (username) specified for Profile
>> Kindly help me out if possible. The screenshots have been attached below
>> and the github link for the project has been provided.
>>
>> Link: https://github.com/First-project-01/Django-ecommerce (Check out
>> the 'changes' branch)
>>
>> Regards,
>> Aritra
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "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/CAFecadvxBCa6w02%3DZ887%2BnaEdY-R6B9%2BVVFzVW5zYvkt1gA2hg%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/CAJY8mfzFT-GqqZ0YvdLKH9gKcTAv%2B1srG9973pXYfA5f_qVA7w%40mail.gmail.com
> 
> .
>


-- 
KeLLs

-- 
You received this message because you are subscribed to the Google Groups 
"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/CADYqDX1dm1Y-T89W9%3DyZQs1bH04eNUj5qcCpwieOSDoY%2BDy9Kg%40mail.gmail.com.


Re: Exception Value: relation "django_session" does not exist

2021-05-24 Thread RANGA BHARATH JINKA
You are welcome :-)

On Tue, May 25, 2021 at 3:41 AM Michał T. Lorenc 
wrote:

> Hi,
> Thank you it works.
>
> On Tue, May 25, 2021 at 12:31 AM RANGA BHARATH JINKA <
> bharathjink...@gmail.com> wrote:
>
>> hi,
>>
>> Run migrations. python manage.py makemigrations and python manage.py
>> migrate
>>
>> On Mon, May 24, 2021 at 7:20 PM Mic  wrote:
>>
>>> Hello,
>>> I found a Django project and failed to get it running in Docker
>>> container in the following way:
>>>
>>>  1. `*git clone git clone https://github.com/NAL-i5K/django-blast.git
>>> *`
>>>  2. `*$ cat requirements.txt*` in this files the below dependencies had
>>> to be updated:
>>> - psycopg2==2.8.6
>>>
>>> I have the following Dockerfile:
>>>
>>> ```
>>> *FROM python:2*
>>> *ENV PYTHONUNBUFFERED=1*
>>> *RUN apt-get update && apt-get install -y postgresql-client*
>>> *WORKDIR /code*
>>> *COPY requirements.txt /code/*
>>> *RUN pip install -r requirements.txt*
>>> *COPY . /code/*
>>> *RUN mkdir -p /var/log/django*
>>> *RUN mkdir -p /var/log/i5k*
>>> ```
>>>
>>> For `docker-compose.yml` I use:
>>>
>>> ```
>>> *version: "3"*
>>>
>>> *services:*
>>> *  db:*
>>> *image: postgres*
>>> *volumes:*
>>> *  - ./data/db:/var/lib/postgresql/data*
>>> *  -
>>> ./scripts/install-extensions.sql:/docker-entrypoint-initdb.d/install-extensions.sql*
>>>
>>> *environment:*
>>> *  - POSTGRES_DB=postgres*
>>> *  - POSTGRES_USER=postgres*
>>> *  - POSTGRES_PASSWORD=postgres*
>>>
>>> *  web:*
>>> *build: .*
>>> *command: python manage.py runserver 0.0.0.0:8000
>>> *
>>> *volumes:*
>>> *  - .:/code*
>>> *ports:*
>>> *  - "8000:8000"*
>>> *depends_on:*
>>> *  - db*
>>> *links:*
>>> *  - db*
>>> ```
>>>
>>> ```
>>> *$ cat scripts/install-extensions.sql *
>>> *CREATE EXTENSION hstore;*
>>> ```
>>>
>>> I had to change:
>>>
>>> ```
>>> *$ vim i5k/settings.py*
>>> *DATABASES = {*
>>> *'default': {*
>>> *'ENGINE': 'django.db.backends.postgresql_psycopg2',*
>>> *'NAME': 'postgres',*
>>> *'USER': 'postgres',*
>>> *'PASSWORD': 'postgres',*
>>> *'HOST': 'db',*
>>> *'PORT': '5432',*
>>> *}*
>>> *}*
>>> ```
>>>
>>> Next, I ran `*docker-compose up --build*` and opened in Browser 
>>> `*http://localhost:8000/admin/
>>> *` which caused:
>>>
>>> ```
>>> *Environment:*
>>>
>>>
>>> *Request Method: GET*
>>> *Request URL: http://localhost:8000/admin/
>>> *
>>>
>>> *Django Version: 1.8.12*
>>> *Python Version: 2.7.18*
>>> *Installed Applications:*
>>> *('django.contrib.auth',*
>>> * 'django.contrib.contenttypes',*
>>> * 'django.contrib.sessions',*
>>> * 'django.contrib.sites',*
>>> * 'django.contrib.messages',*
>>> * 'django.contrib.staticfiles',*
>>> * 'django.contrib.postgres',*
>>> * 'axes',*
>>> * 'rest_framework',*
>>> * 'rest_framework_swagger',*
>>> * 'pipeline',*
>>> * 'app',*
>>> * 'blast',*
>>> * 'migrate_account',*
>>> * 'suit',*
>>> * 'filebrowser',*
>>> * 'django.contrib.admin',*
>>> * 'django.contrib.admindocs',*
>>> * 'social.apps.django_app.default',*
>>> * 'captcha',*
>>> * 'dashboard',*
>>> * 'proxy',*
>>> * 'hmmer',*
>>> * 'clustal',*
>>> * 'webapollo_sso',*
>>> * 'drupal_sso')*
>>> *Installed Middleware:*
>>> *('django.middleware.common.CommonMiddleware',*
>>> * 'django.contrib.sessions.middleware.SessionMiddleware',*
>>> * 'django.middleware.csrf.CsrfViewMiddleware',*
>>> * 'django.contrib.auth.middleware.AuthenticationMiddleware',*
>>> * 'django.contrib.messages.middleware.MessageMiddleware',*
>>> * 'axes.middleware.FailedLoginMiddleware',*
>>> * 'app.middleware.SocialAuthExceptionMiddleware')*
>>>
>>>
>>> *Traceback:*
>>> *File
>>> "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" in
>>> get_response*
>>> *  132. response = wrapped_callback(request,
>>> *callback_args, **callback_kwargs)*
>>> *File
>>> "/usr/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in
>>> wrapper*
>>> *  254. return self.admin_view(view, cacheable)(*args,
>>> **kwargs)*
>>> *File
>>> "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py" in
>>> _wrapped_view*
>>> *  110. response = view_func(request, *args,
>>> **kwargs)*
>>> *File
>>> "/usr/local/lib/python2.7/site-packages/django/views/decorators/cache.py"
>>> in _wrapped_view_func*
>>> *  57. response = view_func(request, *args, **kwargs)*
>>> *File
>>> "/usr/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in
>>> inner*
>>> *  222. if not self.has_permission(request):*
>>> *File
>>> "/usr/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in
>>> has_permission*
>>> *  162. return request.user.is_active and request.user.is_staff*
>>> *File
>>> "/usr/local/lib/python2.7/site-packages/dj

Re: Announcing DjHTML: A Django template indender

2021-05-24 Thread lalit suthar
This is looking pretty cool! 

On Monday, 24 May 2021 at 18:54:12 UTC+5:30 Jaap Joris Vens wrote:

> Dear all,
>
> I would like to take this opportunity to announce my side project to
> the Django community. It's a Django template indenter called DjHTML.
> It's Black for Django templates!
>
> https://github.com/rtts/djhtml/
>
> Over the past year I have fallen in love with Black and pre-commit to
> automatically format code upon each commit. However, I could not find
> any tool that would do the same for HTML files and so I decided to
> write one myself. Take for instance the following template:
>
> {% block content %}
>  {% if index > 1 %}
> class="extra"
> {% endif %}
> >
> {% localize on %}
> {% if clickable %}
> 
> {% endif %}
> Blog post {{ nr }}
> {% if clickable %}
> 
> {% endif %}
> {% endlocalize %}
> 
> {% endblock %}
>
> This is what it looks like after processing by DjHTML:
>
> {% block content %}
>  {% if index > 1 %}
> class="extra"
> {% endif %}
> >
> {% localize on %}
> {% if clickable %}
> 
> {% endif %}
> Blog post {{ nr }}
> {% if clickable %}
> 
> {% endif %}
> {% endlocalize %}
> 
> {% endblock %}
>
> Currently, DjHTML is able to parse DTL, HTML, CSS, Javascript and any
> combinations of these inside the same template. The indentation rules
> are similar to Emacs' web-mode.el but with better handling of some
> edge cases.
>
> The difference with Black is that DjHTML is an indenter and not a
> formatter: It will only add/remove whitespace and not insert newlines
> or any other characters. The goal is to indent already well-structured
> templates but not to fix broken ones. Also, unlike Black, the tabwidth
> is configurable :-)
>
> I am hoping that some of you will give it a try and hopefully provide
> me with some feedback, test cases, and bug reports that will help me
> improve this tool.
>
> Greetings,
> Jaap Joris Vens
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/1c5db289-6978-49bd-a306-271997bd5154n%40googlegroups.com.


Best way to deal with members registration in Django apps

2021-05-24 Thread Ram
Hi,

We have members registration module where members will enter email ID as a
login name. Upon submitting the Sign Up form, we generate an email to the
given email address using Sendmail code that we added in our Django
project.

So far we used a personal gmail account as an admin email account to
generate and send emails to registered members ( as shown below)

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'  # added by me
> EMAIL_HOST = 'smtp.gmail.com'
> EMAIL_PORT = 587
> EMAIL_HOST_USER = 'xxad...@gmail.com'
> EMAIL_HOST_PASSWORD = '122hhhlll'
> EMAIL_USE_TLS = True
>

but we need to move on to next step on our development and production
servers to have a real time admin email to handle member registrations and
further communication with members, like sending newsletters and some
important security notifications.

Could you please suggest what you been using with zero issues in your
Django application?

Best regards,
~Ram

-- 
You received this message because you are subscribed to the Google Groups 
"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/CA%2BOi5F0C17vnf4vEvZgMYha0b2XB49iZpJ4UzqKb56-Tmar-cQ%40mail.gmail.com.


Re: Announcing DjHTML: A Django template indender

2021-05-24 Thread RANGA BHARATH JINKA
Awesome

On Tue, May 25, 2021 at 10:13 AM lalit suthar 
wrote:

> This is looking pretty cool!
>
> On Monday, 24 May 2021 at 18:54:12 UTC+5:30 Jaap Joris Vens wrote:
>
>> Dear all,
>>
>> I would like to take this opportunity to announce my side project to
>> the Django community. It's a Django template indenter called DjHTML.
>> It's Black for Django templates!
>>
>> https://github.com/rtts/djhtml/
>>
>> Over the past year I have fallen in love with Black and pre-commit to
>> automatically format code upon each commit. However, I could not find
>> any tool that would do the same for HTML files and so I decided to
>> write one myself. Take for instance the following template:
>>
>> {% block content %}
>> > {% if index > 1 %}
>> class="extra"
>> {% endif %}
>> >
>> {% localize on %}
>> {% if clickable %}
>> 
>> {% endif %}
>> Blog post {{ nr }}
>> {% if clickable %}
>> 
>> {% endif %}
>> {% endlocalize %}
>> 
>> {% endblock %}
>>
>> This is what it looks like after processing by DjHTML:
>>
>> {% block content %}
>> > {% if index > 1 %}
>> class="extra"
>> {% endif %}
>> >
>> {% localize on %}
>> {% if clickable %}
>> 
>> {% endif %}
>> Blog post {{ nr }}
>> {% if clickable %}
>> 
>> {% endif %}
>> {% endlocalize %}
>> 
>> {% endblock %}
>>
>> Currently, DjHTML is able to parse DTL, HTML, CSS, Javascript and any
>> combinations of these inside the same template. The indentation rules
>> are similar to Emacs' web-mode.el but with better handling of some
>> edge cases.
>>
>> The difference with Black is that DjHTML is an indenter and not a
>> formatter: It will only add/remove whitespace and not insert newlines
>> or any other characters. The goal is to indent already well-structured
>> templates but not to fix broken ones. Also, unlike Black, the tabwidth
>> is configurable :-)
>>
>> I am hoping that some of you will give it a try and hopefully provide
>> me with some feedback, test cases, and bug reports that will help me
>> improve this tool.
>>
>> Greetings,
>> Jaap Joris Vens
>>
> --
> You received this message because you are subscribed to the Google Groups
> "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/1c5db289-6978-49bd-a306-271997bd5154n%40googlegroups.com
> 
> .
>


-- 
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

-- 
You received this message because you are subscribed to the Google Groups 
"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/CAK5m316w4rBMedgB%2BhJWJNRdh-ht2PZUWXLVmrJkvya7tdgP2g%40mail.gmail.com.


Re: Making a rather small web app, is Django right for it?

2021-05-24 Thread Antonis Christofides
It's hard to say. While Django /is/ suitable, it's also large. If you don't know 
it already, you might not want to learn it just for this. It's possible Flask 
would be a better choice, since it's smaller and (I think) easier. (Note: I'm a 
Django developer, and I'm not a Flask developer.)


So I think it's mostly a question of what you want: Why do you want to do this 
project? Is it commercial? Is it a hobby? Is it something you do because you 
find it appealing? If it's something like a hobby, pick up whatever seems more 
fun to you.


Regards,

Antonis

Antonis Christofides
+30-6979924665 (mobile)



On 24/05/2021 17.37, Devin Prater wrote:
Hi all. I am a rather new Python learner, although I've made the following 
script:


https://github.com/prater-devin/src/blob/main/lunch/lunch.py 



I want to turn this into a central place where students can get not just the 
lunch menu, but also other menus, upcoming events, things like that, but not 
much more than that. So, in order to bypass the need for submitting to the App 
Store because this isn't that big of an app, I decided to go with web 
development instead. Since I already know Python, enough to make that simple 
program at least, I thought I'd just use Django to make this.


Now, I've also tried using Beeware to make an actual app, and that seems easy 
compared to getting started with Django, but I don't want to disregard Django 
just because Beeware is easier. Plus Beeware doesn't seem to have web app 
creation support yet. So, any ideas? How hard would it be to take something 
like that simple code, probably for the backend more than frontend, and 
enhance it, mainly adding more requests to a URL, then getting text using BS4, 
then showing it on the app? I imagine tabs at the bottom of the screen for 
"menus", "vending machines", and "events and news." Stuff like that, then the 
main content in the middle, then buttons at the top to change between menu 
sources on the menus tab and such. So, not that much interaction I'd think. 
So, what do you all think? Thanks for any help.


Devin Prater

Technical Assistant


256 761-3423

Alabama Institute for Deaf and Blind

P.O. Box 698 | 1105 Fort Lashley Ave.

Talladega, AL 35161


www.aidb.org 

FacebookDiscover how we’re limitless. 



--
You received this message because you are subscribed to the Google Groups 
"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/CAKXtajAeZPSpgZg9a38YtCksi4N7VF51DJYxWAQ1K0P3V%3D-P_A%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/90a0185c-d744-826c-c1b7-d459d23d18a3%40antonischristofides.com.


Re: Best way to deal with members registration in Django apps

2021-05-24 Thread Antonis Christofides

using Sendmail code that we added in our Django project
You really added sendmail code to your Django project? Or did you configure your 
Django project to use sendmail?


There is no single answer to what you are asking. What I do, and I also propose 
to people to do 
, is:


 * Use a small forward-only local name server, namely the DragonFly Mail Agent
   or dma.
 * Use an external service like Runbox or mailbox.org as a mail server. I think
   that paid Google mail accounts will also work.

As for regularly emailing members, again I'd use an external service such as 
mailchimp, but I have no experience integrating such a service with a Django app.


Antonis Christofides
+30-6979924665 (mobile)


On 25/05/2021 08.02, Ram wrote:

Hi,

We have members registration module where members will enter email ID as a 
login name. Upon submitting the Sign Up form, we generate an email to the 
given email address using Sendmail code that we added in our Django project.


So far we used a personal gmail account as an admin email account to generate 
and send emails to registered members ( as shown below)


EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'  # added by me
EMAIL_HOST = 'smtp.gmail.com '
EMAIL_PORT = 587
EMAIL_HOST_USER = 'xxad...@gmail.com '
EMAIL_HOST_PASSWORD = '122hhhlll'
EMAIL_USE_TLS = True


but we need to move on to next step on our development and production servers 
to have a real time admin email to handle member registrations and further 
communication with members, like sending newsletters and some important 
security notifications.


Could you please suggest what you been using with zero issues in your Django 
application?


Best regards,
~Ram


--
You received this message because you are subscribed to the Google Groups 
"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/CA%2BOi5F0C17vnf4vEvZgMYha0b2XB49iZpJ4UzqKb56-Tmar-cQ%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/e8186cd2-9a0e-899c-227f-489ae74cf227%40antonischristofides.com.


Re: In need of immediate help from Django community

2021-05-24 Thread Aritra Ray
Thank you for your response. It worked out perfectly.

On Tue, 25 May, 2021, 4:39 am Kelvin Sajere,  wrote:

> Import the User model in your forms.py and use it instead of Profile. As
> the error clearly states, the Profile model does not have a username field.
> Django actually recommends using the AbstractUser, or the AbstractBaseUser
> to extend the default User model if you wish to create something like a
> profile.
>
> On Mon, May 24, 2021 at 9:31 PM Omkar Parab  wrote:
>
>> Error is in forms.py file.
>>
>> "model = User" not profile.
>>
>> Default "User" model comes with username, email filed.
>>
>> Why you're creating another email field in the Profile model?
>>
>> Just fetch it using {{ user.email }}
>>
>>
>> On Tue, May 25, 2021, 1:38 AM Aritra Ray  wrote:
>>
>>> Hi,
>>>
>>> I've been facing a problem recently in creating a Django Profile model
>>> for an E-commerce website.
>>> Error: FieldError(message) django.core.exceptions.FieldError: Unknown
>>> field(s) (username) specified for Profile
>>> Kindly help me out if possible. The screenshots have been attached below
>>> and the github link for the project has been provided.
>>>
>>> Link: https://github.com/First-project-01/Django-ecommerce (Check out
>>> the 'changes' branch)
>>>
>>> Regards,
>>> Aritra
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "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/CAFecadvxBCa6w02%3DZ887%2BnaEdY-R6B9%2BVVFzVW5zYvkt1gA2hg%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/CAJY8mfzFT-GqqZ0YvdLKH9gKcTAv%2B1srG9973pXYfA5f_qVA7w%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> KeLLs
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/CADYqDX1dm1Y-T89W9%3DyZQs1bH04eNUj5qcCpwieOSDoY%2BDy9Kg%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/CAFecadt6r70L7v78%3Dy63MfyNdFLYJwfKJaP2BeuxO-%3Dgp9fmMg%40mail.gmail.com.