Git Hub Project

98 views
Skip to first unread message

Rana Zain

unread,
Aug 4, 2021, 9:12:17 AM8/4/21
to Django users
Hi,
Can anybody help me in running git clone django Project?

Sharif Mehedi

unread,
Aug 4, 2021, 9:16:13 AM8/4/21
to django...@googlegroups.com
On Wednesday, August 4, 2021, 7:11:56 PM GMT+6, Rana Zain <iamrana...@gmail.com> wrote:


Hi,
Can anybody help me in running git clone django Project?

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

Franck Tchouanga

unread,
Aug 4, 2021, 9:40:47 AM8/4/21
to Track django-users@googlegroups.com
Hello I can help you 


whatsApp: 656774424

On Wed, Aug 4, 2021 at 2:12 PM Rana Zain <iamrana...@gmail.com> wrote:
Hi,
Can anybody help me in running git clone django Project?

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


--
Best Wishes

Mr Tchouanga

Satyajit Barik

unread,
Aug 5, 2021, 2:15:27 AM8/5/21
to django...@googlegroups.com
what exactly you're trying to do?

On Wed, Aug 4, 2021 at 6:41 PM Rana Zain <iamrana...@gmail.com> wrote:
Hi,
Can anybody help me in running git clone django Project?

--

Rana Zain

unread,
Aug 9, 2021, 8:24:56 AM8/9/21
to Django users

Thank you so much everyone. It's work.

I have another problem. I am facing this issue in Pycharm .  I tried spaces & tabs.

Error is :"Unindent does not match any outer indentation level""

Kasper Laudrup

unread,
Aug 9, 2021, 8:43:06 AM8/9/21
to django...@googlegroups.com
On 09/08/2021 14.24, Rana Zain wrote:
>
> Thank you so much everyone. It's work.
>
> I have another problem. I am facing this issue in Pycharm .  I tried
> spaces & tabs.
>
> Error is :"Unindent does not match any outer indentation level""

Python uses indentation for scoping unlike most other programming
languages. That is very important and basic knowledge and doesn't have
anything to do with Pycharm.

I would suggest you start by finding a tutorial, book or similar on
Python for absolute beginners and then take it slowly from there.

A quick search showed this:

https://python.land/python-tutorial

But others might have some better suggestions.

Good luck on learning Python. It's a nice and very forgiving language so
you'll make progress very quickly, but like with most other things, you
do need some amount of patience to get started.

Kind regards,

Kasper Laudrup

OpenPGP_signature

Rana Zain

unread,
Aug 10, 2021, 8:03:02 AM8/10/21
to Django users
Thank you very much for your kind words. I am facing this errors :

> ',' or ')' expected
> Unexpected indent
> Statement expected, found Py:DEDENT

for the last 2,3 days. Kindly help me out.

Benjamin Schollnick

unread,
Aug 10, 2021, 8:16:02 AM8/10/21
to django...@googlegroups.com
Thank you very much for your kind words. I am facing this errors :

> ',' or ')' expected
> Unexpected indent
> Statement expected, found Py:DEDENT

for the last 2,3 days. Kindly help me out.

You need to share your code.

Pycharm should be dropping you exactly on the line that is resulting in this error.

Without it, we are guessing.

- Benjamin

On Aug 10, 2021, at 8:03 AM, Rana Zain <iamrana...@gmail.com> wrote:



On Monday, August 9, 2021 at 5:43:06 PM UTC+5 Kasper Laudrup wrote:
On 09/08/2021 14.24, Rana Zain wrote:
>
> Thank you so much everyone. It's work.
>
> I have another problem. I am facing this issue in Pycharm .  I tried
> spaces & tabs.
>
> Error is :"Unindent does not match any outer indentation level""

Python uses indentation for scoping unlike most other programming
languages. That is very important and basic knowledge and doesn't have
anything to do with Pycharm.

