Re: get country from IP_addres.

2021-12-15 Thread Amor Zamora
Thank you very much I review it and let you know if it served me.


El jue, 16 dic 2021 a las 3:30, Michael Thomas (<
michael.thomas.s...@gmail.com>) escribió:

> The geoip2 python package will help you get location information from the
> the IP.
> Inserting the data into a database via the ORM is fairly straight forward.
> If you haven't worked with the ORM yet, this part of the django tutorial
> should get you pointed in the right direction:
>
> https://docs.djangoproject.com/en/4.0/intro/tutorial02/#playing-with-the-api
>
> Kind Regards,
> Michael Thomas
>
> On Thu, Dec 16, 2021 at 3:08 PM Amor Zamora  wrote:
>
>> Can you help me?
>> I need to obtain the country of where the users access from the IP and
>> insert that information into the sqlite3 database.
>>
>> Little description.
>> I have an application that I have to do the statistics and insert into
>> the sqlite3 database, the IP information, the country from which it is
>> accessed, who generates the information and how many times has clicked on
>> the application.
>> Question 1 is that I cannot find any suitable module in DJango that
>> allows me to combine the information described above.
>> I am using. IP_address, os, daemonize and socket and I don't quite
>> realize how to get the country from where it is accessed.
>> Thanks
>>
>> --
>> Amor Zamora
>> Behind the distance,
>> your mouth and mine hide,
>> complices of a kiss, caresses, fantasies,
>> distance as close as the sky and the sea,
>> my piece is in your bed, in mine, is your love.
>> Behind the distance hide love, memories,
>> encounters, experiences, circumstances, pain and good times,
>> it is after her, the distant ones,
>> that we leave feelings,
>> but if we really miss,
>> distance,
>> it is only your time.
>>
>> --
>> You received this message because you are subscribed to the Google 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/CAKMTbHXbM4QFh5kRiShsroObKjefGzvRchX5m3S2ps6M95bwgQ%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/CAEdx1fpn3NzS2U%2BqoCfk%2BsL%2BKbpz72HCYX105LrV6TaXpuwamQ%40mail.gmail.com
> 
> .
>


-- 
Amor Zamora
Behind the distance,
your mouth and mine hide,
complices of a kiss, caresses, fantasies,
distance as close as the sky and the sea,
my piece is in your bed, in mine, is your love.
Behind the distance hide love, memories,
encounters, experiences, circumstances, pain and good times,
it is after her, the distant ones,
that we leave feelings,
but if we really miss,
distance,
it is only your time.

-- 
You received this message because you are subscribed to the Google 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/CAKMTbHVcQ84bYV8sw6kK7zBH4sdDrgGeGVyx%3DKAdMRJxNNxtPg%40mail.gmail.com.


Re: I need orientation on what to do and how to do it (procedure)

2021-12-15 Thread Amor Zamora
Thank you very much I review it and let you know if it served me.


El jue, 16 dic 2021 a las 3:25, Muhammad Juwaini Abdul Rahman (<
juwa...@gmail.com>) escribió:

> You can try this json api.
> https://www.geoplugin.com/webservices/json
>
> I believe there's a lot of services out there with this capability.
>
> On Thu, 16 Dec 2021 at 10:13, Amor Zamora  wrote:
>
>>
>> Can you help me?
>> I need to obtain the country of where the users access from the IP and
>> insert that information into the sqlite3 database.
>>
>> Little description.
>> I have an application that I have to do the statistics and insert into
>> the sqlite3 database, the IP information, the country from which it is
>> accessed, who generates the information and how many times has clicked on
>> the application.
>> Question 1 is that I cannot find any suitable module in DJango that
>> allows me to combine the information described above.
>> I am using. IP_address, os, daemonize and socket and I don't quite
>> realize how to get the country from where it is accessed.
>> Thanks
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAKMTbHVU%2BkJQw%2B8wnA7U__x7zCnrd%3DyvA%2BwmwFta2cPDwS6%2BMg%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/CAFKhtoQQ8e41eV7p_ZCsJReg%2BZqVAHR%2BUjfmwjXpYMvCZ-SEpw%40mail.gmail.com
> 
> .
>


