Questions tagged as 'django-urls'

1
answer

Django CORS 'Access-Control-Allow-Origin'

I'm trying to redirect a Django View function to a page in PHP, currently hosted on my own computer. The fact is that I've seen that it gives me a crossover error because I'm calling another link from my own team. I have found a module cal...
asked by 29.01.2018 / 10:05
1
answer

Create a ListView and DetailView with two models

I have 2 models that are related to a OneToOneField , but I do not know how to access the 2 models, my view is as follows: class ListaSolicitudes(ListView): model = Modelo1 #aqui recibe un solo modelo, como uso el segundo modelos...
asked by 07.03.2018 / 18:09
1
answer

Regular expression for django url with slug containing "/"

The idea is to create a regular expression to configure the url I have 2 models, category and articles. The article model has a FK to category and the slug makes the join correctly slug (category) / slug (article). I want to use the separator...
asked by 23.08.2017 / 05:13
1
answer

Send and receive parameter via url - Django

I have this tournament detail template, I need to send as parameter the id of the tournament because when creating a team it has a direct relationship to the tournament that participates. As I send and receive in the template equipo_create the i...
asked by 18.04.2017 / 23:30
2
answers

Display images from a database in Django

I have a model that has an image field, at the beginning the image was shown, but after I made a few changes but without changing the code that serves the image now it does not work, I have tried everything but it does not work, this is the code...
asked by 17.10.2017 / 15:53
1
answer

Error in deploy with NameError: name 'static' is not defined

When uploading files to the server in pythonanywere I get the following error line. Any ideas on how to solve it? File "/home/factura/wp/wp/wp/urls.py", line 36, in <module> urlpatterns += static(settings.MEDIA_URL, document_root=se...
asked by 07.12.2018 / 23:32
1
answer

Use UpdateView for two Django operations

I want to use a view to do two operations. From a list of articles I want to add or subtract the current quantity of the article. I duplicated my view and changed the name to reflect the operation I want to do, I created 2 URLs with different...
asked by 15.06.2018 / 21:19
1
answer

Pages not found Django

I have a project halfway and I was adding some new pages, but when trying to access it tells me the following: Using the URLconf defined in authtest.urls, Django tried these URL patterns, in this order: ^admin/ ^$ [name='home'] ^resolutividad/...
asked by 26.10.2017 / 18:05
1
answer

Problem in urls.py

urls.py #home/urls.py from django.urls import path, re_path from home.views import homePageView, dashboardPageView, userPageView, CoinsPageView urlpatterns = [ path('',homePageView.as_view(),name='home'), re_path('activate/(?P...
asked by 09.07.2018 / 23:44
1
answer

Assign a foreign key from one form to another in django and redirect with reverse_lazy

I have 2 test models, Model1 and Model2. Model2 has the OneToOneField key to Model1, but I can not assign the Model1_id to Model2_id to keep the relationship of the models, I do not know how to access that data from the views.py to assign it in...
asked by 05.03.2018 / 20:33