ValueError: attempted relative import beyond top-level package

2020-10-17 Thread Abdu-H
Hello, i am getting a value error (from ..accounts.models import User. ValueError: attempted relative import beyond top-level package) while trying to import my custom user model, i have read through some post suggesting i create a root folder for my project, I would like to know if that

Re: I got this error "ValueError: attempted relative import beyond top-level package "

2020-09-12 Thread dum dum
Another problem now.. I don't know why, in local localhost:8000/sitemap.xml will generate sitemap.xml. But on heroku, domain/sitemap.xml will error h13. Any suggestions? Thanks. On Wed, Sep 9, 2020 at 11:31 AM hans alexander wrote: > Thanks guys.. Already solved it. > I guess the main reason

Re: I got this error "ValueError: attempted relative import beyond top-level package "

2020-09-08 Thread hans alexander
Thanks guys.. Already solved it. I guess the main reason of the problem is that I'm using Pycharm Community Edition. So the alert error not accurate. Anyway I tried to py manage.py with some alerts, and worked. for example: [image: image.png] I left it like that. And sitemap still works. But now

Re: I got this error "ValueError: attempted relative import beyond top-level package "

2020-09-08 Thread coolguy
I did this long time ago and here is what i did... in settings.py SITE_ID = 1 # Application definition INSTALLED_APPS = [ # ... 'django.contrib.sites', 'django.contrib.sitemaps', ] run migration i.e. >>> py manage.py migrateOR python manage.py migrate aft

Re: I got this error "ValueError: attempted relative import beyond top-level package "

2020-09-08 Thread hans alexander
I followed a tutorial for creating django sitemap, but still got problems along the way. I've seen some videos, but didn't work. Do you have any references for easy way creating django sitemap for blog posts? Sure it would help. Thanks On Wed, Sep 9, 2020 at 12:02 AM coolguy wrote: > Not sure

Re: I got this error "ValueError: attempted relative import beyond top-level package "

2020-09-08 Thread coolguy
Not sure why you are importing this into your main project urls.py but its very straight forward from blog.sitemaps import BlogPostsSitemap question... are you trying to map the application url here? then you should use path('/' , Include("blog.urls")) On Tuesday, September 8, 2020 at 4

Re: I got this error "ValueError: attempted relative import beyond top-level package "

2020-09-08 Thread hans alexander
Sorry, point no 1 needs to be revised.. 1. In urls.py, I want to import BlogPostsSitemap -- 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...

I got this error "ValueError: attempted relative import beyond top-level package "

2020-09-08 Thread hans alexander
then I got an error "ValueError: attempted relative import beyond top-level package" when I ran the server. Is anyone here got the solution? Or maybe some references how to create sitemap on django? Thanks. -- You received this message because you are subscribed to the Google Groups

Re: ValueError: attempted relative import beyond top-level package

2019-03-02 Thread Phako Perez
] > > > ValueError: attempted relative import beyond top-level package > How to fix it in django? > I have this in AppTwo.views > def index(request): > return HttpResponse("My Second Project") > > > > > -- > You received this message

Re: ValueError: attempted relative import beyond top-level package

2019-03-02 Thread '李骏' via Django users
Settings.py: “../apptwo” ==> “appTwo.apps.apptwoconfig”, 发自我的 空间传送门 > 在 2019年3月3日,上午5:25,Bulgarian seller 写道: > > from ..appTwo import views > urlpatterns = [ > path('',views.index), > path('admin/', admin.site.urls), > ] > > > V

ValueError: attempted relative import beyond top-level package

2019-03-02 Thread Bulgarian seller
from ..appTwo import views urlpatterns = [ path('',views.index), path('admin/', admin.site.urls), ] ValueError: attempted relative import beyond top-level package How to fix it in django? I have this in AppTwo.views def index(request): return HttpRespons