-- 
Amor Zamora
Behind the distance,
your mouth and mine hide,
complices of a kiss, caresses, fantasies,
distance as close as the sky and the sea,
my piece is in your bed, in mine, is your love.
Behind the distance hide love, memories,
encounters, experiences, circumstances, pain and good times,
it is after her, the distant ones,
that we leave feelings,
but if we really miss,
distance,
it is only your time.

-- 
You received this message because you are subscribed to the Google 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/CAKMTbHUwQPircc2DoFfc%3DhMN_FL3N576eNzXxt1N2xmc9%2B989A%40mail.gmail.com.


Re: get country from IP_addres.

2021-12-15 Thread Michael Thomas
The geoip2 python package will help you get location information from the
the IP.
Inserting the data into a database via the ORM is fairly straight forward.
If you haven't worked with the ORM yet, this part of the django tutorial
should get you pointed in the right direction:
https://docs.djangoproject.com/en/4.0/intro/tutorial02/#playing-with-the-api

Kind Regards,
Michael Thomas

On Thu, Dec 16, 2021 at 3:08 PM Amor Zamora  wrote:

> Can you help me?
> I need to obtain the country of where the users access from the IP and
> insert that information into the sqlite3 database.
>
> Little description.
> I have an application that I have to do the statistics and insert into the
> sqlite3 database, the IP information, the country from which it is
> accessed, who generates the information and how many times has clicked on
> the application.
> Question 1 is that I cannot find any suitable module in DJango that allows
> me to combine the information described above.
> I am using. IP_address, os, daemonize and socket and I don't quite realize
> how to get the country from where it is accessed.
> Thanks
>
> --
> Amor Zamora
> Behind the distance,
> your mouth and mine hide,
> complices of a kiss, caresses, fantasies,
> distance as close as the sky and the sea,
> my piece is in your bed, in mine, is your love.
> Behind the distance hide love, memories,
> encounters, experiences, circumstances, pain and good times,
> it is after her, the distant ones,
> that we leave feelings,
> but if we really miss,
> distance,
> it is only your time.
>
> --
> You received this message because you are subscribed to the Google 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/CAKMTbHXbM4QFh5kRiShsroObKjefGzvRchX5m3S2ps6M95bwgQ%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/CAEdx1fpn3NzS2U%2BqoCfk%2BsL%2BKbpz72HCYX105LrV6TaXpuwamQ%40mail.gmail.com.


Re: I need orientation on what to do and how to do it (procedure)

2021-12-15 Thread Muhammad Juwaini Abdul Rahman
You can try this json api.
https://www.geoplugin.com/webservices/json

I believe there's a lot of services out there with this capability.

On Thu, 16 Dec 2021 at 10:13, Amor Zamora  wrote:

>
> Can you help me?
> I need to obtain the country of where the users access from the IP and
> insert that information into the sqlite3 database.
>
> Little description.
> I have an application that I have to do the statistics and insert into the
> sqlite3 database, the IP information, the country from which it is
> accessed, who generates the information and how many times has clicked on
> the application.
> Question 1 is that I cannot find any suitable module in DJango that allows
> me to combine the information described above.
> I am using. IP_address, os, daemonize and socket and I don't quite realize
> how to get the country from where it is accessed.
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKMTbHVU%2BkJQw%2B8wnA7U__x7zCnrd%3DyvA%2BwmwFta2cPDwS6%2BMg%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/CAFKhtoQQ8e41eV7p_ZCsJReg%2BZqVAHR%2BUjfmwjXpYMvCZ-SEpw%40mail.gmail.com.


Fwd: I need orientation on what to do and how to do it (procedure)

2021-12-15 Thread Amor Zamora
Can you help me?
I need to obtain the country of where the users access from the IP and
insert that information into the sqlite3 database.

Little description.
I have an application that I have to do the statistics and insert into the
sqlite3 database, the IP information, the country from which it is
accessed, who generates the information and how many times has clicked on
the application.
Question 1 is that I cannot find any suitable module in DJango that allows
me to combine the information described above.
I am using. IP_address, os, daemonize and socket and I don't quite realize
how to get the country from where it is accessed.
Thanks

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