I would suggest you start by finding a tutorial, book or similar on
Python for absolute beginners and then take it slowly from there.

A quick search showed this:

https://python.land/python-tutorial

But others might have some better suggestions.

Good luck on learning Python. It's a nice and very forgiving language so
you'll make progress very quickly, but like with most other things, you
do need some amount of patience to get started.

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...@googlegroups.com.

Ryan Nowakowski

unread,
Aug 10, 2021, 9:50:41 AM8/10/21
to django...@googlegroups.com
You might have mixed tabs and spaces. PEP8 standard is 4 spaces per level of indentation, IIRC.

Rana Zain

unread,
Aug 10, 2021, 10:09:53 AM8/10/21
to Django users
"""
Settings and configuration for Django.

Read values from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global_settings.py
for a list of all possible variables.
"""

import importlib
import os
import time
import traceback
import warnings
from pathlib import Path

import django
from django.conf import global_settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.deprecation import RemovedInDjango40Warning
from django.utils.functional import LazyObject, empty

ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE"

PASSWORD_RESET_TIMEOUT_DAYS_DEPRECATED_MSG = (
'The PASSWORD_RESET_TIMEOUT_DAYS setting is deprecated. Use '
'PASSWORD_RESET_TIMEOUT instead.'
)

DEFAULT_HASHING_ALGORITHM_DEPRECATED_MSG = (
'The DEFAULT_HASHING_ALGORITHM transitional setting is deprecated. '
'Support for it and tokens, cookies, sessions, and signatures that use '
'SHA-1 hashing algorithm will be removed in Django 4.0.'
)


class SettingsReference(str):
"""
String subclass which references a current settings value. It's treated as
the value in memory but serializes to a settings.NAME attribute reference.
"""
def __new__(self, value, setting_name):
return str.__new__(self, value)

def __init__(self, value, setting_name):
self.setting_name = setting_name


class LazySettings(LazyObject):
"""
A lazy proxy for either global Django settings or a custom settings object.
The user can manually configure settings prior to using them. Otherwise,
Django uses the settings module pointed to by DJANGO_SETTINGS_MODULE.
"""
def _setup(self, name=None):
"""
Load the settings module pointed to by the environment variable. This
is used the first time settings are needed, if the user hasn't
configured settings manually.
"""
settings_module = os.environ.get(ENVIRONMENT_VARIABLE)
if not settings_module:
desc = ("setting %s" % name) if name else "settings"
raise ImproperlyConfigured(
"Requested %s, but settings are not configured. "
"You must either define the environment variable %s "
"or call settings.configure() before accessing settings."
%(desc, ENVIRONMENT_VARIABLE_django)

self._wrapped = Settings(settings_module)
def __repr__(self):
# Hardcode the class name as otherwise it yields 'Settings'.
if self._wrapped is empty:
return '<LazySettings [Unevaluated]>'
return '<LazySettings "%(settings_module)s">' %{
'settings_module': self._wrapped.SETTINGS_MODULE
}
def __getattr__(self, name):
"""Return the value of a setting and cache it in self.__dict__."""
if self._wrapped is empty:
self._setup(name)
val = getattr(self._wrapped, name)
self.__dict__[name] = val
returnvalue
def __setattr__(self, name, value):
"""
Set the value of setting. Clear all cached values if _wrapped changes
(@override_settings does this) or clear single values when set.
"""
if name == '_wrapped':
self.__dict__.clear()
else:
self.__dict__.pop(name, None)
super().__setattr__ (name, value)


def __delattr__(self, name):
"""Delete a setting and clear it from cache if needed."""
super().__delattr__(name)

self.__dict__.pop(name, None)

def configure(self, default_settings=global_settings, **options):
"""
Called to manually configure the settings. The 'default_settings'
parameter sets where to retrieve any unspecified values from (its
argument must support attribute access (__getattr__)).
"""
if self._wrapped is not empty:
raise RuntimeError('Settings already configured.')
holder = UserSettingsHolder(default_settings)
for name, value in options.items():
if not name.isupper():
raise TypeError\
('Setting %r must be uppercase.' % name)
setattr(holder, name, value)
self._wrapped = holder

@staticmethod
def _add_script_prefix(value):
"""
Add SCRIPT_NAME prefix to relative paths.

Useful when the app is being served at a subpath and manually prefixing
subpath to STATIC_URL and MEDIA_URL in settings is inconvenient.
"""
# Don't apply prefix to absolute paths and URLs.
if value.startswith(('http://', 'https://', '/')):
return value
from django.urls import get_script_prefix
return '%s%s' % (get_script_prefix(), value)

@property
def configured(self):
"""Return True if the settings have already been configured."""
return self._wrapped is not empty

@property
def PASSWORD_RESET_TIMEOUT_DAYS(self):
stack = traceback.extract_stack()
# Show a warning if the setting is used outside of Django.
# Stack index: -1 this line, -2 the caller.
filename, _, _, _ = stack[-2]
if not filename.startswith(os.path.dirname(django.__file__)):
warnings.warn(
PASSWORD_RESET_TIMEOUT_DAYS_DEPRECATED_MSG,
RemovedInDjango40Warning,
stacklevel=2,
)
return self.__getattr__('PASSWORD_RESET_TIMEOUT_DAYS')

@property
def static_url (self):
return self._add_script_prefix(self.__getattr__('STATIC_URL'))

@property
def media_url (self):
return self._add_script_prefix\
(self.__getattr__('MEDIA_URL'))

class Settings:
def __init__(self, settings_module):
# update this dict from global settings (but only for ALL_CAPS settings)
for setting in dir(global_settings):
if setting.isupper():
setattr(self, setting, getattr(global_settings, setting))

# store the settings module in case someone later cares
self.SETTINGS_MODULE = settings_module

mod = importlib.import_module(self.SETTINGS_MODULE)

tuple_settings = (
"INSTALLED_APPS",
"TEMPLATE_DIRS",
"LOCALE_PATHS",
)
self._explicit_settings = set()
for setting in dir(mod):
if setting.isupper():
setting_value = getattr(mod, setting)

if (setting in tuple_settings and
not isinstance(setting_value, (list, tuple))):
raise ImproperlyConfigured("The %s setting must be a list or a tuple. " % setting)
setattr(self, setting, setting_value)
self._explicit_settings.add(setting)

if not self.SECRET_KEY:
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")

if self.is_overridden('PASSWORD_RESET_TIMEOUT_DAYS'):
if self.is_overridden('PASSWORD_RESET_TIMEOUT'):
raise ImproperlyConfigured(
'PASSWORD_RESET_TIMEOUT_DAYS/PASSWORD_RESET_TIMEOUT are '
'mutually exclusive.'
)
setattr(self, 'PASSWORD_RESET_TIMEOUT', self.PASSWORD_RESET_TIMEOUT_DAYS * 60 * 60 * 24)
warnings.warn(PASSWORD_RESET_TIMEOUT_DAYS_DEPRECATED_MSG, RemovedInDjango40Warning)

if self.is_overridden('DEFAULT_HASHING_ALGORITHM'):
warnings.warn(DEFAULT_HASHING_ALGORITHM_DEPRECATED_MSG, RemovedInDjango40Warning)

if hasattr(time, 'tzset') and self.TIME_ZONE:
# When we can, attempt to validate the timezone. If we can't find
# this file, no check happens and it's harmless.
zoneinfo_root = Path('/usr/share/zoneinfo')
zone_info_file = zoneinfo_root.joinpath(*self.TIME_ZONE.split('/'))
if zoneinfo_root.exists() and not zone_info_file.exists():
raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
# Move the time zone info into os.environ. See ticket #2315 for why
# we don't do this unconditionally (breaks Windows).
os.environ['TZ'] = self.TIME_ZONE
time.tzset()

def is_overridden(self, setting):
return setting in self._explicit_settings

def __repr__(self):
return '<%(cls)s "%(settings_module)s">' % {
'cls': self.__class__.__name__,
'settings_module': self.SETTINGS_MODULE,
}


class UserSettingsHolder:
"""Holder for user configured settings."""
# SETTINGS_MODULE doesn't make much sense in the manually configured
# (standalone) case.
SETTINGS_MODULE = None

def __init__(self, default_settings):
"""
Requests for configuration variables not in this class are satisfied
from the module specified in default_settings (if possible).
"""
self.__dict__['_deleted'] = set()
self.default_settings = default_settings

def __getattr__(self, name):
if not name.isupper() or name in self._deleted:
raise AttributeError
return getattr(self.default_settings, name)

def __setattr__(self, name, value):
self._deleted.discard(name)
if name == 'PASSWORD_RESET_TIMEOUT_DAYS':
setattr(self, 'PASSWORD_RESET_TIMEOUT', value * 60 * 60 * 24)
warnings.warn(PASSWORD_RESET_TIMEOUT_DAYS_DEPRECATED_MSG, RemovedInDjango40Warning)
if name == 'DEFAULT_HASHING_ALGORITHM':
warnings.warn(DEFAULT_HASHING_ALGORITHM_DEPRECATED_MSG, RemovedInDjango40Warning)
super().__setattr__(name, value)

def __delattr__(self, name):
self._deleted.add(name)
if hasattr(self, name):
super().__delattr__(name)

def __dir__(self):
return sorted(
s for s in [*self.__dict__, *dir(self.default_settings)]
if s not in self._deleted
)

def is_overridden(self, setting):
deleted = (setting in self._deleted)
set_locally = (setting in self.__dict__)
set_on_default = getattr(self.default_settings, 'is_overridden', lambda s: False)(setting)
return deleted or set_locally or set_on_default

def __repr__(self):
return '<%(cls)s>' % {
'cls': self.__class__.__name__,
}


settings = LazySettings()

Here is the Code now facing many issues 
I cloned this project from Git and want to run it.

Rana Zain

unread,
Aug 10, 2021, 10:10:29 AM8/10/21
to Django users
@Ryan i tired many times tabs and spaces. But not work.

Kasper Laudrup

unread,
Aug 10, 2021, 10:41:13 AM8/10/21
to django...@googlegroups.com
On 10/08/2021 14.03, Rana Zain wrote:
> Thank you very much for your kind words. I am facing this errors :
>

You are more than welcome, but it seems like you didn't really read what
I wrote.

From your last question and your follow up question here, it seems like
you should really learn the basics of programming in Python before
trying to create a Django project.

There are many things to learn and you have to start somewhere.

Did you find any useful Python tutorials for beginners?

Kind regards,

Kasper Laudrup

OpenPGP_signature

Kasper Laudrup

unread,
Aug 10, 2021, 10:43:21 AM8/10/21
to django...@googlegroups.com
On 10/08/2021 16.10, Rana Zain wrote:
> @Ryan i tired many times tabs and spaces. But not work.
>

And it never will. Don't just try. Start slowly with something simple
and everything will slowly start to make sense.

Kind regards,

Kasper Laudrup

OpenPGP_signature

Rana Zain

unread,
Aug 10, 2021, 10:50:15 AM8/10/21
to Django users
I take trainings for python and work on it. Now I am a beginner on Django want to run Git Hub Clone this proejct. 

Kasper Laudrup

unread,
Aug 10, 2021, 11:10:17 AM8/10/21
to django...@googlegroups.com
On 10/08/2021 16.50, Rana Zain wrote:
> I take trainings for python and work on it.

Great. Best of luck.

> Now I am a beginner on Django want to run Git Hub Clone this proejct. 
>

I have no idea what you mean by "run Git Hub Clone this proejct" and to
be honest I'm not really sure you do either.

While the Django code is without doubt very well written, it is also far
too complex for a beginner to understand.

Once again, start with something simple and move on from there.

Kind regards,

Kasper Laudrup

OpenPGP_signature

Benjamin Schollnick

unread,
Aug 10, 2021, 12:10:53 PM8/10/21
to django...@googlegroups.com
What editor are you using?

And it’s not spaces & Tabs, it’s one or the other.  

It has to be uniform.  


That message means that your code blocks aren’t lined up.  Usually that’s because you have an unseen tab, or you are off with your spacing.  But if everything looks fine, then it probably means you have an embedded “invisible” tab.

Show the code, or at least the rest of the error block.  It should show the line number that you need to examine.

- Benjamin



pediah wanmi

unread,
Aug 10, 2021, 3:21:23 PM8/10/21
to django...@googlegroups.com
Well truth is, django is beginner friend, I love and live python, but django is a one step at a time programming platform. No need to hurry. Just like u never can know when exactly u grow to become a big man so is learning django, u never can tell when u get it all
--
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/74c17158-b24a-8bff-cb95-11e9fd3a9456%40stacktrace.dk.

Kasper Laudrup

unread,
Aug 10, 2021, 4:42:51 PM8/10/21
to django...@googlegroups.com
On 10/08/2021 17.53, pediah wanmi wrote:
> Well truth is, django is beginner friend, I love and live python, but
> django is a one step at a time programming platform. No need to hurry.
> Just like u never can know when exactly u grow to become a big man so is
> learning django, u never can tell when u get it all
>

Indeed.

Django is very easy to get started with and has some of the best
documentation of any project I've seen.

That being said, I personally think it might be a good idea to at least
get some basics of Python before starting your first Django project.

It seems like Rana Zain is trying to modify the Django sources without
even knowing the basics of Python which is probably not going to get him
very far.

Then again, only he knows what he's doing and he hasn't really revealed
that, so we can only guess.

In short, it sounds like we agree :-)