get country from IP_addres.

2021-12-15 Thread Amor Zamora
Can you help me?
I need to obtain the country of where the users access from the IP and
insert that information into the sqlite3 database.

Little description.
I have an application that I have to do the statistics and insert into the
sqlite3 database, the IP information, the country from which it is
accessed, who generates the information and how many times has clicked on
the application.
Question 1 is that I cannot find any suitable module in DJango that allows
me to combine the information described above.
I am using. IP_address, os, daemonize and socket and I don't quite realize
how to get the country from where it is accessed.
Thanks

-- 
Amor Zamora
Behind the distance,
your mouth and mine hide,
complices of a kiss, caresses, fantasies,
distance as close as the sky and the sea,
my piece is in your bed, in mine, is your love.
Behind the distance hide love, memories,
encounters, experiences, circumstances, pain and good times,
it is after her, the distant ones,
that we leave feelings,
but if we really miss,
distance,
it is only your time.

-- 
You received this message because you are subscribed to the Google 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/CAKMTbHXbM4QFh5kRiShsroObKjefGzvRchX5m3S2ps6M95bwgQ%40mail.gmail.com.


installation of Django

2021-12-15 Thread mohamed farhan
hello my dear friends
just would like to know how to install Django using pip install Django==4.0 
well this code wasn't working for me and being the first time user  of both 
python and Django, feeling bit confused so could u guys 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/c703dece-7570-4953-9307-912baca38a32n%40googlegroups.com.


Re: ModuleNotFoundError: No module named [project_name]

2021-12-15 Thread Muhammad Juwaini Abdul Rahman
It seems that you don't have permission to execute your wsgi.py file or the
filepath is incorrect.

Suggestion: Why don't you use nginx + gunicorn?

On Wed, 15 Dec 2021 at 23:05, Kyle Paterson 
wrote:

> I am using django 4.0 with Apache and mod_wsgi. Whenever I try request the
> site through apache, I get the following error:
> [Wed Dec 15 14:51:59.385259 2021] [wsgi:info] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] mod_wsgi (pid=15535,
> process='traveldata', application='127.0.1.1|'): Loading Python script file
> '/home/kyle/active-travel/traveldata/traveldata/wsgi.py'.
> [Wed Dec 15 14:51:59.385699 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] mod_wsgi (pid=15535): Failed to
> exec Python script file
> '/home/kyle/active-travel/traveldata/traveldata/wsgi.py'.
> [Wed Dec 15 14:51:59.385718 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] mod_wsgi (pid=15535): Exception
> occurred processing WSGI script
> '/home/kyle/active-travel/traveldata/traveldata/wsgi.py'.
> [Wed Dec 15 14:51:59.385800 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] Traceback (most recent call
> last):
> [Wed Dec 15 14:51:59.385828 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File
> "/home/kyle/active-travel/traveldata/traveldata/wsgi.py", line 19, in
> 
> [Wed Dec 15 14:51:59.385831 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] application =
> django.core.handlers.wsgi.WSGIHandler()
> [Wed Dec 15 14:51:59.385836 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File
> "/home/kyle/active-travel/venv/lib/python3.8/site-packages/django/core/handlers/wsgi.py",
> line 127, in __init__
> [Wed Dec 15 14:51:59.385838 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] self.load_middleware()
> [Wed Dec 15 14:51:59.385842 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File
> "/home/kyle/active-travel/venv/lib/python3.8/site-packages/django/core/handlers/base.py",
> line 39, in load_middleware
> [Wed Dec 15 14:51:59.385844 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] for middleware_path in
> reversed(settings.MIDDLEWARE):
> [Wed Dec 15 14:51:59.385847 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File
> "/home/kyle/active-travel/venv/lib/python3.8/site-packages/django/conf/__init__.py",
> line 84, in __getattr__
> [Wed Dec 15 14:51:59.385849 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] self._setup(name)
> [Wed Dec 15 14:51:59.385859 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File
> "/home/kyle/active-travel/venv/lib/python3.8/site-packages/django/conf/__init__.py",
> line 71, in _setup
> [Wed Dec 15 14:51:59.385861 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] self._wrapped =
> Settings(settings_module)
> [Wed Dec 15 14:51:59.385864 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File
> "/home/kyle/active-travel/venv/lib/python3.8/site-packages/django/conf/__init__.py",
> line 179, in __init__
> [Wed Dec 15 14:51:59.385866 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] mod =
> importlib.import_module(self.SETTINGS_MODULE)
> [Wed Dec 15 14:51:59.385869 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File
> "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
> [Wed Dec 15 14:51:59.385871 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] return
> _bootstrap._gcd_import(name[level:], package, level)
> [Wed Dec 15 14:51:59.385875 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File " importlib._bootstrap>", line 1014, in _gcd_import
> [Wed Dec 15 14:51:59.385878 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File " importlib._bootstrap>", line 991, in _find_and_load
> [Wed Dec 15 14:51:59.385882 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File " importlib._bootstrap>", line 961, in _find_and_load_unlocked
> [Wed Dec 15 14:51:59.385886 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File " importlib._bootstrap>", line 219, in _call_with_frames_removed
> [Wed Dec 15 14:51:59.385889 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File " importlib._bootstrap>", line 1014, in _gcd_import
> [Wed Dec 15 14:51:59.385893 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File " importlib._bootstrap>", line 991, in _find_and_load
> [Wed Dec 15 14:51:59.385896 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File " importlib._bootstrap>", line 

cpanel django

2021-12-15 Thread azim rose
Hello, 

I'm new to the Django framework. Currently, I'm creating a dashboard using 
the apps and trying to deploy it on a web server using Cpanel. After 
deployment, I'm able to open the homepage and login into the dashboard, but 
the apps crashed when I tried to redirect to another page. 

Based on my reading, the configuration for redirection within Cpanel is 
managed based on htaccess file. Can anyone assist me to configure htaccess 
file for Django apps?

By the way, I deployed my apps in 
home/user_id/public_html/django_apps_folder.

-- 
You received this message because you are subscribed to the Google 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/d20e2983-f0ad-4351-816a-92587303c5e8n%40googlegroups.com.


Failure in connecting to Django host and port

2021-12-15 Thread Joshua
I have developed a small Angular app with a service script to add a 
consumer form info to a MongoDB database:

const httpOptions = {
  headers: new HttpHeaders({
'Content-Type': 'application/json',
'Accept': 'application/json'
  })
}

@Injectable()
export class DbService {
  
  constructor(private httpClient: HttpClient) { }

  addConsumerMongodb(consumer: Post): Observable {
return 
this.httpClient.post(`http://localhost:8000/apdjango/`, 
JSON.stringify(consumer), httpOptions);
  }
}

I have also written this Django method in my `views.py` file to add a 
consumer:

@csrf_exempt
@api_view(['GET', 'POST', 'DELETE'])
def handle_consumer(request):
if request.method == 'POST':
try:
consumer_data = JSONParser().parse(request)
consumer_serializer = 
ConsumerModelSerializer(data=consumer_data)

if consumer_serializer.is_valid():
consumer_serializer.save()
print(consumer_serializer.data)
response = {
'message': "Successfully uploaded a consumer with 
id = %d" % consumer_serializer.data.get('id'),
'consumers': [consumer_serializer.data],
'error': ""
}
return JsonResponse(response, 
status=status.HTTP_201_CREATED)
else:
error = {
'message': "Can not upload successfully!",
'consumers': "[]",
'error': consumer_serializer.errors
}
return JsonResponse(error, 
status=status.HTTP_400_BAD_REQUEST)
except:
exceptionError = {
'message': "Can not upload successfully!",
'consumers': "[]",
'error': "Having an exception!"
}
return JsonResponse(exceptionError, 
status=status.HTTP_500_INTERNAL_SERVER_ERROR)

and of course I have put the url pattern in my `urls.py`:

urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^apdjango/', handle_consumer),
url(r'^.*', TemplateView.as_view(template_name="home.html"), 
name="home")
]

This file is in the same folder as `views` and `models` and `serializers`. 
I have another `urls.py` in the folder that has `settings.py` and `wsgi.py` 
with the following content:

from django.conf.urls import url, include 

urlpatterns = [ 
url(r'^', include('apdjango.urls')),
]

When I use **postman** to `Post` to `http://localhost:8000/apdjango/`, it 
goes through and I see the success message, but when I invoke my Angular 
service method, I get:

POST http://localhost:8000/apdjango/ 400 (Bad Request)

ERROR kK {headers: La, status: 400, statusText: 'Bad Request', url: 
'http://localhost:8000/apdjango/', ok: false, …}

I thought the problem was to do with the URLs or / or $ which is why I just 
copied the link that works in Postman and stuck it literally in my Angular 
post service method.

I have been through every Q on stackoverflow and tried their solutions 
and suggestions, but I still cannot fix this.

*Can someone please help me?*

---

My `cors` settings are as follows:

INSTALLED_APPS = [
...
'corsheaders',
'apdjango'
]


MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',

]

CSRF_COOKIE_SECURE = True

CORS_ALLOW_ALL_ORIGINS = True
CORS_ALLOW_CREDENTIALS = False
CORS_ORIGIN_REGEX_WHITELIST = ()
CORS_URLS_REGEX = '^.*$'
CORS_ALLOW_METHODS = (
'GET',
'POST',
'PUT',
'PATCH',
'DELETE',
'UPDATE',
'OPTIONS'
)
CORS_ALLOW_HEADERS = (
'x-requested-with',
'content-type',
'accept',
'origin',
'authorization',
'x-csrftoken'
)
CORS_EXPOSE_HEADERS = ()

I also have this: `ALLOWED_HOSTS = ['*']`

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


Re: Why does django throw TypeError when sending requests through Apache WSGI?

2021-12-15 Thread Kyle Paterson
Used libapache2-mod-wsgi-py3 instead of python 2 version

On Wednesday, 15 December 2021 at 10:03:27 UTC Kyle Paterson wrote:

> I am not using either of those, I think. The only place I explicitly load 
> settings is in wsgi.py, with the line:
> os.environ[‘DJANGO_SETTINGS_MODULE’] = ‘travel data.settings'
>
> On Thu, 9 Dec 2021 at 12:52, Jason  wrote:
>
>>
>> with your settings usage, are you defining a property in settings and 
>> trying to use it anywhere?
>>
>> furthermore, are you using settings via 
>>
>> from traveldata.traveldata import settings (example)
>>
>> or via
>>
>> from django.conf import settings
>>
>> The latter is the recommended means because settings are lazy loaded.
>> On Wednesday, December 8, 2021 at 10:07:11 AM UTC-5 sencer...@gmail.com 
>> wrote:
>>
>>> Hi,
>>>
>>> I think this is not related with apache
>>>
>>> It seems like class object property is called as a method somehow.
>>> Unfortunately the error does not reveal the property name.
>>>
>>> Regards,
>>> Sencer HAMARAT
>>>
>>>
>>>
>>> On Wed, Dec 8, 2021 at 4:59 PM Kyle Paterson  
>>> wrote:
>>>
 Started a new project after not using Django for roughly two years, 
 works fine when running as a development server but throws TypeError: 
 SimpleLazyObject class: property object not callable.

 From apache error log:
 [Wed Dec 08 10:11:53.023239 2021] [wsgi:error] [pid 10704:tid 
 140343150348032] [remote 127.0.0.1:44946] Traceback (most recent call 
 last):
 [Wed Dec 08 10:11:53.023283 2021] [wsgi:error] [pid 10704:tid 
 140343150348032] [remote 127.0.0.1:44946]   File 
 "/home/kyle/active-travel/traveldata/traveldata/wsgi.py", line 14, in 
 
 [Wed Dec 08 10:11:53.023327 2021] [wsgi:error] [pid 10704:tid 
 140343150348032] [remote 127.0.0.1:44946] from django.core.wsgi 
 import get_wsgi_application
 [Wed Dec 08 10:11:53.023351 2021] [wsgi:error] [pid 10704:tid 
 140343150348032] [remote 127.0.0.1:44946]   File 
 "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/__init__.py",
  
 line 1, in 
 [Wed Dec 08 10:11:53.023371 2021] [wsgi:error] [pid 10704:tid 
 140343150348032] [remote 127.0.0.1:44946] from 
 django.utils.version import get_version
 [Wed Dec 08 10:11:53.023377 2021] [wsgi:error] [pid 10704:tid 
 140343150348032] [remote 127.0.0.1:44946]   File 
 "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/version.py",
  
 line 7, in 
 [Wed Dec 08 10:11:53.023430 2021] [wsgi:error] [pid 10704:tid 
 140343150348032] [remote 127.0.0.1:44946] from 
 django.utils.regex_helper import _lazy_re_compile
 [Wed Dec 08 10:11:53.023435 2021] [wsgi:error] [pid 10704:tid 
 140343150348032] [remote 127.0.0.1:44946]   File 
 "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/regex_helper.py",
  
 line 10, in 
 [Wed Dec 08 10:11:53.023524 2021] [wsgi:error] [pid 10704:tid 
 140343150348032] [remote 127.0.0.1:44946] from 
 django.utils.functional import SimpleLazyObject
 [Wed Dec 08 10:11:53.023529 2021] [wsgi:error] [pid 10704:tid 
 140343150348032] [remote 127.0.0.1:44946]   File 
 "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/functional.py",
  
 line 364, in 
 [Wed Dec 08 10:11:53.023578 2021] [wsgi:error] [pid 10704:tid 
 140343150348032] [remote 127.0.0.1:44946] class 
 SimpleLazyObject(LazyObject):
 [Wed Dec 08 10:11:53.023611 2021] [wsgi:error] [pid 10704:tid 
 140343150348032] [remote 127.0.0.1:44946] TypeError: Error when 
 calling the metaclass bases
 [Wed Dec 08 10:11:53.023613 2021] [wsgi:error] [pid 10704:tid 
 140343150348032] [remote 127.0.0.1:44946] 'property' object is not 
 callable

 Apache site config file:
 
 # The ServerName directive sets the request scheme, hostname 
 and port that
 # the server uses to identify itself. This is used when creating
 # redirection URLs. In the context of virtual hosts, the 
 ServerName
 # specifies what hostname must appear in the request's Host: 
 header to
 # match this virtual host. For the default virtual host (this 
 file) this
 # value is not decisive as it is used as a last resort host 
 regardless.
 # However, you must set it for any further virtual host 
 explicitly.
 #ServerName www.example.com

 ServerAdmin webmaster@localhost
 
 Alias /static /home/kyle/active-travel/traveldata/static
 >>> /home/kyle/active-travel/active_travel/static>
 Require all granted
 

 
 
 Require all granted
 
 

 WSGIScriptAlias / 
 

ModuleNotFoundError: No module named [project_name]

2021-12-15 Thread Kyle Paterson
I am using django 4.0 with Apache and mod_wsgi. Whenever I try request the 
site through apache, I get the following error:
[Wed Dec 15 14:51:59.385259 2021] [wsgi:info] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654] mod_wsgi (pid=15535, 
process='traveldata', application='127.0.1.1|'): Loading Python script file 
'/home/kyle/active-travel/traveldata/traveldata/wsgi.py'.
[Wed Dec 15 14:51:59.385699 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654] mod_wsgi (pid=15535): Failed to 
exec Python script file 
'/home/kyle/active-travel/traveldata/traveldata/wsgi.py'.
[Wed Dec 15 14:51:59.385718 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654] mod_wsgi (pid=15535): Exception 
occurred processing WSGI script 
'/home/kyle/active-travel/traveldata/traveldata/wsgi.py'.
[Wed Dec 15 14:51:59.385800 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654] Traceback (most recent call last):
[Wed Dec 15 14:51:59.385828 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654]   File 
"/home/kyle/active-travel/traveldata/traveldata/wsgi.py", line 19, in 

[Wed Dec 15 14:51:59.385831 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654] application = 
django.core.handlers.wsgi.WSGIHandler()
[Wed Dec 15 14:51:59.385836 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654]   File 
"/home/kyle/active-travel/venv/lib/python3.8/site-packages/django/core/handlers/wsgi.py",
 
line 127, in __init__
[Wed Dec 15 14:51:59.385838 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654] self.load_middleware()
[Wed Dec 15 14:51:59.385842 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654]   File 
"/home/kyle/active-travel/venv/lib/python3.8/site-packages/django/core/handlers/base.py",
 
line 39, in load_middleware
[Wed Dec 15 14:51:59.385844 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654] for middleware_path in 
reversed(settings.MIDDLEWARE):
[Wed Dec 15 14:51:59.385847 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654]   File 
"/home/kyle/active-travel/venv/lib/python3.8/site-packages/django/conf/__init__.py",
 
line 84, in __getattr__
[Wed Dec 15 14:51:59.385849 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654] self._setup(name)
[Wed Dec 15 14:51:59.385859 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654]   File 
"/home/kyle/active-travel/venv/lib/python3.8/site-packages/django/conf/__init__.py",
 
line 71, in _setup
[Wed Dec 15 14:51:59.385861 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654] self._wrapped = 
Settings(settings_module)
[Wed Dec 15 14:51:59.385864 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654]   File 
"/home/kyle/active-travel/venv/lib/python3.8/site-packages/django/conf/__init__.py",
 
line 179, in __init__
[Wed Dec 15 14:51:59.385866 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654] mod = 
importlib.import_module(self.SETTINGS_MODULE)
[Wed Dec 15 14:51:59.385869 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654]   File 
"/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
[Wed Dec 15 14:51:59.385871 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654] return 
_bootstrap._gcd_import(name[level:], package, level)
[Wed Dec 15 14:51:59.385875 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654]   File "", line 1014, in _gcd_import
[Wed Dec 15 14:51:59.385878 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654]   File "", line 991, in _find_and_load
[Wed Dec 15 14:51:59.385882 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654]   File "", line 961, in _find_and_load_unlocked
[Wed Dec 15 14:51:59.385886 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654]   File "", line 219, in _call_with_frames_removed
[Wed Dec 15 14:51:59.385889 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654]   File "", line 1014, in _gcd_import
[Wed Dec 15 14:51:59.385893 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654]   File "", line 991, in _find_and_load
[Wed Dec 15 14:51:59.385896 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654]   File "", line 973, in _find_and_load_unlocked
[Wed Dec 15 14:51:59.385905 2021] [wsgi:error] [pid 15535:tid 
140431892707072] [remote 127.0.0.1:44654] ModuleNotFoundError: No module 
named 'traveldata'
[Wed Dec 15 14:51:59.422414 2021] [authz_core:error] [pid 15536:tid 
140431673259776] [client 127.0.0.1:44656] AH01630: client denied by server 
configuration: /home/kyle/active-travel/static, referer: http://localhost/

Settings.py:
"""
Django settings for traveldata 

Team Invoice for Dec 15th - Jan 15th

2021-12-15 Thread Yeddu Prasad
DJ, Please can you send the invoice for Team.

Will send it for payment.

-- 
You received this message because you are subscribed to the Google 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/PH7PR20MB42854623BA01741D1E77E79E8E769%40PH7PR20MB4285.namprd20.prod.outlook.com.


Re: Django reportViewer

2021-12-15 Thread Derek
This seems to be referring to a Microsoft app 
(https://www.thereportviewer.com/) that has nothing to do with Django.

You can, of course, use Django to build a web page that looks similar to 
this, assuming you have access to the underlying database.

On Tuesday, 14 December 2021 at 16:01:39 UTC+2 eugenet...@gmail.com wrote:

> Dear Team,
>
> Is there anyway I can use reportViewer in Django application so that I can 
> have something similar to below image:
>
> [image: image.png]
>
> Let me know how I can do it if it is possible in the django app.
>
> Regards, 
>
>
> *Eugene*
>
>
>

-- 
You received this message because you are subscribed to the Google 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/41a51ebf-6a02-4cd8-884e-71085c2040c6n%40googlegroups.com.


Re: Why does django throw TypeError when sending requests through Apache WSGI?

2021-12-15 Thread Kyle Paterson
I am not using either of those, I think. The only place I explicitly load
settings is in wsgi.py, with the line:
os.environ[‘DJANGO_SETTINGS_MODULE’] = ‘travel data.settings'

On Thu, 9 Dec 2021 at 12:52, Jason  wrote:

>
> with your settings usage, are you defining a property in settings and
> trying to use it anywhere?
>
> furthermore, are you using settings via
>
> from traveldata.traveldata import settings (example)
>
> or via
>
> from django.conf import settings
>
> The latter is the recommended means because settings are lazy loaded.
> On Wednesday, December 8, 2021 at 10:07:11 AM UTC-5 sencer...@gmail.com
> wrote:
>
>> Hi,
>>
>> I think this is not related with apache
>>
>> It seems like class object property is called as a method somehow.
>> Unfortunately the error does not reveal the property name.
>>
>> Regards,
>> Sencer HAMARAT
>>
>>
>>
>> On Wed, Dec 8, 2021 at 4:59 PM Kyle Paterson 
>> wrote:
>>
>>> Started a new project after not using Django for roughly two years,
>>> works fine when running as a development server but throws TypeError:
>>> SimpleLazyObject class: property object not callable.
>>>
>>> From apache error log:
>>> [Wed Dec 08 10:11:53.023239 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946] Traceback (most recent call
>>> last):
>>> [Wed Dec 08 10:11:53.023283 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946]   File
>>> "/home/kyle/active-travel/traveldata/traveldata/wsgi.py", line 14, in
>>> 
>>> [Wed Dec 08 10:11:53.023327 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946] from django.core.wsgi
>>> import get_wsgi_application
>>> [Wed Dec 08 10:11:53.023351 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946]   File
>>> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/__init__.py",
>>> line 1, in 
>>> [Wed Dec 08 10:11:53.023371 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946] from django.utils.version
>>> import get_version
>>> [Wed Dec 08 10:11:53.023377 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946]   File
>>> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/version.py",
>>> line 7, in 
>>> [Wed Dec 08 10:11:53.023430 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946] from
>>> django.utils.regex_helper import _lazy_re_compile
>>> [Wed Dec 08 10:11:53.023435 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946]   File
>>> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/regex_helper.py",
>>> line 10, in 
>>> [Wed Dec 08 10:11:53.023524 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946] from
>>> django.utils.functional import SimpleLazyObject
>>> [Wed Dec 08 10:11:53.023529 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946]   File
>>> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/functional.py",
>>> line 364, in 
>>> [Wed Dec 08 10:11:53.023578 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946] class
>>> SimpleLazyObject(LazyObject):
>>> [Wed Dec 08 10:11:53.023611 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946] TypeError: Error when calling
>>> the metaclass bases
>>> [Wed Dec 08 10:11:53.023613 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946] 'property' object is not
>>> callable
>>>
>>> Apache site config file:
>>> 
>>> # The ServerName directive sets the request scheme, hostname and
>>> port that
>>> # the server uses to identify itself. This is used when creating
>>> # redirection URLs. In the context of virtual hosts, the
>>> ServerName
>>> # specifies what hostname must appear in the request's Host:
>>> header to
>>> # match this virtual host. For the default virtual host (this
>>> file) this
>>> # value is not decisive as it is used as a last resort host
>>> regardless.
>>> # However, you must set it for any further virtual host
>>> explicitly.
>>> #ServerName www.example.com
>>>
>>> ServerAdmin webmaster@localhost
>>>
>>> Alias /static /home/kyle/active-travel/traveldata/static
>>> 
>>> Require all granted
>>> 
>>>
>>> 
>>> 
>>> Require all granted
>>> 
>>> 
>>>
>>> WSGIScriptAlias /
>>> /home/kyle/active-travel/traveldata/traveldata/wsgi.py
>>> process-group=traveldata
>>> WSGIDaemonProcess traveldata
>>> python-home=/home/kyle/active-travel/venv
>>> python-path=/home/kyle/active-travel/traveldata/traveldata
>>> WSGIProcessGroup traveldata
>>>
>>> # Available loglevels: trace8, ..., trace1, debug, info, notice,
>>> warn,
>>> # error,