Kind regards,

Kasper Laudrup

OpenPGP_signature

Rana Zain

unread,
Aug 11, 2021, 12:19:04 PM8/11/21
to Django users
Thanks everyone for your kind support. I am working hard on python and Django. Earlier I learn python then I started working on Django. I hope you will support me in future as now. 

Rana Zain

unread,
Aug 11, 2021, 12:19:35 PM8/11/21
to Django users
I will very happy if you will help in running this code.

Kasper Laudrup

unread,
Aug 11, 2021, 12:52:20 PM8/11/21
to django...@googlegroups.com
On 11/08/2021 18.19, Rana Zain wrote:
> I will very happy if you will help in running this code.
>

OK, so I've tried to backtrack this a bit.

So it seems like you've gotten hold of the __init__.py file from the
Django projects conf module:

https://github.com/django/django/blob/main/django/conf/__init__.py

You've somehow managed to remove all leading whitespace and now you want
help running it.

Is that correct?

Kind regards,

Kasper Laudrup

OpenPGP_signature

Kasper Laudrup

unread,
Aug 11, 2021, 12:54:32 PM8/11/21
to django...@googlegroups.com
On 11/08/2021 18.19, Rana Zain wrote:
> Thanks everyone for your kind support. I am working hard on python and
> Django. Earlier I learn python then I started working on Django. I hope
> you will support me in future as now. 
>

It will be much easier to support you if you actually respond to advice
you've been given.

Sooner or later people will loose their patience and stop helping you at
all.

I'm quite sure you won't understand this advice as well, but it's worth
trying.

Kind regards,

Kasper Laudrup

OpenPGP_signature

Rana Zain

unread,
Aug 12, 2021, 9:41:22 AM8/12/21
to Django users
Okay. I am checking. Thanks Everyone.
Reply all
Reply to author
Forward
0 new messages